diff --git a/data/core.telegram.org.html b/data/core.telegram.org.html index 3aecca7fd6..98beb71af1 100644 --- a/data/core.telegram.org.html +++ b/data/core.telegram.org.html @@ -43,140 +43,141 @@
You can also add Telegram Widgets to your website.
Designers are welcome to create Animated Stickers or Custom Themes for Telegram.
This API allows you to connect bots to our system. Telegram Bots are special accounts that do not require an additional phone number to set up. These accounts serve as an interface for code running somewhere on your server.
-To use this, you don't need to know anything about how our MTProto encryption protocol works — our intermediary server will handle all encryption and communication with the Telegram API for you. You communicate with this server via a simple HTTPS-interface that offers a simplified version of the Telegram API.
+To use this, you don't need to know anything about how our MTProto encryption protocol works — our intermediary server will handle all encryption and communication with the Telegram API for you. You communicate with this server via a simple HTTPS-interface that offers a simplified version of the Telegram API.
- +
Bot developers can also make use of our Payments API to accept payments from Telegram users around the world.
Even if you're looking for maximum customization, you don't have to create your app from scratch. Try our Telegram Database Library (or simply TDLib), a tool for third-party developers that makes it easy to build fast, secure and feature-rich Telegram apps.
+Even if you're looking for maximum customization, you don't have to create your app from scratch. Try our Telegram Database Library (or simply TDLib), a tool for third-party developers that makes it easy to build fast, secure and feature-rich Telegram apps.
TDLib takes care of all network implementation details, encryption and local data storage, so that you can dedicate more time to design, responsive interfaces and beautiful animations.
TDLib supports all Telegram features and makes developing Telegram apps a breeze on any platform. It can be used on Android, iOS, Windows, macOS, Linux and virtually any other system. The library is open source and compatible with virtually any programming language.
This API allows you to build your own customized Telegram clients. It is 100% open for all developers who wish to create Telegram applications on our platform. Feel free to study the open source code of existing Telegram applications for examples of how things work here. Don't forget to register your application in our system.
+This API allows you to build your own customized Telegram clients. It is 100% open for all developers who wish to create Telegram applications on our platform. Feel free to study the open source code of existing Telegram applications for examples of how things work here. Don't forget to register your application in our system.
-How to get your application identifier and create a new Telegram app.
-How to register a user's phone to start using the API.
-How to login to a user's account if they have enabled 2FA, how to change password.
-How to register a user's phone to start using the API.
+How to login to a user's account if they have enabled 2FA, how to change password.
+QR code login flow
-How to handle API return errors correctly.
-How to connect to the closest DC access point for faster interaction with the API, and things to watch out for when developing a client.
-How to subscribe to updates and handle them properly.
-How to subscribe and handle them properly.
-How to handle channels, supergroups, groups, and what's the difference between them.
-How to handle channels, supergroups, groups, and what's the difference between them.
+Telegram offers detailed channel statistics for channels and supergroups.
-Additional options for calling methods.
-How to transfer large data batches correctly.
-How to fetch results from large lists of objects.
-The MTProto API has multiple client configuration parameters that can be fetched with the appropriate methods.
-End-to-end-encrypted messaging.
-Important checks required in your client application.
-Binding temporary authorization key to permanent ones.
-End-to-end-encrypted calls.
-Ways to boost API interactions.
-A list of available high-level methods.
-Text and JSON-presentation of types and methods used in API.
-A list of available schema versions.
-How to work with bots using the MTProto API.
-Bots offer a set of commands that can be used by users in private, or in a chat.
-Users can interact with your bot via buttons or even inline buttons, straight from inline messages in any chat.
-Users can interact with your bot via inline queries, straight from the text input field in any chat.
-Bots can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats; how to work with games in the MTProto API.
-Telegram allows applying detailed message filters while looking for messages in chats.
This allows the server to filter messages based on a text query, and even on their type, and this feature is often used by graphical clients to implement features like the chat gallery, chat profile pictures and more.
Telegram allows applying detailed message filters while looking for messages in chats. +This allows the server to filter messages based on a text query, and even on their type, and this feature is often used by graphical clients to implement features like the chat gallery, chat profile pictures and more.
+Telegram allows sending polls and quizes, that can be voted on by thousands, if not milions of users in chats and channels.
-How to handle admin permissions, granular bans and global permissions in channels, groups and supergroups.
-Groups can be associated to a channel as a discussion group, to allow users to discuss about posts.
-Telegram allows commenting on a channel post or on a generic group message, thanks to message threads.
-Both supergroups and channels offer a so-called admin log, a log of recent relevant supergroup and channel actions, like the modification of group/channel settings or information on behalf of an admin, user kicks and bans, and more.
-Telegram allows pinning multiple messages on top of a specific chat.
-Telegram allows mentioning other users in case of urgent duckling matters, and quickly navigating to those mentions in order to read them as swiftly as possible.
-Telegram allows scheduling messages.
-Telegram allows sending the live geolocation of a user in a chat, optionally setting a proximity alert.
-Sometimes, user and channel constructors met in group chat updates may not contain full info about the user: how to handle such constructors.
-How to reset an account if the 2FA password was forgotten.
-Telegram allows importing messages and media from foreign chat apps.
+How to work with Telegram Passport directly using the MTProto API.
-How to work with Telegram Payments directly using the MTProto API.
-How to create styled text with message entities
-Graphical telegram clients should transform emojis into their respective animated version.
-Telegram supports sending animated dice emojis.
-How to handle message drafts
-Working with folders
-If enabled, the rating of top peers indicates the relevance of a frequently used peer in a certain category (frequently messaged users, frequently used bots, inline bots, frequently visited channels and so on).
-How to handle file references.
-Handle Seamless Telegram Login URL authorization requests.
-When interacting with HTML5 games and the websites of payment gateways, Telegram apps should expose the following JS APIs.
- +When interacting with HTML5 games and the websites of payment gateways, Telegram apps should expose the following JS APIs.
diff --git a/data/core.telegram.org/api.html b/data/core.telegram.org/api.html index 3aecca7fd6..98beb71af1 100644 --- a/data/core.telegram.org/api.html +++ b/data/core.telegram.org/api.html @@ -43,140 +43,141 @@You can also add Telegram Widgets to your website.
Designers are welcome to create Animated Stickers or Custom Themes for Telegram.
This API allows you to connect bots to our system. Telegram Bots are special accounts that do not require an additional phone number to set up. These accounts serve as an interface for code running somewhere on your server.
-To use this, you don't need to know anything about how our MTProto encryption protocol works — our intermediary server will handle all encryption and communication with the Telegram API for you. You communicate with this server via a simple HTTPS-interface that offers a simplified version of the Telegram API.
+To use this, you don't need to know anything about how our MTProto encryption protocol works — our intermediary server will handle all encryption and communication with the Telegram API for you. You communicate with this server via a simple HTTPS-interface that offers a simplified version of the Telegram API.
- +
Bot developers can also make use of our Payments API to accept payments from Telegram users around the world.
Even if you're looking for maximum customization, you don't have to create your app from scratch. Try our Telegram Database Library (or simply TDLib), a tool for third-party developers that makes it easy to build fast, secure and feature-rich Telegram apps.
+Even if you're looking for maximum customization, you don't have to create your app from scratch. Try our Telegram Database Library (or simply TDLib), a tool for third-party developers that makes it easy to build fast, secure and feature-rich Telegram apps.
TDLib takes care of all network implementation details, encryption and local data storage, so that you can dedicate more time to design, responsive interfaces and beautiful animations.
TDLib supports all Telegram features and makes developing Telegram apps a breeze on any platform. It can be used on Android, iOS, Windows, macOS, Linux and virtually any other system. The library is open source and compatible with virtually any programming language.
This API allows you to build your own customized Telegram clients. It is 100% open for all developers who wish to create Telegram applications on our platform. Feel free to study the open source code of existing Telegram applications for examples of how things work here. Don't forget to register your application in our system.
+This API allows you to build your own customized Telegram clients. It is 100% open for all developers who wish to create Telegram applications on our platform. Feel free to study the open source code of existing Telegram applications for examples of how things work here. Don't forget to register your application in our system.
-How to get your application identifier and create a new Telegram app.
-How to register a user's phone to start using the API.
-How to login to a user's account if they have enabled 2FA, how to change password.
-How to register a user's phone to start using the API.
+How to login to a user's account if they have enabled 2FA, how to change password.
+QR code login flow
-How to handle API return errors correctly.
-How to connect to the closest DC access point for faster interaction with the API, and things to watch out for when developing a client.
-How to subscribe to updates and handle them properly.
-How to subscribe and handle them properly.
-How to handle channels, supergroups, groups, and what's the difference between them.
-How to handle channels, supergroups, groups, and what's the difference between them.
+Telegram offers detailed channel statistics for channels and supergroups.
-Additional options for calling methods.
-How to transfer large data batches correctly.
-How to fetch results from large lists of objects.
-The MTProto API has multiple client configuration parameters that can be fetched with the appropriate methods.
-End-to-end-encrypted messaging.
-Important checks required in your client application.
-Binding temporary authorization key to permanent ones.
-End-to-end-encrypted calls.
-Ways to boost API interactions.
-A list of available high-level methods.
-Text and JSON-presentation of types and methods used in API.
-A list of available schema versions.
-How to work with bots using the MTProto API.
-Bots offer a set of commands that can be used by users in private, or in a chat.
-Users can interact with your bot via buttons or even inline buttons, straight from inline messages in any chat.
-Users can interact with your bot via inline queries, straight from the text input field in any chat.
-Bots can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats; how to work with games in the MTProto API.
-Telegram allows applying detailed message filters while looking for messages in chats.
This allows the server to filter messages based on a text query, and even on their type, and this feature is often used by graphical clients to implement features like the chat gallery, chat profile pictures and more.
Telegram allows applying detailed message filters while looking for messages in chats. +This allows the server to filter messages based on a text query, and even on their type, and this feature is often used by graphical clients to implement features like the chat gallery, chat profile pictures and more.
+Telegram allows sending polls and quizes, that can be voted on by thousands, if not milions of users in chats and channels.
-How to handle admin permissions, granular bans and global permissions in channels, groups and supergroups.
-Groups can be associated to a channel as a discussion group, to allow users to discuss about posts.
-Telegram allows commenting on a channel post or on a generic group message, thanks to message threads.
-Both supergroups and channels offer a so-called admin log, a log of recent relevant supergroup and channel actions, like the modification of group/channel settings or information on behalf of an admin, user kicks and bans, and more.
-Telegram allows pinning multiple messages on top of a specific chat.
-Telegram allows mentioning other users in case of urgent duckling matters, and quickly navigating to those mentions in order to read them as swiftly as possible.
-Telegram allows scheduling messages.
-Telegram allows sending the live geolocation of a user in a chat, optionally setting a proximity alert.
-Sometimes, user and channel constructors met in group chat updates may not contain full info about the user: how to handle such constructors.
-How to reset an account if the 2FA password was forgotten.
-Telegram allows importing messages and media from foreign chat apps.
+How to work with Telegram Passport directly using the MTProto API.
-How to work with Telegram Payments directly using the MTProto API.
-How to create styled text with message entities
-Graphical telegram clients should transform emojis into their respective animated version.
-Telegram supports sending animated dice emojis.
-How to handle message drafts
-Working with folders
-If enabled, the rating of top peers indicates the relevance of a frequently used peer in a certain category (frequently messaged users, frequently used bots, inline bots, frequently visited channels and so on).
-How to handle file references.
-Handle Seamless Telegram Login URL authorization requests.
-When interacting with HTML5 games and the websites of payment gateways, Telegram apps should expose the following JS APIs.
- +When interacting with HTML5 games and the websites of payment gateways, Telegram apps should expose the following JS APIs.
diff --git a/data/core.telegram.org/api/animated-emojis.html b/data/core.telegram.org/api/animated-emojis.html index b88fa154f4..b04d6b8b19 100644 --- a/data/core.telegram.org/api/animated-emojis.html +++ b/data/core.telegram.org/api/animated-emojis.html @@ -50,7 +50,8 @@On startup, clients should fetch the animated emoji stickerset by calling the messages.getStickerSet method, providing inputStickerSetAnimatedEmoji to the stickerset
field.
The returned stickerset will contain a set of animated stickers, one for each of the supported emojis.
Clients should substitute messages containing only one instance of one of the allowed emojis with the respective animated sticker.
-Animated emojis should loop only once when first sent or received, or when clicked.
+Animated emojis should loop only once when first sent or received, or when clicked.
+For supported emojis, clients on both sides of private chats with users are supposed to show a reaction animation when any of the two users clicks on the animated emoji: click here for more info ».
For special dice emojis like ,
, or
, clients are supposed to behave differently both when sending and receiving such emojis: click here for more info ».
Certained animated emojis should play sound when clicked, as specified by server-side configuration.
@@ -72,7 +73,45 @@ The returned stickerset will contain a set of animated stickers, one for each of "file_reference_base64": "AF-4ApAedNln3IMEHH-SUQuH8L9g" }, } -The file reference field should be base64-decoded before downloading the file
+The file reference field should be base64-decoded before downloading the file.
+inputStickerSetAnimatedEmojiAnimations#cde3739 = InputStickerSet;
+
+messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
+
+stickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;
+
+sendMessageEmojiInteraction#25972bcb emoticon:string msg_id:int interaction:DataJSON = SendMessageAction;
+sendMessageEmojiInteractionSeen#b665902e emoticon:string = SendMessageAction;
+
+updateUserTyping#c01e857f user_id:long action:SendMessageAction = Update;
+
+---functions---
+
+messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;
+
+messages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;
+On startup, clients should fetch the animated reaction emoji stickerset by calling the messages.getStickerSet method, providing inputStickerSetAnimatedEmojiAnimations to the stickerset
field.
+The returned stickerset will contain a set of animated emoji reactions, one or more for each of the supported emojis.
+If a set of reactions for the emoji is returned, the same reactions should also be assigned to the
,
,
,
,
,
,
and
emojis.
Clients on both sides of private chats with users should overlay one of the appropriate reaction animations over the animated sticker when any of the two users clicks on a supported animated emoji.
+The reaction animation for each separate tap should be chosen randomly from all the available reactions for a given emoji, and multiple taps should be aggregated and sent to the other user as follows:
At each tap, clients should store all occurred taps in a local list.
+After 1 second has elapsed with no more taps, the local list should be cleared and stored taps should be sent using messages.setTyping, passing a sendMessageEmojiInteraction constructor with the following fields:
emoticon
- The emoji we're reacting tomsg_id
- Message ID of the animated emoji that was clickedinteraction
- A JSON object with interaction info, containing the following keys:v
- An integer indicating the object version, currently 1
a
- An array of JSON objects, each containing the following keys:t
- float, number of seconds that passed since the previous tap in the array, the first tap uses a value of 0.0
.i
- integer, 1-based index of the randomly chosen animation for the tap (equivalent to the index of a specific emoji-related animation in stickerPack + 1).1 second after the receiving user has seen the last reaction animation for a specific emoji, an acknowledgement must be sent using messages.setTyping, passing a sendMessageEmojiInteractionSeen with that emoji.
diff --git a/data/core.telegram.org/api/auth.html b/data/core.telegram.org/api/auth.html index 484a08a29f..0f6f5bb666 100644 --- a/data/core.telegram.org/api/auth.html +++ b/data/core.telegram.org/api/auth.html @@ -42,56 +42,64 @@Authorization is associated with a client’s encryption key identifier: auth_key_id. No additional parameters need to be passed into methods following authorization.
-To log in as a bot, follow these instructions ».
-To log in as a bot, follow these instructions ».
+Example implementations: telegram for android, tdlib.
-To show a nicely formatted and validated phone number field, the help.countriesList constructor can be obtained using the help.getCountriesList method.
The help.countriesList config is then used as described here ».
Authorization requires that a text message containing an authorization code first be sent to the user’s phone.
This may be done using the auth.sendCode method.
The system will automatically choose how to send the authorization code; there are four possible ways the code can arrive:
To show a nicely formatted and validated phone number field, the help.countriesList constructor can be obtained using the help.getCountriesList method.
+The help.countriesList config is then used as described here ».
Authorization requires that a text message containing an authorization code first be sent to the user’s phone.
+This may be done using the auth.sendCode method.
+The system will automatically choose how to send the authorization code; there are four possible ways the code can arrive:
The auth.sendCode method also has parameters for enabling/disabling use of flash calls, and allows passing an SMS token that will be included in the sent SMS.
For example, the latter is required in newer versions of android, to use the android SMS receiver APIs.
The auth.sendCode method also has parameters for enabling/disabling use of flash calls, and allows passing an SMS token that will be included in the sent SMS. +For example, the latter is required in newer versions of android, to use the android SMS receiver APIs.
The returned auth.SentCode object will contain multiple parameters:
flags | -# | +# | Flags, see TL conditional fields |
type | -auth.SentCodeType | +auth.SentCodeType | Phone code type |
phone_code_hash | -string | +string | Phone code hash, to be stored and later re-used with auth.signIn |
next_type | -flags.1?auth.CodeType | +flags.1?auth.CodeType | Phone code type that will be sent next, if the phone code is not received within timeout seconds: to send it use auth.resendCode |
timeout | -flags.2?int | +flags.2?int | Timeout for reception of the phone code |
If the message takes too long (timeout
seconds) to arrive at the phone, the auth.resendCode method may be invoked to resend a code of type next_type
.
If the same happens again, you can use auth.resendCode with the next_type
returned by the previous call to auth.resendCode.
To cancel the verification code use auth.cancelCode.
If the message takes too long (timeout
seconds) to arrive at the phone, the auth.resendCode method may be invoked to resend a code of type next_type
.
+If the same happens again, you can use auth.resendCode with the next_type
returned by the previous call to auth.resendCode.
+To cancel the verification code use auth.cancelCode.
When user enters verification code, the auth.signIn method must be used to validate it and possibly sign user in.
-If the code was entered correctly, but the method returns auth.authorizationSignUpRequired, it means that account with this phone number doesn't exist yet: user needs to provide basic information, accept terms of service and then the new user registration method (auth.signUp) must be invoked.
-When trying to sign in using auth.signIn, an error 400 SESSION_PASSWORD_NEEDED may be returned, if the user has two-factor authentication enabled.
In this case, instructions for SRP 2FA authentication must be followed.
If the code was entered correctly, but the method returns auth.authorizationSignUpRequired, it means that account with this phone number doesn't exist yet: user needs to provide basic information, accept terms of service and then the new user registration method (auth.signUp) must be invoked.
+When trying to sign in using auth.signIn, an error 400 SESSION_PASSWORD_NEEDED may be returned, if the user has two-factor authentication enabled. +In this case, instructions for SRP 2FA authentication must be followed.
To set up two-factor authorization on an already authorized account, follow the SRP 2FA authentication docs.
-Each phone number is limited to only a certain amount of logins per day (e.g. 5, but this is subject to change) after which the API will return a FLOOD error until the next day. This might not be enough for testing the implementation of User Authorization flows in client applications.
There are several reserved phone number prefixes for testing that your application handles redirects between DCs, sign up, sign in and 2FA flows correctly. These numbers are only available on Test DCs (their IP addresses for TCP transport are availble in API development tools panel after api_id was obtained, URI format for HTTPS/Websocket transport).
If you wish to emulate an application of a user associated with DC number X, it is sufficient to specify the phone number as 99966XYYYY
, where YYYY are random numbers, when registering the user. A user like this would always get XXXXXX as the login confirmation code (the DC number, repeated six times). Note that the value of X must be in the range of 1-3 because there are only 3 Test DCs. When the flood limit is reached for any particular test number, just choose another number (changing the YYYY random part).
-To help you with working on production DCs, logins with the same phone number with which the
api_id
was registered have more generous flood limits.
As a result of authorization, the client key, auth_key_id, becomes associated with the user, and each subsequent API call with this key will be executed with that user’s identity. The authorization method itself returns the relevant user. It is best to immediately store the User ID locally in a binding with the key.
Only a small portion of the API methods are available to unauthorized users:
Other methods will result in an error: 401 UNAUTHORIZED.
-Other methods will result in an error: 401 UNAUTHORIZED.
diff --git a/data/core.telegram.org/api/bots/buttons.html b/data/core.telegram.org/api/bots/buttons.html index fafef10e7e..caa63df0dc 100644 --- a/data/core.telegram.org/api/bots/buttons.html +++ b/data/core.telegram.org/api/bots/buttons.html @@ -60,11 +60,11 @@ This article describes the full button flow, using the MTProto API. keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow; replyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup; -replyKeyboardForceReply#f4108aa0 flags:# single_use:flags.1?true selective:flags.2?true = ReplyMarkup; -replyKeyboardMarkup#3502758c flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector<KeyboardButtonRow> = ReplyMarkup; +replyKeyboardForceReply#86b40b08 flags:# single_use:flags.1?true selective:flags.2?true placeholder:flags.3?string = ReplyMarkup; +replyKeyboardMarkup#85dd99d1 flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector<KeyboardButtonRow> placeholder:flags.3?string = ReplyMarkup; replyInlineMarkup#48a30254 rows:Vector<KeyboardButtonRow> = ReplyMarkup; -message#58ae39c9 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> = Message; +message#85d6cbe2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message; ---functions--- @@ -148,9 +148,9 @@ The same should happen when clicking on @botfather bot to allow securely transferring the ownership of a bot to another user.updateBotCallbackQuery#e73547e1 flags:# query_id:long user_id:int peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;
+updateBotCallbackQuery#b9cfc48d flags:# query_id:long user_id:long peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;
-updateInlineBotCallbackQuery#f9d27a5a flags:# query_id:long user_id:int msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;
+updateInlineBotCallbackQuery#691e9052 flags:# query_id:long user_id:long msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;
---functions---
diff --git a/data/core.telegram.org/api/bots/commands.html b/data/core.telegram.org/api/bots/commands.html
index 145dcf980f..4f497fa2b8 100644
--- a/data/core.telegram.org/api/bots/commands.html
+++ b/data/core.telegram.org/api/bots/commands.html
@@ -46,12 +46,12 @@
Getting commands
botCommand#c27ac8c7 command:string description:string = BotCommand;
-botInfo#98e81d3a user_id:int description:string commands:Vector<BotCommand> = BotInfo;
+botInfo#1b74b335 user_id:long description:string commands:Vector<BotCommand> = BotInfo;
-channelFull#f0e6672a flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?int location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int = ChatFull;
-userFull#edf17c12 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int = UserFull;
+channelFull#e9b27a17 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string = ChatFull;
+userFull#d697ff05 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string = UserFull;
-user#938458c1 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;
+user#3ff6ecb0 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;
The botInfo constructors contained in the userFull, chatFull, channelFull contain a list of commands, and for groups, the ID and a description of each bot.
In graphical clients, when users begin a message with a /
, a list of commands supported by all bots present in the current chat should be shown; the same should be done for one-to-one chats with the bot itself.
If the command list of a bot changes, the bot_info_version
contained in the user constructor received in updates will change; this indicates that the client should refetch full bot information using users.getFullUser.
@@ -60,7 +60,7 @@
---functions---
-bots.setBotCommands#805d46f6 commands:Vector<BotCommand> = Bool;
+bots.setBotCommands#517165a scope:BotCommandScope lang_code:string commands:Vector<BotCommand> = Bool;
The command list can be changed by the owner of the bot through @botfather, but bots can also change their own command list by invoking bots.setBotCommands.
diff --git a/data/core.telegram.org/api/bots/games.html b/data/core.telegram.org/api/bots/games.html index e2414edf79..bd41666be3 100644 --- a/data/core.telegram.org/api/bots/games.html +++ b/data/core.telegram.org/api/bots/games.html @@ -80,9 +80,9 @@ Instead, they should send highscores to an intermediate server, that will then rmessageActionGameScore#92a72876 game_id:long score:int = MessageAction;
-messageService#286fa604 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction = Message;
+messageService#2b085862 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction ttl_period:flags.25?int = Message;
-highScore#58fffcd0 pos:int user_id:int score:int = HighScore;
+highScore#73a379eb pos:int user_id:long score:int = HighScore;
messages.highScores#9a3bfd99 scores:Vector<HighScore> users:Vector<User> = messages.HighScores;
diff --git a/data/core.telegram.org/api/bots/inline.html b/data/core.telegram.org/api/bots/inline.html
index a62626c9c4..8646dea10b 100644
--- a/data/core.telegram.org/api/bots/inline.html
+++ b/data/core.telegram.org/api/bots/inline.html
@@ -79,7 +79,7 @@ This article describes the full inline bot flow, using the MTProto API.
inputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult;
inputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult;
-updateBotInlineQuery#54826690 flags:# query_id:long user_id:int query:string geo:flags.0?GeoPoint offset:string = Update;
+updateBotInlineQuery#496f379c flags:# query_id:long user_id:long query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update;
---functions---
@@ -114,7 +114,7 @@ Graphical clients should display the bot @username
in the header of
Inline feedback
inputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;
-updateBotInlineSend#e48f964 flags:# user_id:int query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;
+updateBotInlineSend#12f12a07 flags:# user_id:long query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;
If feedback collection is enabled, the bot may receive an updateBotInlineSend when the user chooses and sends an inline result.
Even if the probability setting is set to 100%, not all inline results may be reported due to caching (see the cache_time
parameter in Answering a callback query).
Feedback collection can also create load issues for popular bots, so adjust the probability setting to a lower value in such cases.
@username
in the header of
geo
- For bots requiring location-based inline results, the user's locationupdateInlineBotCallbackQuery#f9d27a5a flags:# query_id:long user_id:int msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;
+updateInlineBotCallbackQuery#691e9052 flags:# query_id:long user_id:long msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;
inputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;
diff --git a/data/core.telegram.org/api/channel.html b/data/core.telegram.org/api/channel.html
index ce16d9c590..b1415a7677 100644
--- a/data/core.telegram.org/api/channel.html
+++ b/data/core.telegram.org/api/channel.html
@@ -41,13 +41,17 @@
-Channels, chats & supergroups
-Channels are a tool for broadcasting your messages to large audiences. They can have an unlimited number of subscribers, they can be public with a permanent URL and each post in a channel has its own view counter.
-Technically, they are represented by channel constructors.
-Supergroups are a powerful tool for building communities and can support up to 200,000 members each.
-Technically, supergroups are actually channels: they are represented by channel constructors, with the megagroup
flag set to true.
-Channels and supergroup can be created using the channels.createChannel method, by setting the appropriate broadcast
or megagroup
flags.
-Supergroups can also be assigned a geo_point
to become geochats.
+Channels, chats, supergroups & gigagroups
+Channels are a tool for broadcasting your messages to large audiences. They can have an unlimited number of subscribers, they can be public with a permanent URL and each post in a channel has its own view counter.
+Technically, they are represented by channel constructors.
+Supergroups are a powerful tool for building communities and can support up to 200,000 members each.
+Technically, supergroups are actually channels: they are represented by channel constructors, with the megagroup
flag set to true.
+Gigagroups are something inbetween a channel and a supergroup.
+An admin, when prompted by the API using suggestions », can convert a megagroup into a gigagroup using channels.convertToGigagroup (one way only).
+After that, only admins will be able to write in the group (like when send_messages
rights are disabled for all group participants by default), but the participant limit is removed and the group can become much bigger than a supergroup (e.g. >200,000 currently).
+Also, one can't invite people into gigagroups and participants of voice chats in gigagroups are muted by default.
+Channels and supergroup can be created using the channels.createChannel method, by setting the appropriate broadcast
or megagroup
flags.
+Supergroups can also be assigned a geo_point
to become geochats.
In previous versions of telegram, only normal groups (represented by chat constructors) could be created using messages.createChat: these groups have fewer features, and can only have 200 members at max.
Migration
To upgrade a legacy group to a supergroup, messages.migrateChat can be used.
diff --git a/data/core.telegram.org/api/config.html b/data/core.telegram.org/api/config.html
index cf24734f2e..79aef10041 100644
--- a/data/core.telegram.org/api/config.html
+++ b/data/core.telegram.org/api/config.html
@@ -42,7 +42,7 @@
The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.
-MTProto configuration
+MTProto configuration
config#330b4067 flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true ignore_phone_entities:flags.5?true revoke_pm_inbox:flags.6?true blocked_mode:flags.8?true pfs_enabled:flags.13?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> dc_txt_domain_name:string chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int pinned_infolder_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string autoupdate_url_prefix:flags.7?string gif_search_username:flags.9?string venue_search_username:flags.10?string img_search_username:flags.11?string static_maps_provider:flags.12?string caption_length_max:int message_length_max:int webfile_dc_id:int suggested_lang_code:flags.2?string lang_pack_version:flags.2?int base_lang_pack_version:flags.2?int = Config;
nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
@@ -51,7 +51,7 @@
help.getConfig#c4f9186b = Config;
help.getNearestDc#1fb33026 = NearestDc;
The huge config constructor contains lots of useful information, from chat and message size limitations, to privacy settings, online status refresh interval and timeout, VoIP configuration, default inline bot usernames for GIF, image and venue lookup, and lots of other global and user-specific information, check out the constructor page for more information.
-Client configuration
+Client configuration
jsonObjectValue#c0de1bd9 key:string value:JSONValue = JSONObjectValue;
jsonNull#3f6d7b68 = JSONValue;
@@ -76,24 +76,33 @@ While help.getConfig returns MTProto-specif
emojies_sounds
- A map of soundbites to be played when the user clicks on the specified animated emoji; the file reference field should be base64-decoded before downloading the file (map of file IDs, with emoji string keys)
gif_search_branding
- Specifies the name of the service providing GIF search through gif_search_username (string)
gif_search_emojies
- Specifies a list of emojies that should be suggested as search term in a bar above the GIF search box (array of string emojis)
+stickers_emoji_suggest_only_api
- Specifies that the app should not display local sticker suggestions for emojis at all and just use the result of messages.getStickers (bool)
+stickers_emoji_cache_time
- Specifies the validity period of the local cache of messages.getStickers, also relevant when generating the pagination hash when invoking the method. (int)
qr_login_camera
- Whether the Settings->Devices menu should show an option to scan a QR login code (boolean)
qr_login_code
- Whether the login screen should show a QR code login option, possibly as default login method (string, "disabled", "primary" or "secondary")
dialog_filters_enabled
- Whether clients should show an option for managing dialog filters AKA folders (boolean)
dialog_filters_tooltip
- Whether clients should actively show a tooltip, inviting the user to configure dialog filters AKA folders; typically this happens when the chat list is long enough to start getting cluttered. (boolean)
+autoarchive_setting_available
- Whether clients can invoke account.setGlobalPrivacySettings with globalPrivacySettings.archive_and_mute_new_noncontact_peers = boolTrue
, to automatically archive and mute new incoming chats from non-contacts. (boolean)
+pending_suggestions
- Contains a list of suggestions that should be actively shown as a tooltip to the user. (Array of strings, possible values shown in the suggestions section ».
+url_auth_domains
- A list of domains that support automatic login with manual user confirmation, click here for more info on URL authorization ». (array of strings)
+autologin_domains
- A list of Telegram domains that support automatic login with no user confirmation, click here for more info on URL authorization ». (array of strings)
+autologin_token
- Autologin token, click here for more info on URL authorization ». (string)
+round_video_encoding
- Contains a set of recommended codec parameters for round videos.
+chat_read_mark_size_threshold
- Per-user read receipts, fetchable using messages.getMessageReadParticipants will be available in groups with less than chat_read_mark_size_threshold
participants. (int)
+chat_read_mark_expire_period
- To protect user privacy, read receipts are only stored for chat_read_mark_expire_period
seconds after the message was sent. (int)
Example value:
-{
+{
"test": 1,
"emojies_animated_zoom": 0.625,
- "keep_alive_service": true,
- "background_connection": true,
"emojies_send_dice": [
"\ud83c\udfb2",
"\ud83c\udfaf",
"\ud83c\udfc0",
"\u26bd",
"\u26bd\ufe0f",
- "\ud83c\udfb0"
+ "\ud83c\udfb0",
+ "\ud83c\udfb3"
],
"emojies_send_dice_success": {
"\ud83c\udfaf": {
@@ -115,43 +124,57 @@ While help.getConfig returns MTProto-specif
"\ud83c\udfb0": {
"value": 64,
"frame_start": 110
+ },
+ "\ud83c\udfb3": {
+ "value": 6,
+ "frame_start": 110
}
},
"emojies_sounds": {
"\ud83c\udf83": {
"id": "4956223179606458539",
"access_hash": "-2107001400913062971",
- "file_reference_base64": "AF-4ApC7ukC0UWEPZN0TeSJURe7T"
+ "file_reference_base64": "AGFhvoKbftK5O9K9RpgN1ZtgSzWy"
},
"\u26b0": {
"id": "4956223179606458540",
"access_hash": "-1498869544183595185",
- "file_reference_base64": "AF-4ApCLKMGt96WCvLm58kbqZHd3"
+ "file_reference_base64": "AGFhvoJIm8Uz0qSMIdm3AsKlK7wJ"
},
"\ud83e\udddf\u200d\u2642": {
"id": "4960929110848176331",
"access_hash": "3986395821757915468",
- "file_reference_base64": "AF-4ApAedNln3IMEHH-SUQuH8L9g"
+ "file_reference_base64": "AGFhvoLtXSSIclmvfg6ePz3KsHQF"
},
"\ud83e\udddf": {
"id": "4960929110848176332",
"access_hash": "-8929417974289765626",
- "file_reference_base64": "AF-4ApArGURtGa2KVC-Yovh1kQoW"
+ "file_reference_base64": "AGFhvoImaz5Umt4GvMUD5nocIu0W"
},
"\ud83e\udddf\u200d\u2640": {
"id": "4960929110848176333",
"access_hash": "9161696144162881753",
- "file_reference_base64": "AF-4ApD-eOqXvTBmcszAEkzQN615"
+ "file_reference_base64": "AGFhvoIm1QZsb48xlpRfh4Mq7EMG"
},
"\ud83c\udf51": {
"id": "4963180910661861548",
"access_hash": "-7431729439735063448",
- "file_reference_base64": "AF-4ApBimvRxhcXg-iQ5Gw4Eelit"
+ "file_reference_base64": "AGFhvoKLrwl_WKr5LR0Jjs7o3RyT"
},
- "\u2764": {
- "id": "4978826754966683841",
- "access_hash": "3926211553285686901",
- "file_reference_base64": "AF-4ApDBkyjgN2Tk9zJvXPhfJXPA"
+ "\ud83c\udf8a": {
+ "id": "5094064004578410732",
+ "access_hash": "8518192996098758509",
+ "file_reference_base64": "AGFhvoKMNffRV2J3vKED0O6d8e42"
+ },
+ "\ud83c\udf84": {
+ "id": "5094064004578410733",
+ "access_hash": "-4142643820629256996",
+ "file_reference_base64": "AGFhvoJ1ulPBbXEURlTZWwJFx6xZ"
+ },
+ "\ud83e\uddbe": {
+ "id": "5094064004578410734",
+ "access_hash": "-8934384022571962340",
+ "file_reference_base64": "AGFhvoL4zdMRmYv9z3L8KPaX4JQL"
}
},
"gif_search_branding": "tenor",
@@ -167,13 +190,92 @@ While help.getConfig returns MTProto-specif
"\ud83d\ude0e",
"\ud83d\udc4e"
],
- "qr_login_camera": true,
- "qr_login_code": "secondary",
+ "stickers_emoji_suggest_only_api": false,
+ "stickers_emoji_cache_time": 86400,
+ "qr_login_camera": false,
+ "qr_login_code": "disabled",
"dialog_filters_enabled": true,
- "dialog_filters_tooltip": false
+ "dialog_filters_tooltip": false,
+ "autoarchive_setting_available": false,
+ "pending_suggestions": [
+ "AUTOARCHIVE_POPULAR",
+ "VALIDATE_PASSWORD",
+ "VALIDATE_PHONE_NUMBER",
+ "NEWCOMER_TICKS"
+ ],
+ "autologin_token": "string",
+ "autologin_domains": [
+ "instantview.telegram.org",
+ "translations.telegram.org",
+ "contest.dev",
+ "contest.com",
+ "bugs.telegram.org",
+ "suggestions.telegram.org",
+ "themes.telegram.org"
+ ],
+ "url_auth_domains": [
+ "somedomain.telegram.org"
+ ],
+ "round_video_encoding": {
+ "diameter": 384,
+ "video_bitrate": 1000,
+ "audio_bitrate": 64,
+ "max_size": 12582912
+ },
+ "chat_read_mark_size_threshold": 50,
+ "chat_read_mark_expire_period": 604800
}
-App-specific configuration
-help.appUpdate#1da7158f flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector<MessageEntity> document:flags.1?Document url:flags.2?string = help.AppUpdate;
+Suggestions
+The API can return a set of useful suggestions for users of graphical clients.
+Basic suggestions
+jsonObjectValue#c0de1bd9 key:string value:JSONValue = JSONObjectValue;
+
+jsonNull#3f6d7b68 = JSONValue;
+jsonBool#c7345e6a value:Bool = JSONValue;
+jsonNumber#2be0dfa4 value:double = JSONValue;
+jsonString#b71e767a value:string = JSONValue;
+jsonArray#f7444763 value:Vector<JSONValue> = JSONValue;
+jsonObject#99c1d49d value:Vector<JSONObjectValue> = JSONValue;
+
+---functions---
+
+help.getAppConfig#98914110 = JSONValue;
+The help.getAppConfig method returns a JSON object containing rapidly evolving, client-specific configuration parameters.
+A full list of these parameters can be seen in the Client Configuration section », but we're mostly interested in the pending_suggestions
and autoarchive_setting_available
fields of the returned JSON object:
+
+autoarchive_setting_available
- Whether clients can invoke account.setGlobalPrivacySettings with globalPrivacySettings.archive_and_mute_new_noncontact_peers = boolTrue
, to automatically archive and mute new incoming chats from non-contacts. (boolean)
+pending_suggestions
- Contains a list of suggestions that should be actively shown as a tooltip to the user. Array of strings, possible values shown below:
+"AUTOARCHIVE_POPULAR"
- Users should invoke account.setGlobalPrivacySettings with globalPrivacySettings.archive_and_mute_new_noncontact_peers = boolTrue
, to automatically archive and mute new incoming chats from non-contacts.
+"VALIDATE_PASSWORD"
- Users should make sure they still remember their 2-step verification password.
+"VALIDATE_PHONE_NUMBER"
- Users should check whether their authorization phone number is correct and change the phone number if it is inaccessible.
+"NEWCOMER_TICKS"
- Show the user a hint about the meaning of one and two ticks on sent messages.
+
+
+
+Channel suggestions
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+
+channelFull#e9b27a17 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string = ChatFull;
+
+---functions---
+
+channels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;
+Some channel/supergroup-related suggestions can also be contained in the pending_suggestions
field of the channelFull constructor, returned by channels.getFullChannel.
+Here's a list of possible suggestions:
+
+CONVERT_GIGAGROUP
- The supergroup has many participants: the admin should call channels.convertToGigagroup to convert it to a gigagroup.
+
+Dismissing suggestions
+boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+---functions---
+
+help.dismissSuggestion#f50dbaa1 peer:InputPeer suggestion:string = Bool;
+help.dismissSuggestion can be used to dismiss a suggestion.
+Pass inputPeerEmpty to peer
for basic suggestions and the channel/supergroup's peer for channel suggestions.
+App-specific configuration
+help.appUpdate#ccbbce30 flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector<MessageEntity> document:flags.1?Document url:flags.2?string sticker:flags.3?Document = help.AppUpdate;
help.noAppUpdate#c45a6536 = help.AppUpdate;
updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
@@ -192,7 +294,7 @@ While help.getConfig returns MTProto-specif
help.getAppChangelog - Get a list of service messages with app-specific changelogs
help.getInviteText - Returns a localized invitation message that can be sent via SMS to contacts that haven't signed up to Telegram yet
-Terms of service
+Terms of service
help.termsOfServiceUpdateEmpty#e3309f7f expires:int = help.TermsOfServiceUpdate;
help.termsOfServiceUpdate#28ecf961 expires:int terms_of_service:help.TermsOfService = help.TermsOfServiceUpdate;
@@ -214,8 +316,8 @@ While help.getConfig returns MTProto-specif
After signing up, or when logging in as an existing user, apps are supposed to call help.getTermsOfServiceUpdate to check for any updates to the Terms of Service; this call should be repeated after expires
seconds have elapsed.
If an update to the Terms Of Service is available, clients are supposed to show a consent popup; if accepted, clients should call help.acceptTermsOfService, providing the termsOfService id
JSON object; in case of denial, clients are to delete the account using account.deleteAccount, providing Decline ToS update
as deletion reason
.
Example implementation: android (signup), android (after login)
-Telegram support info
-user#938458c1 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;
+Telegram support info
+user#3ff6ecb0 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;
help.support#17c6b5f6 phone_number:string user:User = help.Support;
help.supportName#8c05f1c9 name:string = help.SupportName;
@@ -229,7 +331,7 @@ If an update to the Terms Of Service is available, clients are supposed to show
help.getSupport - Will return the user object that can be used for contacting support.
help.getSupportName - Will return a localized name for the support chat.
-Country information and login phone patterns
+Country information and login phone patterns
help.countryCode#4203c5ef flags:# country_code:string prefixes:flags.0?Vector<string> patterns:flags.1?Vector<string> = help.CountryCode;
help.country#c3878e23 flags:# hidden:flags.0?true iso2:string default_name:string name:flags.1?string country_codes:Vector<help.CountryCode> = help.Country;
@@ -241,7 +343,7 @@ If an update to the Terms Of Service is available, clients are supposed to show
help.getCountriesList#735787a8 lang_code:string hash:int = help.CountriesList;
help.getCountriesList can be used to fetch a list of localized names for all available countries and phone code patterns for logging in.
The phone code pattern should be used when showing the login screen, or when changing phone number: for example, a pattern value of XXX XXX XXX
with country_code
+39
indicates that the phone field for login should accept a spaced pattern like +39 123 456 789
.
-Also, the beginning of the national part of the phone number (123 456 789
) should with match one of the prefixes
, if any were returned.
+Also, the beginning of the national part of the phone number (123 456 789
) should match one of the prefixes
, if any were returned.
diff --git a/data/core.telegram.org/api/datacenter.html b/data/core.telegram.org/api/datacenter.html
index 11cfe243a0..fedf8a90f9 100644
--- a/data/core.telegram.org/api/datacenter.html
+++ b/data/core.telegram.org/api/datacenter.html
@@ -45,7 +45,8 @@ A complete list of proxy access points for these DCs may be obtained using config#330b4067 flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true ignore_phone_entities:flags.5?true revoke_pm_inbox:flags.6?true blocked_mode:flags.8?true pfs_enabled:flags.13?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> dc_txt_domain_name:string chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int pinned_infolder_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string autoupdate_url_prefix:flags.7?string gif_search_username:flags.9?string venue_search_username:flags.10?string img_search_username:flags.11?string static_maps_provider:flags.12?string caption_length_max:int message_length_max:int webfile_dc_id:int suggested_lang_code:flags.2?string lang_pack_version:flags.2?int base_lang_pack_version:flags.2?int = Config;
---functions---
help.getConfig#c4f9186b = Config;
-In this context, this_dc is the number of the current DC, dc_options is a list of all DCs available at the moment, each of which has an id, ip, and port for establishing a connection. Please note that ip and port may change frequently, based on proxy server load and the user's current location.
+In this context, this_dc is the number of the current DC, dc_options is a list of all DCs available at the moment, each of which has an id, ip, and port for establishing a connection. Please note that ip and port may change frequently, based on proxy server load and the user's current location.
+Typically, each DC has at least one IPv4 and one IPv6 endpoint available.
To optimize client communication with the API, each client must use the connection to the closest access point for its main queries (sending messages, getting contacts, etc.). Therefore, knowing how to select a DC is required before communicating with the API.
Registration/Authorization
The auth.sendCode method is the basic entry point when registering a new user or authorizing an existing user. 95% of all redirection cases to a different DC will occure when invoking this method.
@@ -61,8 +62,8 @@ If we do not yet have a user with this number, we examine its IP-address. We can
encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;
-userProfilePhoto#69d3ab26 flags:# has_video:flags.0?true photo_id:long photo_small:FileLocation photo_big:FileLocation dc_id:int = UserProfilePhoto;
-chatPhoto#d20b9f3c flags:# has_video:flags.0?true photo_small:FileLocation photo_big:FileLocation dc_id:int = ChatPhoto;
+userProfilePhoto#82d1f706 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto;
+chatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto;
To download the file, an encrypted connection to DC dc_id must be established and used to execute the upload.getFile query. If an attempt is made to download the file over a wrong connection, the FILE_MIGRATE_X error will be returned.
Please note that encryption keys are not copied between DCs; therefore, the process of establishing an encrypted connection is started from the very beginning for each new DC. An issued auth_key can be associated with the current authorized user by using an authorization transfer.
@@ -70,10 +71,10 @@ If an attempt is made to download the file over a wrong connection, the FILE_MIGDuring the process of working with the API, user information is accumulated in the DC with which the user is associated. This is the reason a user cannot be associated with a different DC by means of the client. However, in the future, during prolonged communication from an unusual location, we may decide that the user’s data must be moved to a different DC. After some time, the data will be copied and the association will be updated. Once this happens, when executing any query transmitted to the old DC, the API will return the USER_MIGRATE_X error. The client will then have to establish a connection with the new DC and repeat the query.
The following methods can be used to eliminate the need for users to enter the code from a text message every time:
-auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
+auth.exportedAuthorization#b434e2b8 id:long bytes:bytes = auth.ExportedAuthorization;
auth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization;
---functions---
-auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;
+auth.importAuthorization#a57a7dad id:long bytes:bytes = auth.Authorization;
auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
auth.exportAuthorization must be executed in the current DC (the DC with which a connection has already been established), passing in dc_id as the value for the new DC. The method should return the user identifier and a long string of random data. An import operation can be performed at the new DC by sending it what was received. Queries requiring authorization can then be successfully executed in the new DC.
diff --git a/data/core.telegram.org/api/discussion.html b/data/core.telegram.org/api/discussion.html
index f03d904938..aca23b08c6 100644
--- a/data/core.telegram.org/api/discussion.html
+++ b/data/core.telegram.org/api/discussion.html
@@ -45,7 +45,7 @@
boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;
-channelFull#f0e6672a flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?int location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int = ChatFull;
+channelFull#e9b27a17 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string = ChatFull;
messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
diff --git a/data/core.telegram.org/api/end-to-end.html b/data/core.telegram.org/api/end-to-end.html
index 7d9388a89e..acbd1bb700 100644
--- a/data/core.telegram.org/api/end-to-end.html
+++ b/data/core.telegram.org/api/end-to-end.html
@@ -42,11 +42,15 @@
-This article on MTProto's End-to-End encryption is meant for advanced users.
If you want to learn more about Secret Chats from a less intimidating source, kindly see our general FAQ.
-Note that as of version 4.6, major Telegram clients are using MTProto 2.0.
MTProto v.1.0 is deprecated and is currently being phased out.
+This article on MTProto's End-to-End encryption is meant for advanced users.
+If you want to learn more about Secret Chats from a less intimidating source, kindly see our general FAQ.
+
+
+Note that as of version 4.6, major Telegram clients are using MTProto 2.0.
+MTProto v.1.0 is deprecated and is currently being phased out.
-Related articles
+Related articles
- Security guidelines for developers
@@ -58,11 +62,11 @@
Secret Chats are one-on-one chats wherein messages are encrypted with a key held only by the chat’s participants. Note that the schema for these end-to-end encrypted Secret Chats is different from what is used for cloud chats:
-
-A note on MTProto 2.0
-This article describes the end-to-end encryption layer in the MTProto protocol version 2.0.
The principal differences from version 1.0 (described here for reference) are as follows:
+A note on MTProto 2.0
+This article describes the end-to-end encryption layer in the MTProto protocol version 2.0.
+The principal differences from version 1.0 (described here for reference) are as follows:
- SHA-256 is used instead of SHA-1;
- Padding bytes are involved in the computation of msg_key;
@@ -70,34 +74,35 @@
- 12..1024 padding bytes are used instead of 0..15 padding bytes in v.1.0.
See also: MTProto 2.0: Cloud Chats, server-client encryption
-Key Generation
+Key Generation
Keys are generated using the Diffie-Hellman protocol.
Let us consider the following scenario: User A would like to initiate end-to-end encrypted communication with User B.
-Sending a Request
+Sending a Request
User A executes messages.getDhConfig to obtain the Diffie-Hellman parameters: a prime p, and a high order element g.
Executing this method before each new key generation procedure is of vital importance. It makes sense to cache the values of the parameters together with the version in order to avoid having to receive all of the values every time. If the version stored on the client is still up-to-date, the server will return the constructor messages.dhConfigNotModified.
-Client is expected to check whether p is a safe 2048-bit prime (meaning that both p and (p-1)/2 are prime, and that 22047 < p < 22048), and that g generates a cyclic subgroup of prime order (p-1)/2, i.e. is a quadratic residue mod p. Since g is always equal to 2, 3, 4, 5, 6 or 7, this is easily done using quadratic reciprocity law, yielding a simple condition on p mod 4g — namely, p mod 8 = 7 for g = 2; p mod 3 = 2 for g = 3; no extra condition for g = 4; p mod 5 = 1 or 4 for g = 5; p mod 24 = 19 or 23 for g = 6; and p mod 7 = 3, 5 or 6 for g = 7. After g and p have been checked by the client, it makes sense to cache the result, so as to avoid repeating lengthy computations in future. This cache might be shared with one used for Authorization Key generation.
-If the client needs additional entropy for the random number generator, it can pass the random_length parameter (random_length> 0) so the server generates its own random sequence random of the appropriate length.
Important: using the server’s random sequence in its raw form may be unsafe, it must be combined with a client sequence.
+Client is expected to check whether p is a safe 2048-bit prime (meaning that both p and (p-1)/2 are prime, and that 2^2047 < p < 2^2048), and that g generates a cyclic subgroup of prime order (p-1)/2, i.e. is a quadratic residue mod p. Since g is always equal to 2, 3, 4, 5, 6 or 7, this is easily done using quadratic reciprocity law, yielding a simple condition on p mod 4g -- namely, p mod 8 = 7 for g = 2; p mod 3 = 2 for g = 3; no extra condition for g = 4; p mod 5 = 1 or 4 for g = 5; p mod 24 = 19 or 23 for g = 6; and p mod 7 = 3, 5 or 6 for g = 7. After g and p have been checked by the client, it makes sense to cache the result, so as to avoid repeating lengthy computations in future. This cache might be shared with one used for Authorization Key generation.
+If the client needs additional entropy for the random number generator, it can pass the random_length parameter (random_length> 0) so the server generates its own random sequence random of the appropriate length.
+Important: using the server’s random sequence in its raw form may be unsafe, it must be combined with a client sequence.
Client A computes a 2048-bit number a (using sufficient entropy or the server’s random; see above) and executes messages.requestEncryption after passing in g_a := pow(g, a) mod dh_prime
.
User B receives the update updateEncryption for all associated authorization keys (all authorized devices) with the chat constructor encryptedChatRequested. The user must be shown basic information about User A and must be prompted to accept or reject the request.
Both clients are to check that g, g_a and g_b are greater than one and smaller than p-1. We recommend checking that g_a and g_b are between 2^{2048-64} and p - 2^{2048-64} as well.
-Accepting a Request
+Accepting a Request
After User B confirms the creation of a secret chat with A in the client interface, Client B also receives up-to-date configuration parameters for the Diffie-Hellman method. Thereafter, it generates a random 2048-bit number, b, using rules similar to those for a.
Having received g_a from the update with encryptedChatRequested, it can immediately generate the final shared key: key = (pow(g_a, b) mod dh_prime)
. If key length < 256 bytes, add several leading zero bytes as padding — so that the key is exactly 256 bytes long. Its fingerprint, key_fingerprint, is equal to the 64 last bits of SHA1 (key).
Note 1: in this particular case SHA1 is used here even for MTProto 2.0 secret chats.
-Note 2: this fingerprint is used as a sanity check for the key exchange procedure to detect bugs when developing client software — it is not connected to the key visualization used on the clients as means of external authentication in secret chats. Key visualizations on the clients are generated using the first 128 bits of SHA1(intial key) followed by the first 160 bits of SHA256(key used when secret chat was updated to layer 46).
+Note 2: this fingerprint is used as a sanity check for the key exchange procedure to detect bugs when developing client software — it is not connected to the key visualization used on the clients as means of external authentication in secret chats. Key visualizations on the clients are generated using the first 128 bits of SHA1(initial key) followed by the first 160 bits of SHA256(key used when secret chat was updated to layer 46).
Client B executes messages.acceptEncryption after passing it g_b := pow(g, b) mod dh_prime
and key_fingerprint.
For all of Client B’s authorized devices, except the current one, updateEncryption updates are sent with the constructor encryptedChatDiscarded. Thereafter, the only device that will be able to access the secret chat is Device B, which made the call to messages.acceptEncryption.
User A will be sent an updateEncryption update with the constructor encryptedChat, for the authorization key that initiated the chat.
With g_b from the update, Client A can also compute the shared key key = (pow(g_b, a) mod dh_prime)
. If key length < 256 bytes, add several leading zero bytes as padding — so that the key is exactly 256 bytes long. If the fingerprint for the received key is identical to the one that was passed to encryptedChat, incoming messages can be sent and processed. Otherwise, messages.discardEncryption must be executed and the user notified.
-Perfect Forward Secrecy
+Perfect Forward Secrecy
In order to keep past communications safe, official Telegram clients will initiate re-keying once a key has been used to decrypt and encrypt more than 100 messages, or has been in use for more than one week, provided the key has been used to encrypt at least one message. Old keys are then securely discarded and cannot be reconstructed, even with access to the new keys currently in use.
The re-keying protocol is further described in this article: Perfect Forward Secrecy in Secret Chats.
Please note that your client must support Forward Secrecy in Secret Chats to be compatible with official Telegram clients.
-Sending and Receiving Messages in a Secret Chat
-Serialization and Encryption of Outgoing Messages
+Sending and Receiving Messages in a Secret Chat
+Serialization and Encryption of Outgoing Messages
A TL object of type DecryptedMessage is created and contains the message in plain text. For backward compatibility, the object must be wrapped in the constructor decryptedMessageLayer with an indication of the supported layer (starting with 46).
The TL-Schema for the contents of end-to-end encrypted messages is available here »
@@ -118,18 +123,20 @@
For the obsolete MTProto 1.0, msg_key, aes_key, and aes_iv were computed differently (see this document for reference).
Data is encrypted with a 256-bit key, aes_key, and a 256-bit initialization vector, aes-iv, using AES-256 encryption with infinite garble extension (IGE). Encryption key fingerprint key_fingerprint and the message key msg_key are added at the top of the resulting byte array.
Encrypted data is embedded into a messages.sendEncrypted API call and passed to Telegram server for delivery to the other party of the Secret Chat.
-Upgrading to MTProto 2.0 from MTProto 1.0
+Upgrading to MTProto 2.0 from MTProto 1.0
As soon as both parties in a secret chat are using at least Layer 73, they should only use MTProto 2.0 for all outgoing messages. Some of the first received messages may use MTProto 1.0, if a sufficiently high starting layer has not been negotiated during the creation of the secret chat. After the first message encrypted with MTProto 2.0 (or the first message with Layer 73 or higher) is received, all messages with higher sequence numbers must be encrypted with MTProto 2.0 as well.
As long as the current layer is lower than 73, each party should try to decrypt received messages with MTProto 1.0, and if this is not successfull (msg_key does not match), try MTProto 2.0. Once the first MTProto 2.0-encrypted message arrives (or the layer is upgraded to 73), there is no need to try MTProto 1.0 decryption for any of the further messages (unless the client is still waiting for some gaps to be closed).
-Decrypting an Incoming Message
-The steps above are performed in reverse order.
When an encrypted message is received, you must check that msg_key is in fact equal to the 128 middle bits of the SHA256 hash of the decrypted message, prepended by 32 bytes taken from the shared key.
If the message layer is greater than the one supported by the client, the user must be notified that the client version is out of date and prompted to update.
-Sequence numbers
+Decrypting an Incoming Message
+The steps above are performed in reverse order.
+When an encrypted message is received, you must check that msg_key is in fact equal to the 128 middle bits of the SHA256 hash of the decrypted message, prepended by 32 bytes taken from the shared key.
+If the message layer is greater than the one supported by the client, the user must be notified that the client version is out of date and prompted to update.
+Sequence numbers
It is necessary to interpret all messages in their original order to protect against possible manipulations. Secret chats support a special mechanism for handling seq_no counters independently from the server.
Proper handling of these counters is further described in this article: Sequence numbers in Secret Chats.
Please note that your client must support sequence numbers in Secret Chats to be compatible with official Telegram clients.
-Sending Encrypted Files
+Sending Encrypted Files
All files sent to secret chats are encrypted with one-time keys that are in no way related to the chat’s shared key. Before an encrypted file is sent, it is assumed that the encrypted file’s address will be attached to the outside of an encrypted message using the file parameter of the messages.sendEncryptedFile method and that the key for direct decryption will be sent in the body of the message (the key parameter in the constructors decryptedMessageMediaPhoto, decryptedMessageMediaVideo and decryptedMessageMediaFile.
Prior to a file being sent to a secret chat, 2 random 256-bit numbers are computed which will serve as the AES key and initialization vector used to encrypt the file. AES-256 encryption with infinite garble extension (IGE) is used in like manner.
The key fingerprint is computed as follows:
@@ -137,28 +144,28 @@
- digest = md5(key + iv)
- fingerprint = substr(digest, 0, 4) XOR substr(digest, 4, 4)
-The encrypted contents of a file are stored on the server in much the same way as those of a file in cloud chats: piece by piece using calls to upload.saveFilePart.
A subsequent call to messages.sendEncryptedFile will assign an identifier to the stored file and send the address together with the message. The recipient will receive an update with encryptedMessage, and the file parameter will contain file information.
+The encrypted contents of a file are stored on the server in much the same way as those of a file in cloud chats: piece by piece using calls to upload.saveFilePart.
+A subsequent call to messages.sendEncryptedFile will assign an identifier to the stored file and send the address together with the message. The recipient will receive an update with encryptedMessage, and the file parameter will contain file information.
Incoming and outgoing encrypted files can be forwarded to other secret chats using the constructor inputEncryptedFile to avoid saving the same content on the server twice.
-Working with an Update Box
+Working with an Update Box
Secret chats are associated with specific devices (or rather with authorization keys), not users. A conventional message box, which uses pts to describe the client’s status, is not suitable, because it is designed for long-term message storage and message access from different devices.
An additional temporary message queue is introduced as a solution to this problem. When an update regarding a message from a secret chat is sent, a new value of qts is sent, which helps reconstruct the difference if there has been a long break in the connection or in case of loss of an update.
As the number of events increases, the value of qts increases by 1 with each new event. The initial value may not (and will not) be equal to 0.
The fact that events from the temporary queue have been received and stored by the client is acknowledged explicitly by a call to the messages.receivedQueue method or implicitly by a call to updates.getDifference (the value of qts passed, not the final state). All messages acknowledged as delivered by the client, as well as any messages older than 7 days, may (and will) be deleted from the server.
Upon de-authorization, the event queue of the corresponding device will be forcibly cleared, and the value of qts will become irrelevant.
-Updating to new layers
+Updating to new layers
Your client should always store the maximal layer that is known to be supported by the client on the other side of a secret chat. When the secret chat is first created, this value should be initialized to 46. This remote layer value must always be updated immediately after receiving any packet containing information of an upper layer, i.e.:
- any secret chat message containing layer_no in its
decryptedMessageLayer
with layer>=46, or
- a decryptedMessageActionNotifyLayer service message, wrapped as if it were the decryptedMessageService constructor of the obsolete layer 8 (constructor
decryptedMessageService#aa48327d
).
-Notifying the remote client about your local layer
+Notifying the remote client about your local layer
In order to notify the remote client of your local layer, your client must send a message of the decryptedMessageActionNotifyLayer
type. This notification must be wrapped in a constructor of an appropriate layer.
There are two cases when your client must notify the remote client about its local layer:
- As soon as a new secret chat has been created, immediately after the secret key has been successfully exchanged.
- Immediately after the local client has been updated to support a new secret chat layer. In this case notifications must be sent to all currently existing secret chats. Note that this is only necessary when updating to new layers that contain changes in the secret chats implementation (e.g. you don’t need to do this when your client is updated from Layer 46 to Layer 47).
-
-
+
diff --git a/data/core.telegram.org/api/end-to-end_v1.html b/data/core.telegram.org/api/end-to-end_v1.html
index 28fd6bd30d..40f3cc5538 100644
--- a/data/core.telegram.org/api/end-to-end_v1.html
+++ b/data/core.telegram.org/api/end-to-end_v1.html
@@ -76,7 +76,7 @@ For information on end-to-end encryption used in up-to-date Telegram clients, ki
Accepting a Request
After User B confirms the creation of a secret chat with A in the client interface, Client B also receives up-to-date configuration parameters for the Diffie-Hellman method. Thereafter, it generates a random 2048-bit number, b, using rules similar to those for a.
Having received g_a from the update with encryptedChatRequested, it can immediately generate the final shared key: key = (pow(g_a, b) mod dh_prime)
. If key length < 256 bytes, add several leading zero bytes as padding — so that the key is exactly 256 bytes long. Its fingerprint, key_fingerprint, is equal to the 64 last bits of SHA1 (key).
-Note: this fingerprint is used as a sanity check for the key exchange procedure to detect bugs while developing client software — it is not connected to the key visualization used on the clients as means of external authentication in secret chats. Key visualizations on the clients are generated using the first 128 bits of SHA1(intial key) followed by the first 160 bits of SHA256(key used when secret chat was updated to layer 46).
+Note: this fingerprint is used as a sanity check for the key exchange procedure to detect bugs while developing client software — it is not connected to the key visualization used on the clients as means of external authentication in secret chats. Key visualizations on the clients are generated using the first 128 bits of SHA1(initial key) followed by the first 160 bits of SHA256(key used when secret chat was updated to layer 46).
Client B executes messages.acceptEncryption after passing it g_b := pow(g, b) mod dh_prime
and key_fingerprint.
For all of Client B’s authorized devices, except the current one, updateEncryption updates are sent with the constructor encryptedChatDiscarded. Thereafter, the only device that will be able to access the secret chat is Device B, which made the call to messages.acceptEncryption.
User A will be sent an updateEncryption update with the constructor encryptedChat, for the authorization key that initiated the chat.
@@ -128,7 +128,7 @@ If the message layer is greater than the one supported by the client, the user m
A subsequent call to messages.sendEncryptedFile will assign an identifier to the stored file and send the address together with the message. The recipient will receive an update with encryptedMessage, and the file parameter will contain file information.
Incoming and outgoing encrypted files can be forwarded to other secret chats using the constructor inputEncryptedFile to avoid saving the same content on the server twice.
Working with an Update Box
-Secret chats are associated with specific devices (or rather with authorization keys), not users. A conventional message box, which uses pts to describe the client’s status, is not suitable, because it is designed for long-term message storage and message access from different devices.
+Secret chats are associated with specific devices (or rather with authorization keys), not users. A conventional message box, which uses pts to describe the client’s status, is not suitable, because it is designed for long-term message storage and message access from different devices.
An additional temporary message queue is introduced as a solution to this problem. When an update regarding a message from a secret chat is sent, a new value of qts is sent, which helps reconstruct the difference if there has been a long break in the connection or in case of loss of an update.
As the number of events increases, the value of qts increases monotonically (not always by 1). The initial value may not (and will not) be equal to 0.
The fact that events from the temporary queue have been received and stored by the client is acknowledged explicitly by a call to the messages.receivedQueue method or implicitly by a call to updates.getDifference (the value of qts passed, not the final state). All messages acknowledged as delivered by the client, as well as any messages older than 7 days, may (and will) be deleted from the server.
diff --git a/data/core.telegram.org/api/errors.html b/data/core.telegram.org/api/errors.html
index 11e7b48406..c1f5812165 100644
--- a/data/core.telegram.org/api/errors.html
+++ b/data/core.telegram.org/api/errors.html
@@ -41,27 +41,28 @@
There will be errors when working with the API, and they must be correctly handled on the client.
An error is characterized by several parameters:
-Error Code
+Error Code
Numerical value similar to HTTP status. Contains information on the type of error that occurred: for example, a data input error, privacy error, or server error. This is a required parameter.
-Error Type
+Error Type
A string literal in the form of /[A-Z_0-9]+/
, which summarizes the problem. For example, AUTH_KEY_UNREGISTERED
. This is an optional parameter.
-Error Constructors
+Error Constructors
There should be a way to handle errors that are returned in rpc_error constructors.
Below is a list of error codes and their meanings:
-303 SEE_OTHER
+303 SEE_OTHER
The request must be repeated, but directed to a different data center.
-Examples of Errors:
+Examples of Errors:
- FILE_MIGRATE_X: the file to be accessed is currently stored in a different data center.
- PHONE_MIGRATE_X: the phone number a user is trying to use for authorization is associated with a different data center.
- NETWORK_MIGRATE_X: the source IP address is associated with a different data center (for registration)
- USER_MIGRATE_X: the user whose identity is being used to execute queries is associated with a different data center (for registration)
-In all these cases, the error description’s string literal contains the number of the data center (instead of the X) to which the repeated query must be sent.
More information about redirects between data centers »
-400 BAD_REQUEST
+In all these cases, the error description’s string literal contains the number of the data center (instead of the X) to which the repeated query must be sent.
+More information about redirects between data centers »
+400 BAD_REQUEST
The query contains errors. In the event that a request was created using a form and contains user generated data, the user should be notified that the data must be corrected before the query is repeated.
-Examples of Errors:
+Examples of Errors:
- FIRSTNAME_INVALID: The first name is invalid
- LASTNAME_INVALID: The last name is invalid
@@ -83,11 +84,11 @@
- FIELD_NAME_INVALID: The field with the name FIELD_NAME is invalid
- FIELD_NAME_EMPTY: The field with the name FIELD_NAME is missing
- MSG_WAIT_FAILED: A request that must be completed before processing the current request returned an error
-- MSG_WAIT_TIMEOUT: A request that must be completed before processing the current request didn't finish processing yet
+- MSG_WAIT_TIMEOUT: A request that must be completed before processing the current request didn't finish processing yet
-401 UNAUTHORIZED
+401 UNAUTHORIZED
There was an unauthorized attempt to use functionality available only to authorized users.
-Examples of Errors:
+Examples of Errors:
- AUTH_KEY_UNREGISTERED: The key is not registered in the system
- AUTH_KEY_INVALID: The key is invalid
@@ -96,24 +97,23 @@
- SESSION_EXPIRED: The authorization has expired
- AUTH_KEY_PERM_EMPTY: The method is unavailble for temporary authorization key, not bound to permanent
-403 FORBIDDEN
+403 FORBIDDEN
Privacy violation. For example, an attempt to write a message to someone who has blacklisted the current user.
-404 NOT_FOUND
+404 NOT_FOUND
An attempt to invoke a non-existent object, such as a method.
-406 NOT_ACCEPTABLE
+406 NOT_ACCEPTABLE
Similar to 400 BAD_REQUEST, but the app should not display any error messages to user in UI as a result of this response. The error message will be delivered via updateServiceNotification instead.
-420 FLOOD
+420 FLOOD
The maximum allowed number of attempts to invoke the given method with the given input parameters has been exceeded. For example, in an attempt to request a large number of text messages (SMS) for the same phone number.
-Error Example:
+Error Example:
- FLOOD_WAIT_X: A wait of X seconds is required (where X is a number)
-500 INTERNAL
+500 INTERNAL
An internal server error occurred while a request was being processed; for example, there was a disruption while accessing a database or file storage.
If a client receives a 500 error, or you believe this error should not have occurred, please collect as much information as possible about the query and error and send it to the developers.
-Other Error Codes
-If a server returns an error with a code other than the ones listed above, it may be considered the same as a 500 error and treated as an internal server error.
-
+Other Error Codes
+If a server returns an error with a code other than the ones listed above, it may be considered the same as a 500 error and treated as an internal server error.
diff --git a/data/core.telegram.org/api/files.html b/data/core.telegram.org/api/files.html
index 5d3ebb8eff..498d0845cb 100644
--- a/data/core.telegram.org/api/files.html
+++ b/data/core.telegram.org/api/files.html
@@ -140,7 +140,7 @@ The SHA256 hash of the file is computed, and it is passed along with the file's
photos.updateProfilePhoto#72d4742c id:InputPhoto = photos.Photo;
photos.uploadProfilePhoto#89f30f69 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = photos.Photo;
-messages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates;
+messages.editChatPhoto#35ddd674 chat_id:long photo:InputChatPhoto = Updates;
channels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;
User profile pictures can be uploaded using the photos.uploadProfilePhoto method: the actual profile picture has to be uploaded as for normal files.
@@ -177,23 +177,30 @@ The data for the input parameter of the InputF
inputTakeoutFileLocation#29be5899 = InputFileLocation;
inputPhotoFileLocation#40181ffe id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;
inputPhotoLegacyFileLocation#d83466f3 id:long access_hash:long file_reference:bytes volume_id:long local_id:int secret:long = InputFileLocation;
-inputPeerPhotoFileLocation#27d69997 flags:# big:flags.0?true peer:InputPeer volume_id:long local_id:int = InputFileLocation;
-inputStickerSetThumb#dbaeae9 stickerset:InputStickerSet volume_id:long local_id:int = InputFileLocation;
+inputPeerPhotoFileLocation#37257e99 flags:# big:flags.0?true peer:InputPeer photo_id:long = InputFileLocation;
+inputStickerSetThumb#9d84f3db stickerset:InputStickerSet thumb_version:int = InputFileLocation;
+inputGroupCallStream#598a92a flags:# call:InputGroupCall time_ms:long scale:int video_channel:flags.0?int video_quality:flags.0?int = InputFileLocation;
inputStickerSetEmpty#ffb62b95 = InputStickerSet;
inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;
inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
+inputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;
+inputStickerSetDice#e67f520e emoticon:string = InputStickerSet;
+inputStickerSetAnimatedEmojiAnimations#cde3739 = InputStickerSet;
inputPeerSelf#7da07ec9 = InputPeer;
-inputPeerChat#179be863 chat_id:int = InputPeer;
-inputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer;
-inputPeerChannel#20adaef8 channel_id:int access_hash:long = InputPeer;
+inputPeerChat#35a95cb9 chat_id:long = InputPeer;
+inputPeerUser#dde8a54c user_id:long access_hash:long = InputPeer;
+inputPeerChannel#27bcbbfc channel_id:long access_hash:long = InputPeer;
photo#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector<PhotoSize> video_sizes:flags.1?Vector<VideoSize> dc_id:int = Photo;
document#1e87342b flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:int thumbs:flags.0?Vector<PhotoSize> video_thumbs:flags.1?Vector<VideoSize> dc_id:int attributes:Vector<DocumentAttribute> = Document;
-photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
-photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+photoSize#75c78e60 type:string w:int h:int size:int = PhotoSize;
+photoCachedSize#21e1ad6 type:string w:int h:int bytes:bytes = PhotoSize;
+
+chatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto;
+userProfilePhoto#82d1f706 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto;
For photos, inputPhotoFileLocation is used:
@@ -203,10 +210,11 @@ The data for the input parameter of the InputFFor profile pictures of users, channels, supergroups and groups, since in most occasions they are encountered as simple fileLocationToBeDeprecated constructors without an associated photo, inputPeerPhotoFileLocation has to be used:
+For profile pictures of users, channels, supergroups and groups, inputPeerPhotoFileLocation has to be used:
peer
is the identifier of the peer whose photo we want to downloadvolume_id
and local_id
are extracted from the fileLocationToBeDeprecated of the desired quality (the logic for selecting the quality of profile pictures will be changed soon)big
is used to choose whether to download the full-resolution picture, or just the thumbnailphoto_id
is extracted from the chatPhoto or userProfilePhoto of the desired profile photoFor encrypted secret chat and telegram passport documents, respectively inputEncryptedFileLocation and inputSecureFileLocation have to be used, with parameters extracted from encryptedFile and secureFile (passport docs).
-For previews of sticker sets, inputStickerSetThumb is used (note: to download stickers and previews of stickers use the document method described above):
+For previews of sticker sets, inputStickerSetThumb is used (note: to download stickers and previews of stickers use the document method described above for documents):
stickerset
is set to the InputStickerSet constructor generated from the StickerSetvolume_id
and local_id
are extracted from the fileLocationToBeDeprecated from the thumb
PhotoSize of the StickerSet (the logic for downloading stickerset previews will be changed soon)stickerset
is set to the InputStickerSet constructor generated from stickerSetthumb_version
is copied from the same field in stickerSetFor old deprecated photos, if the client has cached some old fileLocations with the deprecated secret
identifier, inputFileLocation is used (this is mainly used for backwards compatiblity with bot API file IDs, all user clients must use the modern inputPhotoFileLocation file IDs):
For encrypted secret chat and telegram passport documents, respectively inputEncryptedFileLocation and inputSecureFileLocation have to be used, with parameters extracted from encryptedFile and secureFile (passport docs).
+For livestream chunks, inputGroupCallStream is used:
id
, file_reference
and access_hash
taken from the photo constructorcall
contains the related group call ID+access hash, taken from the groupCall constructor.time_ms
specifies the timestamp to fetchscale
specifies the duration of the video segment to fetch in milliseconds, by bitshifting 1000
to the right scale
times: duration_ms := 1000 >> scale
video_channel
specifies the video channel to fetchvideo_quality
specifies the selected video quality (0 = lowest, 1 = medium, 2 = best)For old deprecated photos, if the client has cached some old fileLocations with the deprecated secret
identifier, inputFileLocation or inputPhotoLegacyFileLocation is used (this is mainly used for backwards compatiblity with bot API file IDs, all user clients must use the modern inputPhotoFileLocation file IDs):
file_reference
, access_hash
and id
, which are taken from the photo constructor (the last two fields are used only if available, in which case inputPhotoLegacyFileLocation is used instead of inputFileLocation).offset
and takes limit
bytes.
Before saving each portion of the data received from the DC into the file, the client can confirm that its hash matches the hash that was received from the master DC. If missing a hash for any file part, client developers must use the upload.getFileHashes method to obtain the missing hash.
Scheme:
+Schema:
photoSizeEmpty#e17e23c type:string = PhotoSize;
-photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
-photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+photoSize#75c78e60 type:string w:int h:int size:int = PhotoSize;
+photoCachedSize#21e1ad6 type:string w:int h:int bytes:bytes = PhotoSize;
photoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;
-photoSizeProgressive#5aa86a51 type:string location:FileLocation w:int h:int sizes:Vector<int> = PhotoSize;
+photoSizeProgressive#fa3efb95 type:string w:int h:int sizes:Vector<int> = PhotoSize;
photoPathSize#d8214d41 type:string bytes:bytes = PhotoSize;
-videoSize#e831c556 flags:# type:string location:FileLocation w:int h:int size:int video_start_ts:flags.0?double = VideoSize;
+videoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize;
document#1e87342b flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:int thumbs:flags.0?Vector<PhotoSize> video_thumbs:flags.1?Vector<VideoSize> dc_id:int attributes:Vector<DocumentAttribute> = Document;
photo#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector<PhotoSize> video_sizes:flags.1?Vector<VideoSize> dc_id:int = Photo;
@@ -402,8 +420,8 @@ path += "z"
<path d="{$path}"/>
</svg>
videoSize#e831c556 flags:# type:string location:FileLocation w:int h:int size:int video_start_ts:flags.0?double = VideoSize;
-A videoSize constructor is typically used for [animated profile pictures]() and video previews.
+videoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize;
+A videoSize constructor is typically used for animated profile pictures and video previews.
Here's a list of possible SecureValueTypes, and the parameters that can be set/requested when using each type.
+Here's a list of possible SecureValueTypes, and the parameters that can be set/requested when using each type.
secureData#8aeabec3 data:bytes data_hash:bytes secret:bytes = SecureData;
+secureData#8aeabec3 data:bytes data_hash:bytes secret:bytes = SecureData;
Data is an encrypted and padded JSON-serialized object of one of the specified JSON types, depending on the chosen type.
DataCredentials extracted from the credentials can then be used to decrypt encrypted data from the data field in secureData.
For more info on how to decrypt the data field, see the passport manual.
secureFile#e0277a62 id:long access_hash:long size:int dc_id:int date:int file_hash:bytes secret:bytes = SecureFile;
+DataCredentials extracted from the credentials can then be used to decrypt encrypted data from the data field in secureData.
+For more info on how to decrypt the data field, see the passport manual.
+SecureFile
+secureFile#e0277a62 id:long access_hash:long size:int dc_id:int date:int file_hash:bytes secret:bytes = SecureFile;
-inputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;
+inputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;
---functions---
-upload.getFile#b15a9afc flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:int limit:int = upload.File;
-Files (JPG format when decrypted, max. 10MB) are downloaded chunk by chunk as described in files », except that instead of generating an inputFileLocation, an inputFileLocation should be generated, instead.
+upload.getFile#b15a9afc flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:int limit:int = upload.File;
+Files (JPG format when decrypted, max. 10MB) are downloaded chunk by chunk as described in files », except that instead of generating an inputFileLocation, an inputFileLocation should be generated, instead.
id
field is the id
of the secureFileaccess_hash
field is the access_hash
of the secureFileFileCredentials extracted from the credentials can then be used to decrypt downloaded encrypted data.
For more info on how to decrypt passport files, see the passport manual.
securePlainPhone#7d6099dd phone:string = SecurePlainData;
-securePlainEmail#21ec5a5f email:string = SecurePlainData;
-The email/phone is passed in plaintext using the respective SecurePlainData constructor.
Emails and phone numbers sent using telegram passport are already verified as described in the passport manual.
secureValueErrorData#e8a40bd9 type:SecureValueType data_hash:bytes field:string text:string = SecureValueError;
-secureValueErrorFrontSide#be3dfa type:SecureValueType file_hash:bytes text:string = SecureValueError;
-secureValueErrorReverseSide#868a2aa5 type:SecureValueType file_hash:bytes text:string = SecureValueError;
-secureValueErrorSelfie#e537ced6 type:SecureValueType file_hash:bytes text:string = SecureValueError;
-secureValueErrorFile#7a700873 type:SecureValueType file_hash:bytes text:string = SecureValueError;
-secureValueErrorFiles#666220e9 type:SecureValueType file_hash:Vector<bytes> text:string = SecureValueError;
-secureValueError#869d758f type:SecureValueType hash:bytes text:string = SecureValueError;
-secureValueErrorTranslationFile#a1144770 type:SecureValueType file_hash:bytes text:string = SecureValueError;
-secureValueErrorTranslationFiles#34636dd8 type:SecureValueType file_hash:Vector<bytes> text:string = SecureValueError;
+FileCredentials extracted from the credentials can then be used to decrypt downloaded encrypted data.
+For more info on how to decrypt passport files, see the passport manual.
+SecurePlainData
+securePlainPhone#7d6099dd phone:string = SecurePlainData;
+securePlainEmail#21ec5a5f email:string = SecurePlainData;
+The email/phone is passed in plaintext using the respective SecurePlainData constructor.
+Emails and phone numbers sent using telegram passport are already verified as described in the passport manual.
+Fixing errors
+secureValueErrorData#e8a40bd9 type:SecureValueType data_hash:bytes field:string text:string = SecureValueError;
+secureValueErrorFrontSide#be3dfa type:SecureValueType file_hash:bytes text:string = SecureValueError;
+secureValueErrorReverseSide#868a2aa5 type:SecureValueType file_hash:bytes text:string = SecureValueError;
+secureValueErrorSelfie#e537ced6 type:SecureValueType file_hash:bytes text:string = SecureValueError;
+secureValueErrorFile#7a700873 type:SecureValueType file_hash:bytes text:string = SecureValueError;
+secureValueErrorFiles#666220e9 type:SecureValueType file_hash:Vector<bytes> text:string = SecureValueError;
+secureValueError#869d758f type:SecureValueType hash:bytes text:string = SecureValueError;
+secureValueErrorTranslationFile#a1144770 type:SecureValueType file_hash:bytes text:string = SecureValueError;
+secureValueErrorTranslationFiles#34636dd8 type:SecureValueType file_hash:Vector<bytes> text:string = SecureValueError;
-inputUser#d8292816 user_id:int access_hash:long = InputUser;
+inputUser#f21158c6 user_id:long access_hash:long = InputUser;
---functions---
-users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector<SecureValueError> = Bool;
+users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector<SecureValueError> = Bool;
If the data you received contains errors, the bot can use the users.setSecureValueErrors method to inform the user and request information again. The user will not be able to resend the data, until all errors are fixed.
-Descriptions of the method parameters can be found in the method's documentation page ».
-Descriptions of the method parameters can be found in the method's documentation page ».
+The process starts when your app receives an event from one of the SDKs, or from a custom source.
-The SDKs trigger a passport authorization request by opening the following Telegram-specific URI:
tg://resolve?params
With the following query string parameters:
@@ -342,55 +354,47 @@ users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector<SecureValueErrtelegrampassport
for Passport authorization requests.tg://
URI are also used to resolve usernames, stickersets, translation packs and more, the domain
parameter identifies the action to take when opening the link.1234567:4TT8bAc8GHUspu3ERYn-KGcvsvGB9u_n4ddy
, the bot id is 1234567
.nonce
parameter.nonce
.nonce
and the payload
parameters may be found in a URI, for backwards compatibility: in this case, the nonce
parameter should always be used instead of payload
.Example URI, generated by the Telegram Passport Example page:
tg://resolve?domain=telegrampassport&bot_id=543260180&scope=%7B%22v%22%3A1%2C%22d%22%3A%5B%7B%22_%22%3A%22pd%22%2C%22n%22%3A1%7D%2C%22ad%22%2C%22pn%22%2C%22em%22%2C%7B%22_%22%3A%5B%7B%22_%22%3A%22pp%22%2C%22s%22%3A1%2C%22t%22%3A1%7D%2C%22ip%22%2C%22dl%22%2C%22ic%22%5D%7D%2C%7B%22_%22%3A%5B%22ub%22%2C%22bs%22%2C%22ra%22%2C%22pr%22%2C%22tr%22%5D%7D%5D%7D&public_key=-----BEGIN%20PUBLIC%20KEY-----%0AMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv6m1zBF8lZOCqcxf8hnj%0AkvHwuWdU8s4rBWaxKXH%2FvDDUklcCS5uhSnmjhxWca9suubaG3lW4HxlCilkeJPVf%0Ajimg5Q8ZqWrR3OoOihEpcG9iJZTOEpsEk7VtEiabgacBG3Quv9JslTrDe95Fn801%0At9d21HXwgMrHeHpWDOn31Dr%2BwoEH%2BkwySUWa6L%2FZbnGwSNP7eeDTE7Amz1RMDk3t%0A8EWGq58u0IQatPcEH09aUQlKzk6MIiALkZ9ILBKCBk6d2WCokKnsdBctovNbxwSx%0AhP1qst1r%2BYc8iPBZozsDC0ZsC5jXCkcODI3OC0tkNtYzN2XKalW5R0DjDRUDmGhT%0AzQIDAQAB%0A-----END%20PUBLIC%20KEY-----%0A&nonce=b8e892dc2e0afe63424d101b964f1256_32858210_708614a4585b84872e&callback_url=https%3A%2F%2Fcore.telegram.org%2Fpassport%2Fexample%3Fpassport_ssid%3Db8e892dc2e0afe63424d101b964f1256_32858210_db259b427f200751ce&payload=b8e892dc2e0afe63424d101b964f1256_32858210_708614a4585b84872e
-This object represents the data to be requested.
This object represents a requested element, should be one of:
You can use the special type “idd” as an alias for one of “pp”, “dl”, “ic” and the special type “add” as an alias for one of “ub”, “bs”, “ra”.
-You can use the special type "idd" as an alias for one of "pp", "dl", "ic" and the special type "add" as an alias for one of "ub", "bs", "ra".
+This object represents several elements one of which must be provided.
This object represents one particular element that must be provided. If no options are needed, String can be used instead of this object to specify the type of the element.
_ | String | -Element type. One of “pd”, “pp”, “dl”, “ic”, “ip”, “ad”, “ub”, “bs”, “ra”, “pr”, “tr”, “pn”, “em” | +Element type. One of "pd", "pp", "dl", "ic", "ip", "ad", "ub", "bs", "ra", "pr", "tr", "pn", "em" |
s | Boolean | -Optional. Use this parameter if you want to request a selfie with the document as well. Available for “pp”, “dl”, “ic” and “ip” | +Optional. Use this parameter if you want to request a selfie with the document as well. Available for "pp", "dl", "ic" and "ip" |
t | Boolean | -Optional. Use this parameter if you want to request a translation of the document as well. Available for “pp”, “dl”, “ic”, “ip”, “ub”, “bs”, “ra”, “pr” and “tr”. Note: We suggest to only request translations after you have received a valid document that requires one. | +Optional. Use this parameter if you want to request a translation of the document as well. Available for "pp", "dl", "ic", "ip", "ub", "bs", "ra", "pr" and "tr". Note: We suggest to only request translations after you have received a valid document that requires one. |
n | Boolean | -Optional. Use this parameter to request the first, last and middle name of the user in the language of the user's country of residence. Available for “pd” | +Optional. Use this parameter to request the first, last and middle name of the user in the language of the user's country of residence. Available for "pd" |
You can also use the special type “idd” as an alias for one of “pp”, “dl”, “ic” and the special type “add” as an alias for one of “ub”, “bs”, “ra”.
-The next step for the client app is to request the user's 2FA passport, and configure Telegram Passport/fetch and decrypt remotely saved Telegram Passport parameters as described in the Encryption article ».
-account.authorizationForm#ad2e1cd8 flags:# required_types:Vector<SecureRequiredType> values:Vector<SecureValue> errors:Vector<SecureValueError> users:Vector<User> privacy_policy_url:flags.0?string = account.AuthorizationForm;
+You can also use the special type "idd" as an alias for one of "pp", "dl", "ic" and the special type "add" as an alias for one of "ub", "bs", "ra".
+Setting up Telegram Passport
+The next step for the client app is to request the user's 2FA passport, and configure Telegram Passport/fetch and decrypt remotely saved Telegram Passport parameters as described in the Encryption article ».
+Fetching the passport form
+account.authorizationForm#ad2e1cd8 flags:# required_types:Vector<SecureRequiredType> values:Vector<SecureValue> errors:Vector<SecureValueError> users:Vector<User> privacy_policy_url:flags.0?string = account.AuthorizationForm;
---functions---
-account.getAuthorizationForm#b86ba8e1 bot_id:int scope:string public_key:string = account.AuthorizationForm;
+account.getAuthorizationForm#a929597a bot_id:long scope:string public_key:string = account.AuthorizationForm;
Then, the client app passes the bot ID, scope and public key from the passport authorization request to the Telegram servers using the account.getAuthorizationForm method.
-The response will be an account.authorizationForm constructor, with info about the required document types, the URL of the service's privacy policy, as well as info about the bot to which the form should be sent.
If the form was already submitted at least once, the constructor will also contain a list of already submitted data, along with eventual errors.
The user should accept the privacy policy and proceed to fill in the required data, and the client should encrypt and upload it as described in the Encryption article ».
-secureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted;
+The response will be an account.authorizationForm constructor, with info about the required document types, the URL of the service's privacy policy, as well as info about the bot to which the form should be sent.
+If the form was already submitted at least once, the constructor will also contain a list of already submitted data, along with eventual errors.
+The user should accept the privacy policy and proceed to fill in the required data, and the client should encrypt and upload it as described in the Encryption article ».
+Submitting the passport form
+secureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted;
-secureValueHash#ed1ecdb0 type:SecureValueType hash:bytes = SecureValueHash;
+secureValueHash#ed1ecdb0 type:SecureValueType hash:bytes = SecureValueHash;
---functions---
-account.acceptAuthorization#e7027c94 bot_id:int scope:string public_key:string value_hashes:Vector<SecureValueHash> credentials:SecureCredentialsEncrypted = Bool;
+account.acceptAuthorization#f3ed4c73 bot_id:long scope:string public_key:string value_hashes:Vector<SecureValueHash> credentials:SecureCredentialsEncrypted = Bool;
Once the user finishes uploading the required documents and clicks on the submit button, the client calls account.acceptAuthorization, submitting the documents to the bot associated to the service.
bot_id
, scope
and public_key
are taken from the authorization request URI.value_hashes
is used by the server to choose which document of which type to send to the bot: the type
field should be set to the document type, and the hash
field should be set to the data_hash
/file_hash
generated when uploading encrypting the data ».credentials
contains the encrypted credentials required by the service to decrypt the sent E2E encrypted secure values: it is generated as described in Passport Credentials ».value_hashes
is used by the server to choose which document of which type to send to the bot: the type
field should be set to the document type, and the hash
field should be set to the data_hash
/file_hash
generated when uploading encrypting the data ».credentials
contains the encrypted credentials required by the service to decrypt the sent E2E encrypted secure values: it is generated as described in Passport Credentials ».Finally, the client opens the callback URL (if present).
-secureValueErrorData#e8a40bd9 type:SecureValueType data_hash:bytes field:string text:string = SecureValueError;
-secureValueErrorFrontSide#be3dfa type:SecureValueType file_hash:bytes text:string = SecureValueError;
-secureValueErrorReverseSide#868a2aa5 type:SecureValueType file_hash:bytes text:string = SecureValueError;
-secureValueErrorSelfie#e537ced6 type:SecureValueType file_hash:bytes text:string = SecureValueError;
-secureValueErrorFile#7a700873 type:SecureValueType file_hash:bytes text:string = SecureValueError;
-secureValueErrorFiles#666220e9 type:SecureValueType file_hash:Vector<bytes> text:string = SecureValueError;
-secureValueError#869d758f type:SecureValueType hash:bytes text:string = SecureValueError;
-secureValueErrorTranslationFile#a1144770 type:SecureValueType file_hash:bytes text:string = SecureValueError;
-secureValueErrorTranslationFiles#34636dd8 type:SecureValueType file_hash:Vector<bytes> text:string = SecureValueError;
+Handling invalid forms
+secureValueErrorData#e8a40bd9 type:SecureValueType data_hash:bytes field:string text:string = SecureValueError;
+secureValueErrorFrontSide#be3dfa type:SecureValueType file_hash:bytes text:string = SecureValueError;
+secureValueErrorReverseSide#868a2aa5 type:SecureValueType file_hash:bytes text:string = SecureValueError;
+secureValueErrorSelfie#e537ced6 type:SecureValueType file_hash:bytes text:string = SecureValueError;
+secureValueErrorFile#7a700873 type:SecureValueType file_hash:bytes text:string = SecureValueError;
+secureValueErrorFiles#666220e9 type:SecureValueType file_hash:Vector<bytes> text:string = SecureValueError;
+secureValueError#869d758f type:SecureValueType hash:bytes text:string = SecureValueError;
+secureValueErrorTranslationFile#a1144770 type:SecureValueType file_hash:bytes text:string = SecureValueError;
+secureValueErrorTranslationFiles#34636dd8 type:SecureValueType file_hash:Vector<bytes> text:string = SecureValueError;
-account.authorizationForm#ad2e1cd8 flags:# required_types:Vector<SecureRequiredType> values:Vector<SecureValue> errors:Vector<SecureValueError> users:Vector<User> privacy_policy_url:flags.0?string = account.AuthorizationForm;
+account.authorizationForm#ad2e1cd8 flags:# required_types:Vector<SecureRequiredType> values:Vector<SecureValue> errors:Vector<SecureValueError> users:Vector<User> privacy_policy_url:flags.0?string = account.AuthorizationForm;
---functions---
-account.getAuthorizationForm#b86ba8e1 bot_id:int scope:string public_key:string = account.AuthorizationForm;
+account.getAuthorizationForm#a929597a bot_id:long scope:string public_key:string = account.AuthorizationForm;
If any of the values of the submitted form are rejected by the service, the bot calls the appropriate method to set information about errors.
-The user can find out about these errors directly from the service, or, if they decide to restart the process and resend the corrected data, directly from the authorization form (errors
field).
The user can find out about these errors directly from the service, or, if they decide to restart the process and resend the corrected data, directly from the authorization form (errors
field).
Same with email verification codes.
In all cases, the pattern is a string of the same length as the string to verify: and matching is as simple as checking if all chars in the source string are the same as in the pattern string.
Some chars in the pattern string may be censored using an asterisk *
, in this case any char in the source string is considered valid.
The pattern string can also be a single astrisk, in this case all patterns are considered valid.
+The pattern string can also be a single asterisk, in this case all patterns are considered valid.
If the source string is a phone number, it has to be sanitized first to include only the following chars: 0123456789
.
Example implementation: telegram for android.
diff --git a/data/core.telegram.org/api/payments.html b/data/core.telegram.org/api/payments.html index cea7b3b259..1753b3b3cf 100644 --- a/data/core.telegram.org/api/payments.html +++ b/data/core.telegram.org/api/payments.html @@ -61,9 +61,9 @@ For more info on how payments work, check out the updateNewMessage constructor from the bot, containing a messageMediaInvoice constructor with basic info about the product.The message will also have a replyInlineMarkup keyboard attached to it. The the first button of the keyboard will always be a keyboardButtonBuy button.
invoice#c30aa358 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true currency:string prices:Vector<LabeledPrice> = Invoice;
+invoice#cd886e0 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true currency:string prices:Vector<LabeledPrice> max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector<long> = Invoice;
paymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo;
paymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;
-payments.paymentForm#3f56aea3 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
+payments.paymentForm#1694761b flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
---functions---
-payments.getPaymentForm#99f09745 msg_id:int = payments.PaymentForm;
+payments.getPaymentForm#8a333c8d flags:# peer:InputPeer msg_id:int theme_params:flags.0?DataJSON = payments.PaymentForm;
If the user clicks on the keyboardButtonBuy button, the client proceeds to call payments.getPaymentForm with the message ID of the invoice preview message to get the payment form.
The returned form will contain fields that should be passed to the payment provider along with the full invoice. The payment form also contains info about previously saved payment credentials and order information (name, phone number, email, shipping address & so on).
The full invoice contains info about the information required for the order, the price and the currency, and whether this is a test
order.
invoice#c30aa358 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true currency:string prices:Vector<LabeledPrice> = Invoice;
+invoice#cd886e0 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true currency:string prices:Vector<LabeledPrice> max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector<long> = Invoice;
postAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress;
@@ -119,7 +119,7 @@ The payment form also contains info about previously saved payment credentials a
---functions---
-payments.validateRequestedInfo#770a8e74 flags:# save:flags.0?true msg_id:int info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;
+payments.validateRequestedInfo#db103170 flags:# save:flags.0?true peer:InputPeer msg_id:int info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;
If any data at all is requested by the invoice (name_requested
, phone_requested
, email_requested
, shipping_address_requested
), the user must call payments.validateRequestedInfo, providing the required data (as usual, msg_id
is the ID of the invoice message).
The user can choose to save order information for future use by setting the save
flag.
Data can be autofilled as described in autofill.
shipping_options
shippingOption#b6213cdf id:string title:string prices:Vector<LabeledPrice> = ShippingOption;
-updateBotShippingQuery#e0cdc940 query_id:long user_id:int payload:bytes shipping_address:PostAddress = Update;
+updateBotShippingQuery#b5aefd7d query_id:long user_id:long payload:bytes shipping_address:PostAddress = Update;
---functions---
@@ -153,14 +153,14 @@ The bot must respond using mess
inputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;
inputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;
inputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;
-inputPaymentCredentialsAndroidPay#ca05d50e payment_token:DataJSON google_transaction_id:string = InputPaymentCredentials;
+inputPaymentCredentialsGooglePay#8ac32801 payment_token:DataJSON = InputPaymentCredentials;
-payments.paymentForm#3f56aea3 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
+payments.paymentForm#1694761b flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
inputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;
-payments.paymentForm#3f56aea3 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
+payments.paymentForm#1694761b flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
Typically, payment takes place by opening the url
in the specified payment form, which leads to a payment form on the website of the payment gateway.
Once the user finishes entering their payment credentials, a payment_form_submit
web event is generated by the payment gateway, containing data
and title
JSON fields.
The title
is used by the client app to represent the payment credentials (typically a censored version of credit card information).
@@ -170,7 +170,7 @@ Eventually, you can set the save
flag to save the credit card info
inputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;
-payments.paymentForm#3f56aea3 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
+payments.paymentForm#1694761b flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
Most telegram apps support working natively with the native APIs of some payment providers, without opening the website of the payment and receiving a JS event.
This is done using the JSON native_params
parameters field of the payments.paymentForm constructor, which contains an object, which can contain one or more of the following fields:
save
flag to save the credit card info
inputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;
-payments.paymentForm#3f56aea3 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
+payments.paymentForm#1694761b flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
If the native_provider
field is set and equal to stripe
, the client can make use of the native Stripe token APIs with the publishable_key
from the native_params
to add a payment method to Stripe, and then use the token type
and id
to generate a JSON object:
{"type":"token.type", "id":"token.id"}"
The generated JSON object can then be passed to the data
field of the inputPaymentCredentials.
@@ -199,15 +199,15 @@ Eventually, you can set the save
flag to save the credit card info
On iOS devices, Apple Pay can be used to generate payment data, which is then sent using the inputPaymentCredentialsApplePay constructor.
Example implementation: Telegram for iOS.
inputPaymentCredentialsAndroidPay#ca05d50e payment_token:DataJSON google_transaction_id:string = InputPaymentCredentials;
-On Android devices, Google Pay can be used to generate payment data, which is then sent using the inputPaymentCredentialsAndroidPay constructor.
+inputPaymentCredentialsGooglePay#8ac32801 payment_token:DataJSON = InputPaymentCredentials;
+On Android devices, Google Pay can be used to generate payment data, which is then sent using the inputPaymentCredentialsGooglePay constructor.
Example implementation: Telegram for Android.
inputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;
paymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;
-payments.paymentForm#3f56aea3 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
+payments.paymentForm#1694761b flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
account.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;
@@ -229,14 +229,14 @@ Full credit card info is not saved on Telegram Servers, and can
inputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;
inputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;
inputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;
-inputPaymentCredentialsAndroidPay#ca05d50e payment_token:DataJSON google_transaction_id:string = InputPaymentCredentials;
+inputPaymentCredentialsGooglePay#8ac32801 payment_token:DataJSON = InputPaymentCredentials;
payments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;
payments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult;
---functions---
-payments.sendPaymentForm#2b8879b3 flags:# msg_id:int requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials = payments.PaymentResult;
+payments.sendPaymentForm#30c3bc9d flags:# form_id:long peer:InputPeer msg_id:int requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials tip_amount:flags.2?long = payments.PaymentResult;
After verifying order information, the final step for the client is to call payments.sendPaymentForm, with the following parameters:
msg_id
is set to the ID of the invoice messagepaymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo;
-updateBotPrecheckoutQuery#5d2f3aa9 flags:# query_id:long user_id:int payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;
+updateBotPrecheckoutQuery#8caa9a96 flags:# query_id:long user_id:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;
---functions---
@@ -270,15 +270,15 @@ The bot must reply using mes
messageMediaInvoice#84551347 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string = MessageMedia;
-message#58ae39c9 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> = Message;
+message#85d6cbe2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;
updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
-payments.paymentReceipt#500911e1 flags:# date:int bot_id:int invoice:Invoice provider_id:int info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption currency:string total_amount:long credentials_title:string users:Vector<User> = payments.PaymentReceipt;
+payments.paymentReceipt#70c4fe03 flags:# date:int bot_id:long provider_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector<User> = payments.PaymentReceipt;
---functions---
-payments.getPaymentReceipt#a092a980 msg_id:int = payments.PaymentReceipt;
+payments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt;
In case the bot confirms the order, Telegram requests the payment provider to complete the transaction. If the payment information was entered correctly and the payment goes through, the Telegram API will modify the invoice message and send a service message as described below. Once your bot receives this message, it should proceed with delivering the goods or services purchased by the user.
If all is OK, the user receives a payments.paymentResult in reply to the payments.sendPaymentForm query, containing info about the updated invoice message in the form of an updateEditMessage.
The invoice message will be updated as follows: the attached messageMediaInvoice will now have a receipt_msg_id
field.
diff --git a/data/core.telegram.org/api/pin.html b/data/core.telegram.org/api/pin.html
index 51e6db24c0..d112a68591 100644
--- a/data/core.telegram.org/api/pin.html
+++ b/data/core.telegram.org/api/pin.html
@@ -42,10 +42,10 @@
Telegram allows pinning multiple messages on top of a specific chat.
-message#58ae39c9 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> = Message;
+message#85d6cbe2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;
updatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vector<int> pts:int pts_count:int = Update;
-updatePinnedChannelMessages#8588878b flags:# pinned:flags.0?true channel_id:int messages:Vector<int> pts:int pts_count:int = Update;
+updatePinnedChannelMessages#5bb98608 flags:# pinned:flags.0?true channel_id:long messages:Vector<int> pts:int pts_count:int = Update;
---functions---
@@ -60,15 +60,15 @@ The unpin
flags specifies whether to unpin or pin the message, and
When (un)pinning messages, a updatePinnedMessages or updatePinnedChannelMessages update will be emitted, containing IDs of pinned or unpinned messages.
Pinned messages will also have the will also have the pinned
flag of message set.
Getting pinned messages
-userFull#edf17c12 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int = UserFull;
-chatFull#1b7c9db3 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int = ChatFull;
-channelFull#f0e6672a flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?int location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int = ChatFull;
+userFull#d697ff05 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string = UserFull;
+chatFull#4dbdc099 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string = ChatFull;
+channelFull#e9b27a17 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string = ChatFull;
inputMessagesFilterPinned#1bb00451 = MessagesFilter;
---functions---
-messages.search#c352eec flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;
+messages.search#a0fda762 flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
The pinned_msg_id
of userFull, chatFull, channelFull contains the ID of only the latest pinned message.
To obtain a full list, use messages.search with inputMessagesFilterPinned filter.
pollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters;
-pollResults#badcc1a3 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<int> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults;
+pollResults#dcb82ea3 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<long> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults;
poll#86e18161 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:string answers:Vector<PollAnswer> close_period:flags.4?int close_date:flags.5?int = Poll;
@@ -98,7 +98,7 @@ These last two parameters are exactly the same, except that one uses absolute, t
Getting poll votes
pollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters;
-pollResults#badcc1a3 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<int> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults;
+pollResults#dcb82ea3 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<long> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults;
updateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update;
@@ -108,13 +108,13 @@ These last two parameters are exactly the same, except that one uses absolute, t
Regularly, if new users have voted in polls available to the user, they will receive an updateMessagePoll, with updated pollResults.
The same constructor can also be fetched manually using messages.getPollResults.
Getting poll voters in non-anonymous polls
-messageUserVote#a28e5559 user_id:int option:bytes date:int = MessageUserVote;
-messageUserVoteInputOption#36377430 user_id:int date:int = MessageUserVote;
-messageUserVoteMultiple#e8fe0de user_id:int options:Vector<bytes> date:int = MessageUserVote;
+messageUserVote#34d247b4 user_id:long option:bytes date:int = MessageUserVote;
+messageUserVoteInputOption#3ca5b0ec user_id:long date:int = MessageUserVote;
+messageUserVoteMultiple#8a65e557 user_id:long options:Vector<bytes> date:int = MessageUserVote;
messages.votesList#823f649 flags:# count:int votes:Vector<MessageUserVote> users:Vector<User> next_offset:flags.0?string = messages.VotesList;
-updateMessagePollVote#42f88f2c poll_id:long user_id:int options:Vector<bytes> = Update;
+updateMessagePollVote#106395c9 poll_id:long user_id:long options:Vector<bytes> qts:int = Update;
---functions---
diff --git a/data/core.telegram.org/api/push-updates.html b/data/core.telegram.org/api/push-updates.html
index e5bd34b668..7ab156f5d9 100644
--- a/data/core.telegram.org/api/push-updates.html
+++ b/data/core.telegram.org/api/push-updates.html
@@ -156,34 +156,40 @@
-MESSAGE_PLAYLIST
-{1} sent you {2} music files
-1. User name
2. Number of audio files that were sent
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+AUTH_REGION
+New login from unrecognized device {1}, location: {2}
+1. Device name
2. Location
+
-MESSAGE_DOCS
-{1} sent you {2} files
-1. User name
2. Number of documents that were sent
-attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
from_id: Author identifier (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
+AUTH_UNKNOWN
+New login from unrecognized device {1}
+1. Device name
+
-CHAT_MESSAGE_PLAYLIST
-{1} sent {3} music files to the group {2}
-1. User name
2. Group name
3. Number of audio files that were sent
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+CHANNEL_MESSAGES
+{1} posted an album
+1. Message author
+attachb64: Base64-encoded version of the attached media (related to the first message)
channel_id: Channel/supergroup identifier (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
-CHAT_MESSAGE_DOCS
-{1} sent {3} files to the group {2}
-1. User name
2. Group name
3. Number of documents that were sent
-attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
chat_id: Chat identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
+CHANNEL_MESSAGE_AUDIO
+{1} posted a voice message
+1. Message author
+attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-CHANNEL_MESSAGE_PLAYLIST
-{1} posted {2} music files
-1. Channel name
2. Number of audio files that were posted
-attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+CHANNEL_MESSAGE_CONTACT
+{1} posted a contact {2}
+1. Message author
2. Contact name
+attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+CHANNEL_MESSAGE_DOC
+{1} posted a file
+1. Message author
+attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_DOCS
@@ -192,153 +198,39 @@
attachb64: Base64-encoded version of the attached media (related to the first message)
channel_id: Channel/supergroup identifier (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
-MESSAGE_TEXT
-{1}: {2}
-1. Message author
2. Message body
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+CHANNEL_MESSAGE_FWDS
+{1} posted {2} forwarded messages
+1. Message author
2. Number of forwarded messages
+attachb64: Base64-encoded version of the attached media (related to the first message)
channel_id: Channel/supergroup identifier (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
-MESSAGE_NOTEXT
-{1} sent you a message
-1. Message author
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_PHOTO
-{1} sent you a photo
-1. Message author
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_PHOTO_SECRET
-{1} sent you a self-destructing photo
-1. User name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_VIDEO
-{1} sent you a video
-1. Message author
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_VIDEO_SECRET
-{1} sent you a self-destructing video
-1. User name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_SCREENSHOT
-{1} took a screenshot
-1. User name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_ROUND
-{1} sent you a video message
-1. User name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_DOC
-{1} sent you a file
-1. User name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_STICKER
-{1} sent you a {2}sticker
-1. User name
2. Sticker emoji with included trailing space or empty string
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_AUDIO
-{1} sent you a voice message
-1. Message author
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_CONTACT
-{1} shared a contact {2} with you
-1. User name
2. Contact name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_QUIZ
-{1} sent you a quiz {2}
-1. User name
2. Quiz name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_GEO
-{1} sent you a map
-1. Message author
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_GEOLIVE
-{1} started sharing their live location
-1. User name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_POLL
-{1} sent you a poll {2}
-1. User name
2. Poll name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_GIF
-{1} sent you a GIF
-1. User name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-MESSAGE_GAME
+CHANNEL_MESSAGE_GAME
{1} invited you to play {2}
-1. User name
2. Game name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+1. Message author
2. Game name
+attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-MESSAGE_GAME_SCORE
+CHANNEL_MESSAGE_GAME_SCORE
{1} scored {3} in game {2}
-1. User name
2. Game name
3. Score
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+1. User
2. Game name
3. Score
+attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-MESSAGE_INVOICE
-{1} sent you an invoice for {2}
-1. User name
2. Product
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+CHANNEL_MESSAGE_GEO
+{1} posted a location
+1. Channel name
+attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-MESSAGE_FWDS
-{1} forwarded you {2} messages
-1. User name
2. Number of messages that were forwarded
-attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
from_id: Author identifier (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
+CHANNEL_MESSAGE_GEOLIVE
+{1} posted a live location
+1. Channel name
+attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-MESSAGE_PHOTOS
-{1} sent you {2} photos
-1. User name
2. Number of photos that were sent
-attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
from_id: Author identifier (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
-
-
-MESSAGE_VIDEOS
-{1} sent you {2} videos
-1. User name
2. Number of videos that were sent
-attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
from_id: Author identifier (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
-
-
-MESSAGES
-{1} sent you an album
-1. User name
-from_id: author identifier
-
-
-CHANNEL_MESSAGE_TEXT
-{1}: {2}
-1. Channel name
2. Message body
+CHANNEL_MESSAGE_GIF
+{1} posted a GIF
+1. Channel name
attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
@@ -354,52 +246,16 @@
attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-CHANNEL_MESSAGE_VIDEO
-{1} posted a video
-1. Channel name
-attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+CHANNEL_MESSAGE_PHOTOS
+{1} posted {2} photos
+1. Channel name
2. Number of photos that was sent
+attachb64: Base64-encoded version of the attached media (related to the first message)
channel_id: Channel/supergroup identifier (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
-CHANNEL_MESSAGE_ROUND
-{1} posted a video message
-1. Channel name
-attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-CHANNEL_MESSAGE_DOC
-{1} posted a file
-1. Message author
-attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-CHANNEL_MESSAGE_STICKER
-{1} posted a {2}sticker
-1. Channel name
2. Sticker emoji with included trailing space or empty string
-attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-CHANNEL_MESSAGE_AUDIO
-{1} posted a voice message
-1. Message author
-attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-CHANNEL_MESSAGE_CONTACT
-{1} posted a contact {2}
-1. Message author
2. Contact name
-attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-CHANNEL_MESSAGE_GEO
-{1} posted a map
-1. Channel name
-attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-CHANNEL_MESSAGE_GEOLIVE
-{1} posted a live location
-1. Channel name
-attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+CHANNEL_MESSAGE_PLAYLIST
+{1} posted {2} music files
+1. Channel name
2. Number of audio files that were posted
+attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_POLL
@@ -414,34 +270,28 @@
attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-CHANNEL_MESSAGE_GIF
-{1} posted a GIF
+CHANNEL_MESSAGE_ROUND
+{1} posted a video message
1. Channel name
attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-CHANNEL_MESSAGE_GAME
-{1} invited you to play {2}
-1. Message author
2. Game name
+CHANNEL_MESSAGE_STICKER
+{1} posted a {2} sticker
+1. Channel name
2. Sticker emoji
attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-CHANNEL_MESSAGE_GAME_SCORE
-{1} scored {3} in game {2}
-1. User
2. Game name
3. Score
+CHANNEL_MESSAGE_TEXT
+{1}: {2}
+1. Channel name
2. Message body
attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-CHANNEL_MESSAGE_FWDS
-{1} posted {2} forwarded messages
-1. Message author
2. Number of forwarded messages
-attachb64: Base64-encoded version of the attached media (related to the first message)
channel_id: Channel/supergroup identifier (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
-
-
-CHANNEL_MESSAGE_PHOTOS
-{1} posted {2} photos
-1. Channel name
2. Number of photos that was sent
-attachb64: Base64-encoded version of the attached media (related to the first message)
channel_id: Channel/supergroup identifier (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
+CHANNEL_MESSAGE_VIDEO
+{1} posted a video
+1. Channel name
+attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_VIDEOS
@@ -450,15 +300,117 @@
attachb64: Base64-encoded version of the attached media (related to the first message)
channel_id: Channel/supergroup identifier (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
-CHANNEL_MESSAGES
-{1} posted an album
-1. Message author
-attachb64: Base64-encoded version of the attached media (related to the first message)
channel_id: Channel/supergroup identifier (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
+CHAT_ADD_MEMBER
+{1} invited {3} to the group {2}
+1. Message author
2. Chat name
3. New participant name
+chat_id: chat identifier
-CHAT_MESSAGE_TEXT
-{1}@{2}: {3}
-1. Message author
2. Chat name
3. Message body
+CHAT_ADD_YOU
+{1} invited you to the group {2}
+1. User name
2. Group name
+chat_id: chat identifier
+
+
+CHAT_CREATED
+{1} invited you to the group {2}
+1. Message author
2. Chat name
+chat_id: chat identifier
+
+
+CHAT_DELETE_MEMBER
+{1} removed {3} from the group {2}
+1. Message author
2. Chat name
3. Dropped participant name
+chat_id: chat identifier
+
+
+CHAT_DELETE_YOU
+{1} removed you from the group {2}
+1. Message author
2. Chat name
+chat_id: chat identifier
+
+
+CHAT_JOINED
+{1} joined the group {2}
+1. User name
2. Group name
+chat_id: chat identifier
+
+
+CHAT_LEFT
+{1} left the group {2}
+1. Message author
2. Chat name
+chat_id: chat identifier
+
+
+CHAT_MESSAGES
+{1} sent an album to the group {2}
+1. User name
2. Group name
+chat_from_id: Message author identifier
chat_id: chat identifier
mention: Whether the user was mentioned in the message
+
+
+CHAT_MESSAGE_AUDIO
+{1} sent a voice message to the group {2}
+1. Message author
2. Chat name
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+CHAT_MESSAGE_CONTACT
+{1} shared a contact {3} in the group {2}
+1. User name
2. Group name
3. Contact name
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+CHAT_MESSAGE_DOC
+{1} sent a file to the group {2}
+1. User name
2. Group name
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+CHAT_MESSAGE_DOCS
+{1} sent {3} files to the group {2}
+1. User name
2. Group name
3. Number of documents that were sent
+attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
chat_id: Chat identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
+
+
+CHAT_MESSAGE_FWDS
+{1} forwarded {3} messages to the group {2}
+1. User name
2. Group name
3. Number of messages that were forwarded
+attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
chat_id: Chat identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
+
+
+CHAT_MESSAGE_GAME
+{1} invited the group {2} to play {3}
+1. User name
2. Group name
3. Game name
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+CHAT_MESSAGE_GAME_SCORE
+{1} scored {4} in game {3} in the group {2}
+1. User name
2. Group name
3. Game name
4. Score
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+CHAT_MESSAGE_GEO
+{1} sent a location to the group {2}
+1. Message author
2. Chat name
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+CHAT_MESSAGE_GEOLIVE
+{1} shared a live location with the group {2}
+1. User name
2. Group name
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+CHAT_MESSAGE_GIF
+{1} sent a GIF to the group {2}
+1. User name
2. Group name
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+CHAT_MESSAGE_INVOICE
+{1} sent an invoice to the group {2} for {3}
+1. User name
2. Group name
3. Product name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
@@ -474,52 +426,16 @@
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-CHAT_MESSAGE_VIDEO
-{1} sent a video to the group {2}
-1. Message author
2. Chat name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+CHAT_MESSAGE_PHOTOS
+{1} sent {3} photos to the group {2}
+1. User name
2. Group name
3. Number of photos that were sent
+attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
chat_id: Chat identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
-CHAT_MESSAGE_ROUND
-{1} sent a video message to the group {2}
-1. User name
2. Group name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-CHAT_MESSAGE_DOC
-{1} sent a file to the group {2}
-1. User name
2. Group name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-CHAT_MESSAGE_STICKER
-{1} sent a {3}sticker to the group {2}
-1. User name
2. Group name
3. Sticker emoji with included trailing space or empty string
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-CHAT_MESSAGE_AUDIO
-{1} sent a voice message to the group {2}
-1. Message author
2. Chat name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-CHAT_MESSAGE_CONTACT
-{1} shared a contact {3} in the group {2}
-1. User name
2. Group name
3. Contact name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-CHAT_MESSAGE_GEO
-{1} sent a map to the group {2}
-1. Message author
2. Chat name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-CHAT_MESSAGE_GEOLIVE
-{1} started sharing their live location with {2}
-1. User name
2. Group name
-attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+CHAT_MESSAGE_PLAYLIST
+{1} sent {3} music files to the group {2}
+1. User name
2. Group name
3. Number of audio files that were sent
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_POLL
@@ -534,196 +450,280 @@
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-CHAT_MESSAGE_GIF
-{1} sent a GIF to the group {2}
+CHAT_MESSAGE_ROUND
+{1} sent a video message to the group {2}
1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-CHAT_MESSAGE_GAME
-{1} invited the group {2} to play {3}.
-1. User name
2. Group name
3. Game name
+CHAT_MESSAGE_STICKER
+{1} sent a {3} sticker to the group {2}
+1. User name
2. Group name
3. Sticker emoji
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-CHAT_MESSAGE_GAME_SCORE
-{1} scored {4} in game {3} in the group {2}
-1. User name
2. Group name
3. Game name
4. Score
+CHAT_MESSAGE_TEXT
+{1} @ {2}: {3}
+1. Message author
2. Chat name
3. Message body
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-CHAT_MESSAGE_INVOICE
-{1} sent an invoice to the group {2} for {3}
-1. User name
2. Group name
3. Product name
+CHAT_MESSAGE_VIDEO
+{1} sent a video to the group {2}
+1. Message author
2. Chat name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-CHAT_CREATED
-{1} invited you to the group {2}
-1. Message author
2. Chat name
-chat_id: chat identifier
-
-
-CHAT_TITLE_EDITED
-{1} edited the group's {2} name
-1. User name
2. Group name
-chat_id: chat identifier
-
-
-CHAT_PHOTO_EDITED
-{1} edited the group's {2} photo
-1. Message author
2. Chat name
-chat_from_id: Message author identifier
chat_id: chat identifier
msg_id: ID of the message
-
-
-CHAT_ADD_MEMBER
-{1} invited {3} to the group {2}
-1. Message author
2. Chat name
3. New participant name
-chat_id: chat identifier
-
-
-CHAT_ADD_YOU
-{1} invited you to the group {2}
-1. User name
2. Group name
-chat_id: chat identifier
-
-
-CHAT_DELETE_MEMBER
-{1} kicked {3} from the group {2}
-1. Message author
2. Chat name
3. Dropped participant name
-chat_id: chat identifier
-
-
-CHAT_DELETE_YOU
-{1} kicked you from the group {2}
-1. Message author
2. Chat name
-chat_id: chat identifier
-
-
-CHAT_LEFT
-{1} has left the group {2}
-1. Message author
2. Chat name
-chat_id: chat identifier
-
-
-CHAT_RETURNED
-{1} has returned to the group {2}
-1. Message author
2. Chat name
-chat_id: chat identifier
-
-
-CHAT_JOINED
-{1} has joined the group {2}
-1. User name
2. Group name
-chat_id: chat identifier
-
-
-CHAT_MESSAGE_FWDS
-{1} forwarded {3} messages to the group {2}
-1. User name
2. Group name
3. Number of messages that were forwarded
-attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
chat_id: Chat identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
-
-
-CHAT_MESSAGE_PHOTOS
-{1} sent {3} photos to the group {2}
-1. User name
2. Group name
3. Number of photos that were sent
-attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
chat_id: Chat identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
-
-
CHAT_MESSAGE_VIDEOS
{1} sent {3} videos to the group {2}
1. User name
2. Group name
3. Number of videos that were sent
attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
chat_id: Chat identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
-CHAT_MESSAGES
-{1} sent an album to the group {2}
+CHAT_PHOTO_EDITED
+{1} changed the group photo for {2}
+1. Message author
2. Chat name
+chat_from_id: Message author identifier
chat_id: chat identifier
msg_id: ID of the message
+
+
+CHAT_RETURNED
+{1} returned to the group {2}
+1. Message author
2. Chat name
+chat_id: chat identifier
+
+
+CHAT_TITLE_EDITED
+{1} renamed the group {2}
1. User name
2. Group name
-chat_from_id: Message author identifier
chat_id: chat identifier
mention: Whether the user was mentioned in the message
+chat_id: chat identifier
-PINNED_TEXT
-{1} pinned "{2}"
-1. User name
2. Message body
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+CHAT_VOICECHAT_END
+{1} ended a voice chat in the group {2}
+1. User name
2. Chat name
+
-PINNED_TEXT
-{1} pinned "{3}" in the group {2}
-1. User name
2. Group name
3. Message body
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+CHAT_VOICECHAT_INVITE
+{1} invited {3} to a voice chat in the group {2}
+1. User name
2. Chat name
3. Invited users
+
-PINNED_NOTEXT
-{1} pinned a message
+CHAT_VOICECHAT_INVITE_YOU
+{1} invited you to a voice chat in the group {2}
+1. User name
2. Chat name
+
+
+
+CHAT_VOICECHAT_START
+{1} started a voice chat in the group {2}
+1. User name
2. Chat name
+
+
+
+CONTACT_JOINED
+{1} joined Telegram!
+1. Contact name
+contact_id: contact identifier
+
+
+ENCRYPTED_MESSAGE
+You have a new message
+
+encryption_id: secret chat identifier
random_id: message identifier
+
+
+ENCRYPTION_ACCEPT
+You have a new message
+
+encryption_id: secret chat identifier
+
+
+ENCRYPTION_REQUEST
+You have a new message
+
+encryption_id: secret chat identifier
+
+
+LOCKED_MESSAGE
+You have a new message
+
+
+
+
+MESSAGES
+{1} sent you an album
1. User name
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+from_id: author identifier
-PINNED_NOTEXT
-{1} pinned a message in the group {2}
-1. User name
2. Group name
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+MESSAGE_ANNOUNCEMENT
+{1}
+1. Announcement
+announcement: Announcement: roughly equivalent to a message received from the service notifications (Telegram Notifications, id 777000
) user, but must be delivered via push notifications, without contacting the API.
-PINNED_PHOTO
-{1} pinned a photo
+MESSAGE_AUDIO
+{1} sent you a voice message
+1. Message author
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+MESSAGE_CONTACT
+{1} shared a contact {2} with you
+1. User name
2. Contact name
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+MESSAGE_DOC
+{1} sent you a file
1. User name
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-PINNED_PHOTO
-{1} pinned a photo in the group {2}
-1. User name
2. Group name
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+MESSAGE_DOCS
+{1} sent you {2} files
+1. User name
2. Number of documents that were sent
+attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
from_id: Author identifier (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
-PINNED_VIDEO
-{1} pinned a video
+MESSAGE_FWDS
+{1} forwarded you {2} messages
+1. User name
2. Number of messages that were forwarded
+attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
from_id: Author identifier (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
+
+
+MESSAGE_GAME
+{1} invited you to play {2}
+1. User name
2. Game name
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+MESSAGE_GAME_SCORE
+{1} scored {3} in game {2}
+1. User name
2. Game name
3. Score
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+MESSAGE_GEO
+{1} sent you a location
+1. Message author
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+MESSAGE_GEOLIVE
+{1} sent you a live location
1. User name
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-PINNED_VIDEO
-{1} pinned a video in the group {2}
-1. User name
2. Group name
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-PINNED_ROUND
-{1} pinned a video message
+MESSAGE_GIF
+{1} sent you a GIF
1. User name
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-PINNED_ROUND
-{1} pinned a video message in the group {2}
-1. User name
2. Group name
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+MESSAGE_INVOICE
+{1} sent you an invoice for {2}
+1. User name
2. Product
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-PINNED_DOC
-{1} pinned a file
+MESSAGE_NOTEXT
+{1} sent you a message
+1. Message author
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+MESSAGE_PHOTO
+{1} sent you a photo
+1. Message author
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+MESSAGE_PHOTOS
+{1} sent you {2} photos
+1. User name
2. Number of photos that were sent
+attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
from_id: Author identifier (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
+
+
+MESSAGE_PHOTO_SECRET
+{1} sent you a self-destructing photo
1. User name
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-PINNED_DOC
-{1} pinned a file in the group {2}
-1. User name
2. Group name
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+MESSAGE_PLAYLIST
+{1} sent you {2} music files
+1. User name
2. Number of audio files that were sent
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
-PINNED_STICKER
-{1} pinned a {2}sticker
-1. User name
2. Sticker emoji with included trailing space or empty string
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+MESSAGE_POLL
+{1} sent you a poll {2}
+1. User name
2. Poll name
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
-PINNED_STICKER
-{1} pinned a {3}sticker in the group {2}
-1. User name
2. Group name
3. Sticker emoji with included trailing space or empty string
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+MESSAGE_QUIZ
+{1} sent you a quiz {2}
+1. User name
2. Quiz name
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+MESSAGE_ROUND
+{1} sent you a video message
+1. User name
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+MESSAGE_SCREENSHOT
+{1} took a screenshot
+1. User name
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+MESSAGE_STICKER
+{1} sent you a {2} sticker
+1. User name
2. Sticker emoji
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+MESSAGE_TEXT
+{1}: {2}
+1. Message author
2. Message body
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+MESSAGE_VIDEO
+{1} sent you a video
+1. Message author
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+MESSAGE_VIDEOS
+{1} sent you {2} videos
+1. User name
2. Number of videos that were sent
+attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
from_id: Author identifier (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
+
+
+MESSAGE_VIDEO_SECRET
+{1} sent you a self-destructing video
+1. User name
+attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PHONE_CALL_MISSED
+You missed a call from {1}
+1. User name
+
+
+
+PHONE_CALL_REQUEST
+{1} is calling you!
+1. User name
+call_ah: Call access hash
call_id: Call ID
PINNED_AUDIO
@@ -750,6 +750,42 @@
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+PINNED_DOC
+{1} pinned a file
+1. User name
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_DOC
+{1} pinned a file in the group {2}
+1. User name
2. Group name
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_GAME
+{1} pinned a game
+1. User name
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_GAME
+{1} pinned a game in the group {2}
+1. User name
2. Group name
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_GAME_SCORE
+{1} pinned a game score
+1. User name
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_GAME_SCORE
+{1} pinned a game score in the group {2}
+1. User name
2. Group name
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
PINNED_GEO
{1} pinned a map
1. User name
@@ -774,6 +810,54 @@
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+PINNED_GIF
+{1} pinned a GIF
+1. User name
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_GIF
+{1} pinned a GIF in the group {2}
+1. User name
2. Group name
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_INVOICE
+{1} pinned an invoice
+1. User name
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_INVOICE
+{1} pinned an invoice in the group {2}
+1. User name
2. Group name
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_NOTEXT
+{1} pinned a message
+1. User name
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_NOTEXT
+{1} pinned a message in the group {2}
+1. User name
2. Group name
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_PHOTO
+{1} pinned a photo
+1. User name
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_PHOTO
+{1} pinned a photo in the group {2}
+1. User name
2. Group name
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
PINNED_POLL
{1} pinned a poll {2}
1. User name
2. Poll name
@@ -798,113 +882,53 @@
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
-PINNED_GAME
-{1} pinned a game
+PINNED_ROUND
+{1} pinned a video message
1. User name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
-PINNED_GAME
-{1} pinned a game in the group {2}
+PINNED_ROUND
+{1} pinned a video message in the group {2}
1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
-PINNED_GAME_SCORE
-{1} pinned a game score
+PINNED_STICKER
+{1} pinned a {2} sticker
+1. User name
2. Sticker emoji
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_STICKER
+{1} pinned a {3} sticker in the group {2}
+1. User name
2. Group name
3. Sticker emoji
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_TEXT
+{1} pinned "{2}"
+1. User name
2. Message body
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_TEXT
+{1} pinned "{3}" in the group {2}
+1. User name
2. Group name
3. Message body
+attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
+
+
+PINNED_VIDEO
+{1} pinned a video
1. User name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
-PINNED_GAME_SCORE
-{1} pinned a game score in the group {2}
+PINNED_VIDEO
+{1} pinned a video in the group {2}
1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
-
-PINNED_INVOICE
-{1} pinned an invoice
-1. User name
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-PINNED_INVOICE
-{1} pinned an invoice in the group {2}
-1. User name
2. Group name
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-PINNED_GIF
-{1} pinned a GIF
-1. User name
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-PINNED_GIF
-{1} pinned a GIF in the group {2}
-1. User name
2. Group name
-attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
-
-
-CONTACT_JOINED
-{1} joined Telegram!
-1. Contact name
-contact_id: contact identifier
-
-
-AUTH_UNKNOWN
-New login from unrecognized device {1}
-1. Device name
-
-
-
-AUTH_REGION
-New login from unrecognized device {1}, location: {2}
-1. Device name
2. Location
-
-
-
-ENCRYPTION_REQUEST
-You have a new message
-
-encryption_id: secret chat identifier
-
-
-ENCRYPTION_ACCEPT
-You have a new message
-
-encryption_id: secret chat identifier
-
-
-ENCRYPTED_MESSAGE
-You have a new message
-
-encryption_id: secret chat identifier
random_id: message identifier
-
-
-LOCKED_MESSAGE
-You have a new message
-
-
-
-
-PHONE_CALL_REQUEST
-{1} is calling you!
-1. User name
-call_ah: Call access hash
call_id: Call ID
-
-
-PHONE_CALL_MISSED
-You missed a call from {1}
-1. User name
-
-
-
-MESSAGE_ANNOUNCEMENT
-{1}
-1. Announcement
-announcement: Announcement: roughly equivalent to a message received from the service notifications (Telegram Notifications, id 777000
) user, but must be delivered via push notifications, without contacting the API.
-
diff --git a/data/core.telegram.org/api/qr-login.html b/data/core.telegram.org/api/qr-login.html
index 7f6826e861..4d6c668469 100644
--- a/data/core.telegram.org/api/qr-login.html
+++ b/data/core.telegram.org/api/qr-login.html
@@ -53,7 +53,7 @@
---functions---
-auth.exportLoginToken#b1b41517 api_id:int api_hash:string except_ids:Vector<int> = auth.LoginToken;
+auth.exportLoginToken#b7e085fe api_id:int api_hash:string except_ids:Vector<long> = auth.LoginToken;
auth.acceptLoginToken#e894ad4d token:bytes = Authorization;
auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;
Exporting a login token
diff --git a/data/core.telegram.org/api/recent-actions.html b/data/core.telegram.org/api/recent-actions.html
index 433be8da35..3e0b2529c5 100644
--- a/data/core.telegram.org/api/recent-actions.html
+++ b/data/core.telegram.org/api/recent-actions.html
@@ -60,15 +60,15 @@
channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 new_value:Bool = ChannelAdminLogEventAction;
channelAdminLogEventActionDefaultBannedRights#2df5fc0a prev_banned_rights:ChatBannedRights new_banned_rights:ChatBannedRights = ChannelAdminLogEventAction;
channelAdminLogEventActionStopPoll#8f079643 message:Message = ChannelAdminLogEventAction;
-channelAdminLogEventActionChangeLinkedChat#a26f881b prev_value:int new_value:int = ChannelAdminLogEventAction;
+channelAdminLogEventActionChangeLinkedChat#50c7ac8 prev_value:long new_value:long = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction;
channelAdminLogEventActionToggleSlowMode#53909779 prev_value:int new_value:int = ChannelAdminLogEventAction;
-channelAdminLogEvent#3b5a3e40 id:long date:int user_id:int action:ChannelAdminLogEventAction = ChannelAdminLogEvent;
+channelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent;
channels.adminLogResults#ed8af74d events:Vector<ChannelAdminLogEvent> chats:Vector<Chat> users:Vector<User> = channels.AdminLogResults;
-channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true = ChannelAdminLogEventsFilter;
+channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true = ChannelAdminLogEventsFilter;
---functions---
diff --git a/data/core.telegram.org/api/requests.html b/data/core.telegram.org/api/requests.html
deleted file mode 100644
index 2fd75ee2c4..0000000000
--- a/data/core.telegram.org/api/requests.html
+++ /dev/null
@@ -1,133 +0,0 @@
-
-
-
-
- Requests
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Requests
-
- Let's consider several typical interaction scenarios for two users.
-One user knows the other's number
-User A knows phone number of B (for instance, A has B's number in the phone book). But B does not know А's number. User A sends message to B. Immediately prior to sending a message relevant check is executed at the server side and the link between A and B will change automatically: A's number becomes available for B (user A is then presented as constructor userRequest).
-The same happens if user B not having A's number sends a message to the latter. A's number also becomes available to B.
-Users do not know numbers of each other
-User A has found user B in a chat, geochat or any other way. For both of them phone numbers are not available (in API - constructor userForeign). A starts chat with B. When messaging A's number will not become available for B and vice versa. To provide B with A's number it is necessary to send him personal message with contact info (phone number should be transferred in constructor inputMediaContact using method messages.sendMedia).
-Now B having personal message with A's phone number can store it in his phone book and import it using method contacts.importContacts to have it in contacts. With all that, it is not mandatory for him to send his number: after any message later between them B's number will be available for A (see One user knows the other's number).
-Both user know each other number
-This is quite obvious: messaging does not change links since target state has been reached.
-Technical features
-Since when sending messages to a current user updates on changed links are not sent constructors containing updated links were added to resulting types of messaging methods:
-messages.statedMessagesLinks messages:Vector<Message> chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessages;
-messages.statedMessageLink message:Message chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessage;
-messages.sentMessageLink id:int date:int pts:int seq:int links:Vector<contacts.Link> = messages.SentMessage;
-To indicate for clients that these constructors are supported one should use 3rd layer.
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/data/core.telegram.org/api/scheduled-messages.html b/data/core.telegram.org/api/scheduled-messages.html
index c32f442277..be2901100b 100644
--- a/data/core.telegram.org/api/scheduled-messages.html
+++ b/data/core.telegram.org/api/scheduled-messages.html
@@ -40,7 +40,7 @@
- Scheduled messages
Telegram allows scheduling messages.
-message#58ae39c9 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> = Message;
+message#85d6cbe2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;
updateNewScheduledMessage#39a51dfb message:Message = Update;
updateDeleteScheduledMessages#90866cee peer:Peer messages:Vector<int> = Update;
@@ -65,7 +65,7 @@ The method call generates the following updates:
---functions---
-messages.getScheduledHistory#e2c2685b peer:InputPeer hash:int = messages.Messages;
+messages.getScheduledHistory#f516760b peer:InputPeer hash:long = messages.Messages;
messages.getScheduledMessages#bdbb0464 peer:InputPeer id:Vector<int> = messages.Messages;
messages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector<int> = Updates;
messages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector<int> = Updates;
diff --git a/data/core.telegram.org/api/search.html b/data/core.telegram.org/api/search.html
index 45f6d282c9..b46d202d3c 100644
--- a/data/core.telegram.org/api/search.html
+++ b/data/core.telegram.org/api/search.html
@@ -68,7 +68,7 @@
---functions---
-messages.search#c352eec flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;
+messages.search#a0fda762 flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
messages.searchGlobal#4bc6589a flags:# folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
When using messages.search or messages.searchGlobal, a certain message filter may be applied.
@@ -100,7 +100,7 @@ For example, when displaying the chat photo gallery, we could display a ph
---functions---
messages.getSearchCounters#732eef00 peer:InputPeer filters:Vector<MessagesFilter> = Vector<messages.SearchCounter>;
-Chat counters with filters can also be returned without fetching the actual messages, as seen in the scheme above.
+Chat counters with filters can also be returned without fetching the actual messages, as seen in the schema above.
diff --git a/data/core.telegram.org/api/srp.html b/data/core.telegram.org/api/srp.html
index 8bc0a6cdfb..cd893a8b8d 100644
--- a/data/core.telegram.org/api/srp.html
+++ b/data/core.telegram.org/api/srp.html
@@ -43,12 +43,16 @@
Telegram uses the Secure Remote Password protocol version 6a to implement 2FA.
Example impementation: tdlib.
-Checking the password with SRP
-To login to an account protected by a 2FA password or to perform some other actions (like changing channel owner), you will need to verify the user's knowledge of the current 2FA account password.
-To do this, first the client needs to obtain SRP parameters and the KDF algorithm to use to check the validity of the password via account.getPassword method. For now, only the passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow algorithm is supported, so we'll only explain that.
+Checking the password with SRP
+To login to an account protected by a 2FA password or to perform some other actions (like changing channel owner), you will need to verify the user's knowledge of the current 2FA account password.
+To do this, first the client needs to obtain SRP parameters and the KDF algorithm to use to check the validity of the password via account.getPassword method. For now, only the passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow algorithm is supported, so we'll only explain that.
Then, after the user provides a password, the client should generate an InputCheckPasswordSRP object using SRP and a specific KDF algorithm as shown below and pass it to appropriate method (e.g. auth.checkPassword in case of authorization).
-This extension of the SRP protocol uses the password-based PBKDF2 with 100000 iterations using sha512 (PBKDF2HMACSHA512iter100000
).
PBKDF2 is used to additionally rehash the x
parameter, obtained using a method similar to the one described in RFC 2945 (H(s | H ( I | password | I) | s)
instead of H(s | H ( I | ":" | password)
) (see below).
-Here, |
denotes concatenation and +
denotes the arithmetical operator +
.
In all cases where concatenation of numbers passed to hashing functions is done, the numbers must be used in big-endian form, padded to 2048 bits; all maths is modulo p
.
Instead of I
, salt1
will be used (see SRP protocol).
Instead of s
, salt2
will be used (see SRP protocol).
+This extension of the SRP protocol uses the password-based PBKDF2 with 100000 iterations using sha512 (PBKDF2HMACSHA512iter100000
).
+PBKDF2 is used to additionally rehash the x
parameter, obtained using a method similar to the one described in RFC 2945 (H(s | H ( I | password | I) | s)
instead of H(s | H ( I | ":" | password)
) (see below).
+Here, |
denotes concatenation and +
denotes the arithmetical operator +
.
+In all cases where concatenation of numbers passed to hashing functions is done, the numbers must be used in big-endian form, padded to 2048 bits; all maths is modulo p
.
+Instead of I
, salt1
will be used (see SRP protocol).
+Instead of s
, salt2
will be used (see SRP protocol).
The main hashing function H
is sha256:
H(data) := sha256(data)
@@ -67,15 +71,27 @@
Client-side, the following parameters are extracted from the passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow object, contained in the account.password object.
-g := algo.g
-p := algo.p
The client is expected to check whether p is a safe 2048-bit prime (meaning that both p and (p-1)/2 are prime, and that 2^2047 < p < 2^2048
), and that g generates a cyclic subgroup of prime order (p-1)/2, i.e. is a quadratic residue mod p. Since g is always equal to 2, 3, 4, 5, 6 or 7, this is easily done using quadratic reciprocity law, yielding a simple condition on p mod 4g — namely, p mod 8 = 7 for g = 2; p mod 3 = 2 for g = 3; no extra condition for g = 4; p mod 5 = 1 or 4 for g = 5; p mod 24 = 19 or 23 for g = 6; and p mod 7 = 3, 5 or 6 for g = 7. After g and p have been checked by the client, it makes sense to cache the result, so as to avoid repeating lengthy computations in future. This cache might be shared with one used for Authorization Key generation.
+-
+
g := algo.g
+
+-
+
p := algo.p
+The client is expected to check whether p is a safe 2048-bit prime (meaning that both p and (p-1)/2 are prime, and that 2^2047 < p < 2^2048
), and that g generates a cyclic subgroup of prime order (p-1)/2, i.e. is a quadratic residue mod p. Since g is always equal to 2, 3, 4, 5, 6 or 7, this is easily done using quadratic reciprocity law, yielding a simple condition on p mod 4g -- namely, p mod 8 = 7 for g = 2; p mod 3 = 2 for g = 3; no extra condition for g = 4; p mod 5 = 1 or 4 for g = 5; p mod 24 = 19 or 23 for g = 6; and p mod 7 = 3, 5 or 6 for g = 7. After g and p have been checked by the client, it makes sense to cache the result, so as to avoid repeating lengthy computations in future. This cache might be shared with one used for Authorization Key generation.
If the client has an inadequate random number generator, it makes sense to use the secure_random of account.password as additional seed.
-password := (user-provided password)
+-
+
password := (user-provided password)
+
+-
+
salt1 := algo.salt1
+
+-
+
salt2 := algo.salt2
+
+-
+
g_b := srp_B
+srp_B
and srp_id
are extracted from the account.password object.
-salt1 := algo.salt1
-salt2 := algo.salt2
-g_b := srp_B
srp_B
and srp_id
are extracted from the account.password object.
The k
parameter is generated, both on client and server:
@@ -127,14 +143,26 @@
And:
-g_a := pow(g, a) mod p
-v := pow(g, x) mod p
-s_b := pow(g_a * (pow(v, u) mod p), b) mod p
-s_b := pow((pow(g, a) mod p) * (pow(pow(g, x) mod p, u) mod p), b) mod p
-s_b := pow(pow(g, a + x * u) mod p, b) mod p
-s_b := pow(pow(g, b) mod p, a + u * x) mod p
+-
+
g_a := pow(g, a) mod p
-s_a := pow(pow(g, b) mod p, a + u * x) mod p
+-
+
v := pow(g, x) mod p
+
+-
+
s_b := pow(g_a * (pow(v, u) mod p), b) mod p
+
+-
+
s_b := pow((pow(g, a) mod p) * (pow(pow(g, x) mod p, u) mod p), b) mod p
+
+-
+
s_b := pow(pow(g, a + x * u) mod p, b) mod p
+
+-
+
s_b := pow(pow(g, b) mod p, a + u * x) mod p
+
+-
+
s_a := pow(pow(g, b) mod p, a + u * x) mod p
This means:
@@ -160,23 +188,47 @@
M1 === M2
-If the password isn't correct, 400 PASSWORD_HASH_INVALID will be returned.
-Setting a new 2FA password
-To set a new 2FA password use the account.updatePasswordSettings method.
If a password is already set, generate an InputCheckPasswordSRP object as per checking passwords with SRP, and insert it in the password
field of the account.updatePasswordSettings method.
To remove the current password, pass an empty new_password_hash
in the account.PasswordInputSettings object.
-To set a new password, use the SRP parameters and the KDF algorithm obtained using account.getPassword when generating the password
field.
Then generate a new new_password_hash
using the KDF algorithm specified in the new_settings
, just append 32 sufficiently random bytes to the salt1
, first.
Proceed as for checking passwords with SRP, just stop at the generation of the v
parameter, and use it as new_password_hash
:
+If the password isn't correct, 400 PASSWORD_HASH_INVALID will be returned.
+Setting a new 2FA password
+To set a new 2FA password use the account.updatePasswordSettings method.
+If a password is already set, generate an InputCheckPasswordSRP object as per checking passwords with SRP, and insert it in the password
field of the account.updatePasswordSettings method.
+To remove the current password, pass an empty new_password_hash
in the account.PasswordInputSettings object.
+To set a new password, use the SRP parameters and the KDF algorithm obtained using account.getPassword when generating the password
field.
+Then generate a new new_password_hash
using the KDF algorithm specified in the new_settings
, just append 32 sufficiently random bytes to the salt1
, first.
+Proceed as for checking passwords with SRP, just stop at the generation of the v
parameter, and use it as new_password_hash
:
v := pow(g, x) mod p
As usual in big endian form, padded to 2048 bits.
-Email verification
-When setting up two-factor authorization, it is recommended to set up a recovery email, to allow recovery of the password through the user's email address, in case they forget it.
-To set up a recovery email, it must first be verified.
This can be done directly when setting the new password using account.updatePasswordSettings by setting the email parameter and flag in the account.passwordInputSettings constructor.
If the email isn't verified, an EMAIL_UNCONFIRMED_X 400 error will be returned, where X is the length of the verification code that was just sent to the email.
Use account.confirmPasswordEmail to enter the received verification code and enable the recovery email.
Use account.resendPasswordEmail to resend the verification code.
Use account.cancelPasswordEmail to cancel the verification code.
+Email verification
+When setting up two-factor authorization, it is recommended to set up a recovery email, to allow recovery of the password through the user's email address, in case they forget it.
+To set up a recovery email, it must first be verified.
+This can be done directly when setting the new password using account.updatePasswordSettings by setting the email parameter and flag in the account.passwordInputSettings constructor.
+If the email isn't verified, an EMAIL_UNCONFIRMED_X 400 error will be returned, where X is the length of the verification code that was just sent to the email.
+Use account.confirmPasswordEmail to enter the received verification code and enable the recovery email.
+Use account.resendPasswordEmail to resend the verification code.
+Use account.cancelPasswordEmail to cancel the verification code.
To get the current recovery email, use account.getPasswordSettings.
-Email recovery
-In order to recover a forgotten 2FA password, an email must be sent to the previously specified address using the auth.requestPasswordRecovery method.
Then use auth.recoverPassword with the received code to delete the current 2FA password, to set a new one follow these instructions.
-Related pages
-SRP design
-
+Email recovery
+In order to recover a forgotten 2FA password, an email must be sent to the previously specified address using the auth.requestPasswordRecovery method.
+Use auth.checkRecoveryPassword to make sure that the user provided a valid code.
+Then use auth.recoverPassword with the received code to delete the current 2FA password, to set a new one follow these instructions.
+Password reset
+account.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordResult;
+account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;
+account.resetPasswordOk#e926d63e = account.ResetPasswordResult;
+
+---functions---
+
+account.resetPassword#9308ce1b = account.ResetPasswordResult;
+account.declinePasswordReset#4c9409f6 = Bool;
+If the user is already logged in and has forgotten their 2FA password, account.resetPassword can be used to initiate a password reset.
+On success, the call will initially return a account.resetPasswordRequestedWait constructor and start a 7-day server-side timer, during which the user can abort the reset process using a button sent by the Telegram service account or directly in-UI using account.declinePasswordReset.
+When the time comes, account.resetPassword is invoked once more, returning a account.resetPasswordOk to indicate that the password was successfully reset.
+If the user recently requested a password reset that was canceled, account.resetPasswordFailedWait will be returned by the initial account.resetPassword call, and they must wait until the specified date before requesting another reset.
+Note that if the user already knows their 2FA password and simply wants to disable 2FA, the same process used to enable the password must also be used to disable it ».
+Related pages
+SRP design
diff --git a/data/core.telegram.org/api/stats.html b/data/core.telegram.org/api/stats.html
index 61391864a5..a57d04f065 100644
--- a/data/core.telegram.org/api/stats.html
+++ b/data/core.telegram.org/api/stats.html
@@ -43,7 +43,7 @@
Telegram offers detailed channel statistics for channels and supergroups.
Channel statistics
-Scheme:
+Schema:
statsDateRangeDays#b637edaf min_date:int max_date:int = StatsDateRangeDays;
statsAbsValueAndPrev#cb43acde current:double previous:double = StatsAbsValueAndPrev;
@@ -80,10 +80,10 @@ Note that in this case, current
refers to the period
i
Graphs: graphs are described below ».
Supergroup statistics
-Scheme:
-statsGroupTopPoster#18f3d0f7 user_id:int messages:int avg_chars:int = StatsGroupTopPoster;
-statsGroupTopInviter#31962a4c user_id:int invitations:int = StatsGroupTopInviter;
-statsGroupTopAdmin#6014f412 user_id:int deleted:int kicked:int banned:int = StatsGroupTopAdmin;
+Schema:
+statsGroupTopPoster#9d04af9b user_id:long messages:int avg_chars:int = StatsGroupTopPoster;
+statsGroupTopInviter#535f779d user_id:long invitations:int = StatsGroupTopInviter;
+statsGroupTopAdmin#d7584c87 user_id:long deleted:int kicked:int banned:int = StatsGroupTopAdmin;
stats.megagroupStats#ef7ff916 period:StatsDateRangeDays members:StatsAbsValueAndPrev messages:StatsAbsValueAndPrev viewers:StatsAbsValueAndPrev posters:StatsAbsValueAndPrev growth_graph:StatsGraph members_graph:StatsGraph new_members_by_source_graph:StatsGraph languages_graph:StatsGraph messages_graph:StatsGraph actions_graph:StatsGraph top_hours_graph:StatsGraph weekdays_graph:StatsGraph top_posters:Vector<StatsGroupTopPoster> top_admins:Vector<StatsGroupTopAdmin> top_inviters:Vector<StatsGroupTopInviter> users:Vector<User> = stats.MegagroupStats;
diff --git a/data/core.telegram.org/api/threads.html b/data/core.telegram.org/api/threads.html
index 49791d653f..48d064e337 100644
--- a/data/core.telegram.org/api/threads.html
+++ b/data/core.telegram.org/api/threads.html
@@ -46,29 +46,29 @@
Schema:
messageReplyHeader#a6d57763 flags:# reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader;
-messageReplies#4128faac flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?int max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;
+messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;
-message#58ae39c9 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> = Message;
+message#85d6cbe2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;
---functions---
-messages.search#c352eec flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;
+messages.search#a0fda762 flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
Threads are usually automatically created when replying to any message in a group.
For example, all replies to a message with ID 420
are associated to thread with ID 420
, unique to this group; this thread ID is contained in the reply_to_top_id
field of reply_to
messageReplyHeader, along with an eventual reply_to_msg_id
, for replies to messages within a thread.
Replies to messages in a thread are part of the same thread, and do not spawn new threads.
When receiving a message from a group that is also the top of a thread (the message with ID 420
), the replies
optional field will contain a messageReplies constructor, containing the message ID and PTS of the latest reply in the thread, and the message ID of the latest read thread reply, along with the total number of replies in the thread.
Replies to a thread can also be manually fetched using messages.search, providing to top_msg_id
the thread ID.
Channel comments
-messageReplies#4128faac flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?int max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;
+messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;
The same messageReplies constructor seen above will also be contained in channel posts, this time containing information about the comment section of a specific channel post.
The comment section of a channel post is simply the message thread of the automatically forwarded channel message in the linked discussion supergroup; the ID of the linked discussion supergroup will be contained in the messageReplies.channel_id
field.
For channel posts, the recent_repliers
field will also contain information about the last few comment posters for a specific thread, to show a small list of commenter profile pictures in client previews.
@replies
-messageFwdHeader#5f777dce flags:# from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader;
+messageFwdHeader#5f777dce flags:# imported:flags.7?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader;
messageReplyHeader#a6d57763 flags:# reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader;
-message#58ae39c9 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> = Message;
+message#85d6cbe2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;
updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
updateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;
diff --git a/data/core.telegram.org/api/top-rating.html b/data/core.telegram.org/api/top-rating.html
index a4860d908e..d4d91dc503 100644
--- a/data/core.telegram.org/api/top-rating.html
+++ b/data/core.telegram.org/api/top-rating.html
@@ -60,14 +60,14 @@
---functions---
-contacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:int = contacts.TopPeers;
+contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:long = contacts.TopPeers;
The rate delta is computed by taking the time delta between the last time the user used a certain peer and the last time the rating for that peer was received and dividing it by the exponential decay from config.
Example:
Client-side, every time a user opens chat 123456789
the following operation must be done on the cached top peer info.
dateOpened
indicates when was the peer used
normalizeRate
is an arbitrary time in the recent past.
-When ratings are received from the server using contacts.getTopPeers and the scheme described above, it is the time when they were received.
+When ratings are received from the server using contacts.getTopPeers and the schema described above, it is the time when they were received.
topPeer.rating += e^((dateOpened - normalizeRate) / config.rating_e_decay)
diff --git a/data/core.telegram.org/api/updates.html b/data/core.telegram.org/api/updates.html
index 5bcca1471a..27bd9d9f06 100644
--- a/data/core.telegram.org/api/updates.html
+++ b/data/core.telegram.org/api/updates.html
@@ -54,9 +54,9 @@
As said earlier, each payload with updates has a TL-type Updates. It can be seen from the schema below that this type has several constructors.
updatesTooLong#e317af7e = Updates;
updateShort#78d4dec1 update:Update date:int = Updates;
-updateShortMessage#2296d2c8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> = Updates;
-updateShortChatMessage#402d5dbb flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> = Updates;
-updateShortSentMessage#11f1331c flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> = Updates;
+updateShortMessage#313bc7f8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
+updateShortChatMessage#4d6deea5 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:long chat_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
+updateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
updatesTooLong indicates that there are too many events pending to be pushed to the client, so one needs to fetch them manually.
@@ -64,18 +64,18 @@
The updateShortMessage, updateShortSentMessage and updateShortChatMessage constructors are redundant but help significantly reduce the transmitted message size for 90% of the updates. They should be transformed to updateShort upon receiving.
Two remaining constructors updates and updatesCombined are part of the Updates sequence. Both of them have seq
attribute, which indicates the remote Updates state after the generation of the Updates, and seq_start
indicates the remote Updates state after the first of the Updates in the packet is generated. For updates, seq_start
attribute is omitted, because it is assumed that it is always equal to seq
.
Message-related event sequences
-Each event related to a message box (message created, message edited, message deleted, etc) is identified by a unique autoincremented pts (or qts in case of secret chats).
+Each event related to a message box (message created, message edited, message deleted, etc) is identified by a unique autoincremented pts, or qts in case of secret chat updates, certain bot updates, etc.
Each message box can be considered as some server-side DB table that stores messages and events associated with them.
All boxes are completely independent, and each pts sequence is tied to just one box (see below).
Update object may contain info about multiple events (for example, updateDeleteMessages).
That's why all single updates might have pts_count parameter indicating the number of events contained in the received update (with some exceptions, in this case, the pts_count is considered to be 0
).
Each channel and supergroup has its message box and its event sequence as a result; private chats and legacy groups of one user have another common event sequence.
-User's Secret chats have yet another common secret event sequence.
+Secret chats, certain bot events and other kinds of updates have yet another common secondary event sequence.
To recap, the client has to take care of the integrity of the following sequences to properly handle updates:
- Updates sequence (seq)
- Common message box sequence (pts)
-- Secret message box sequence (qts)
+- Secondary event sequence (qts)
- Channel message box sequence 1 (pts)
- Channel message box sequence 2 (pts)
- Channel message box sequence 3 (pts)
@@ -88,7 +88,7 @@ User's Secret chats have yet another common secret event sequence.
When the user logs in for the first time, call to updates.getState has to be made to store the latest update state (which will not be the absolute initial state, just the latest state at the current time).
The common update state can also be fetched from updates.differenceTooLong.
The channel update state is represented simply by the pts of the event sequence: when first logging in, the initial channel state can be obtained from the dialog constructor when fetching dialogs, from the full channel info, or it can be received as an updateChannelTooLong update.
-The secret chat update state is represented by the qts of the secret event sequence, it is contained in the updates.State of the common update state.
+The secondary update state is represented by the qts of the secret event sequence, it is contained in the updates.State of the common update state.
The Updates sequence state is represented by the date and seq of the Updates sequence, it is contained in the updates.State of the common update state.
Update handling
Update handling in Telegram clients consists of receiving events, making sure there were no gaps and no events were missed based on the locally stored state of the correspondent event sequence, and then updating the locally stored state based on the parameters received.
@@ -114,8 +114,8 @@ Since local_pts + pts_count === pts
, the total number of events sin
Since local_pts + pts_count > pts
(133 > 132
), the update is skipped because we've already handled this update (in fact, our current local_pts
was set by this same update, and it was resent twice due to network issues or other issues).
Now let's assume an updateDeleteChannelMessages from channel 123456789
is received with pts = 140
and pts_count=5
.
Since local_pts + pts_count < pts
(137 < 140
), this means that updates were missed, and the gap must be recovered.
-Secret chats
-The whole process is very similar for secret chats, but there is qts
instead of pts
, and events are never grouped, so it's assumed that qts_count
is always equal to 1.
+Secret chats & bots
+The whole process is very similar for secret chats and certain bot updates, but there is qts
instead of pts
, and events are never grouped, so it's assumed that qts_count
is always equal to 1.
seq
: checking and applying
On top level when handling received updates and updatesCombined there are three possible cases:
If local_seq + 1 === seq_start
, the updates can be applied.
diff --git a/data/core.telegram.org/api/url-authorization.html b/data/core.telegram.org/api/url-authorization.html
index 144dd648fa..78b530b7c3 100644
--- a/data/core.telegram.org/api/url-authorization.html
+++ b/data/core.telegram.org/api/url-authorization.html
@@ -39,7 +39,10 @@
Seamless Telegram Login
- Bots may ask users to login to a certain website via Telegram when clicking on certain URL buttons in inline keyboards.
+
+
+Bots or Telegram websites may ask users to login to a certain website via Telegram when clicking on certain links or URL buttons in inline keyboards.
+Bot URL authorization
When the user clicks on keyboardButtonUrlAuth, messages.requestUrlAuth should be called, providing the button_id
of the button and the ID and peer of the container message.
The returned urlAuthResultRequest object will contain more details about the authorization request:
@@ -54,7 +57,31 @@ The returned urlAuthResultRequestIf the user agrees to login to the URL, messages.acceptUrlAuth should be called (eventually setting the write_allowed
if the permission was requested and the user consented).
The result will be a urlAuthResultAccepted with the final URL to open, which will include a query string with the requested info and a hash that must be verified upon receival by the service.
urlAuthResultDefault could also be returned, instead, in which case the url
of the keyboardButtonUrlAuth must be opened, instead.
-The same must be done if the user opens the link while refusing the authorization request.
+The same must be done if the user opens the link while refusing the authorization request.
+Link URL authorization
+Telegram supports automatic authorization on certain websites upon opening an HTTP URL in-app, upon clicking a link in a message or clicking on a keyboardButtonUrl.
+Automatic authorization
+Clients should automatically authenticate users when opening official Telegram websites, listed in the url_auth_domains
key of the client configuration object ».
+Upon clicking a link, the URL must be modified by appending the autologin_token
from the client configuration object » to the query string, like so:
+Original URL: https://somedomain.telegram.org/path?query=string#fragment=value
+Modified URL: https://somedomain.telegram.org/path?query=string&autologin_token=$autologin_token#fragment=value
+Make sure that the used autologin_token
is no more than 10000
seconds old, if it is older it must be refetched before use as described in the client configuration section ».
+Manual authorization
+Clients should show a confirmation prompt similar to the one used for bots, to authenticate users when opening certain Telegram websites, listed in the url_auth_domains
key of the client configuration object ».
+messages.requestUrlAuth should be called, providing only the original url
.
+The returned urlAuthResultRequest object will contain more details about the authorization request:
+
+- The
domain
parameter will contain the domain name of the website on which the user will log in (example: comments.app).
+- The
request_write_access
will be set if the website would like to send messages to the user.
+
+The info should be shown in a prompt.
+If the user agrees to login to the URL, messages.acceptUrlAuth should be called (eventually setting the write_allowed
if the permission was requested and the user consented).
+The result will be a urlAuthResultAccepted with the final URL to open.
+urlAuthResultDefault could also be returned, instead, in which case the original URL must be opened, instead.
+The same must be done if the user opens the link while refusing the authorization request.
+Related articles
+Client configuration
+The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.
@@ -121,8 +148,11 @@ The same must be done if the user opens the link while refusing the authorizatio
-
-
+
+
+
+ diff --git a/data/core.telegram.org/blog/chat-themes-interactive-emoji-read-receipts.html b/data/core.telegram.org/blog/chat-themes-interactive-emoji-read-receipts.html new file mode 100644 index 0000000000..a5a8e05ad7 --- /dev/null +++ b/data/core.telegram.org/blog/chat-themes-interactive-emoji-read-receipts.html @@ -0,0 +1,115 @@ + + +
+ +
+ + + + + + + + + + + + +
+