diff --git a/data/core.telegram.org/animated_stickers.html b/data/core.telegram.org/animated_stickers.html new file mode 100644 index 0000000000..dd12a33112 --- /dev/null +++ b/data/core.telegram.org/animated_stickers.html @@ -0,0 +1,138 @@ + + + + + Creating Animated Stickers + + + + + + + + + + + + + +
+ +
+
+
+
+

Creating Animated Stickers

+ +

Telegram apps support animated stickers as of version 5.9. All artists are welcome to create and upload new packs of animated stickers.

+

Required Tools

+

To create animated stickers for the Telegram platform, you will need the following:

+
    +
  1. Any vector graphics editor that allows exporting vector objects to Adobe After Effects for turning them into animations.
  2. +
  3. Adobe After Effects.
  4. +
  5. The Bodymovin-TG plugin, a fork of Bodymovin for Adobe After Effects that can be used to export animations to .TGS, the Telegram animated sticker format.
  6. +
+

Technical Requirements

+
    +
  • Sticker/canvas size must be 512х512 pixels.
  • +
  • Sticker objects must not leave the canvas.
  • +
  • Animation length must not exceed 3 seconds.
  • +
  • All animations must be looped.
  • +
  • Sticker size must not exceed 64 KB after rendering in Bodymovin.
  • +
  • All animations must run at 60 Frames Per Second.
  • +
  • You must not use the following Adobe After Effects functionality when animating your stickers: Auto-bezier keys, Expressions, Masks, Layer Effects, Images, Solids, Texts, 3D Layers, Merge Paths, Star Shapes, Gradient Strokes, Repeaters, Time Stretching, Time Remapping, Auto-Oriented Layers.
  • +
+ + +

Uploading Stickers

+

Once your stickers are ready, send the /newanimated command to the @stickers bot – then send it the .TGS files.

+

Your set will need an icon. Icons for animated sticker sets must be 100x100 pixels, with a looped animation not exceeding 3 seconds.

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/account-deletion.html b/data/core.telegram.org/api/account-deletion.html new file mode 100644 index 0000000000..aa4fd3f77a --- /dev/null +++ b/data/core.telegram.org/api/account-deletion.html @@ -0,0 +1,129 @@ + + + + + Account deletion + + + + + + + + + + + + + +
+ +
+
+
+ +

Account deletion

+ +

If the user has successfully provided the login code, but they forgot the 2FA password, the account should be reset: this can be done using account.deleteAccount.

+

If the account's 2FA password was modified more than 7 days ago and was active in the last 7 days, account deletion will be delayed for 7 days, and a service message will be sent to the user, containing a link in one of the following formats:

+
    +
  • https://telegram.me/confirmphone?phone=XXX&hash=YYYY
  • +
  • tg://confirmphone?phone=XXX&hash=YYYY
  • +
+

When clicked, account.sendConfirmPhoneCode must be called with the specified hash, using the account with the specified phone number. +This will send a phone number verification code to the phone number associated with the account. +The phone code settings are the same as for the login code, and auth.cancelCode with auth.resendCode can be used as well, to resend or cancel the phone code as for the login code.

+

Once the SMS code is received, the account.confirmPhone method will have to be called with the SMS code and the phone hash received from the account.sendConfirmPhoneCode method.

+

This will cancel deletion of the account and will log out the user that tried to reset it. +Otherwise, if the number isn't confirmed in 7 days, the account will be deleted and the user will be free to recreate it.

+

Related articles

+

User Authorization

+

How to register a user's phone to start using the API.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/animated-emojis.html b/data/core.telegram.org/api/animated-emojis.html new file mode 100644 index 0000000000..b88fa154f4 --- /dev/null +++ b/data/core.telegram.org/api/animated-emojis.html @@ -0,0 +1,148 @@ + + + + + Animated Emojis + + + + + + + + + + + + + +
+ +
+
+
+ +

Animated Emojis

+ +

Graphical telegram clients should transform emojis into their respective animated version.

+
inputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;
+
+messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
+
+---functions---
+
+messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;
+

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.

+

For special dice emojis like 🎲, 🎯, or 🏀, clients are supposed to behave differently both when sending and receiving such emojis: click here for more info ».

+

Emojis with sounds

+

Certained animated emojis should play sound when clicked, as specified by server-side configuration.

+

The returned JSON object will contain the following map, with a list of file IDs to download:

+
    "emojies_sounds": {
+        "\ud83c\udf83": {
+            "id": "4956223179606458539",
+            "access_hash": "-2107001400913062971",
+            "file_reference_base64": "AF-4ApC7ukC0UWEPZN0TeSJURe7T"
+        },
+        "\u26b0": {
+            "id": "4956223179606458540",
+            "access_hash": "-1498869544183595185",
+            "file_reference_base64": "AF-4ApCLKMGt96WCvLm58kbqZHd3"
+        },
+        "\ud83e\udddf\u200d\u2642": {
+            "id": "4960929110848176331",
+            "access_hash": "3986395821757915468",
+            "file_reference_base64": "AF-4ApAedNln3IMEHH-SUQuH8L9g"
+        },
+    }
+

The file reference field should be base64-decoded before downloading the file

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/auth.html b/data/core.telegram.org/api/auth.html new file mode 100644 index 0000000000..8069ebf828 --- /dev/null +++ b/data/core.telegram.org/api/auth.html @@ -0,0 +1,209 @@ + + + + + User Authorization + + + + + + + + + + + + + +
+ +
+
+
+ +

User Authorization

+ +
+ +

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 ».

+

Sending a verification code

+

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:

+
    +
  • Telegram code
  • +
  • SMS code
  • +
  • Phone call: a synthesized voice will tell the user which verification code to input
  • +
  • Flash phone call: the code will be sent via a flash phone call, that will be closed immediately. +In the last case, the phone code will then be the phone number itself, just make sure that the phone number matches the specified pattern (see auth.sentCodeTypeFlashCall).
  • +
+

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
typeauth.SentCodeTypePhone code type
phone_code_hashstringPhone code hash, to be stored and later re-used with auth.signIn
next_typeflags.1?auth.CodeTypePhone code type that will be sent next, if the phone code is not received within timeout seconds: to send it use auth.resendCode
timeoutflags.2?intTimeout 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.

+

Sign in/sign up

+

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.

+

2FA

+

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.

+

Test Phone Numbers

+

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 XXXXX as the login confirmation code (the DC number, repeated five 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).

+

Do not store any important or private information in the messages of such test accounts; anyone can make use of the simplified authorization mechanism – and we periodically wipe all information stored there.

+

Proceed with User Authorization flows in Production DCs only after you make sure everything works correctly on Test DCs first to avoid reaching flood limits.

+
+

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.

+
+

We are authorized

+

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.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/bots.html b/data/core.telegram.org/api/bots.html new file mode 100644 index 0000000000..f8eeef96f4 --- /dev/null +++ b/data/core.telegram.org/api/bots.html @@ -0,0 +1,142 @@ + + + + + Bots + + + + + + + + + + + + + +
+ +
+
+
+ +

Bots

+ +
+ +

Working with bots, using the MTProto API.

+

See here for more info about bots.

+

Please note that you can also use the simplified HTTP Bot API to use bots, see here for more info ».

+

Login

+
---functions---
+
+auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization;
+

In order to login as a bot, instead of using the standard login code flow, simply provide the bot token generated by @botfather.
+You must still provide your API ID, as per user logins.

+

After successful authorization, you will be able to use most MTProto API methods, just as any normal user.
+Methods that can be called by bots will have a Bots can use this method notice.

+

Commands

+

Bots offer a set of commands that can be used by users in private, or in a chat.

+

Buttons

+

Users can interact with your bot via buttons or even inline buttons, straight from inline messages in any chat.

+

Inline queries

+

Users can interact with your bot via inline queries, straight from the text input field in any chat.

+

Games

+

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.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/bots/buttons.html b/data/core.telegram.org/api/bots/buttons.html new file mode 100644 index 0000000000..fafef10e7e --- /dev/null +++ b/data/core.telegram.org/api/bots/buttons.html @@ -0,0 +1,242 @@ + + + + + Buttons + + + + + + + + + + + + + +
+ +
+
+
+ +

Buttons

+ +
+ +

Users can interact with your bot via buttons or even inline buttons, straight from inline messages in any chat.
+This article describes the full button flow, using the MTProto API.

+

For a simplified description using the HTTP bot API, see here ».

+

Buttons

+
keyboardButton#a2fa4880 text:string = KeyboardButton;
+keyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;
+keyboardButtonCallback#35bbdb6b flags:# requires_password:flags.0?true text:string data:bytes = KeyboardButton;
+keyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton;
+keyboardButtonRequestGeoLocation#fc796b3f text:string = KeyboardButton;
+keyboardButtonSwitchInline#568a748 flags:# same_peer:flags.0?true text:string query:string = KeyboardButton;
+keyboardButtonGame#50f41ccf text:string = KeyboardButton;
+keyboardButtonBuy#afd93fbb text:string = KeyboardButton;
+keyboardButtonUrlAuth#10b78d29 flags:# text:string fwd_text:flags.0?string url:string button_id:int = KeyboardButton;
+inputKeyboardButtonUrlAuth#d02e7fd4 flags:# request_write_access:flags.0?true text:string fwd_text:flags.1?string url:string bot:InputUser = KeyboardButton;
+keyboardButtonRequestPoll#bbc7515d flags:# quiz:flags.0?Bool text:string = KeyboardButton;
+
+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;
+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;
+
+---functions---
+
+messages.sendMessage#520c3870 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int = Updates;
+

Bots can attach a ReplyMarkup constructor to outgoing messages, to attach an inline keyboard or a custom reply keyboard:

+ +

Pressing buttons

+
keyboardButton#a2fa4880 text:string = KeyboardButton;
+keyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;
+keyboardButtonCallback#35bbdb6b flags:# requires_password:flags.0?true text:string data:bytes = KeyboardButton;
+keyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton;
+keyboardButtonRequestGeoLocation#fc796b3f text:string = KeyboardButton;
+keyboardButtonRequestPoll#bbc7515d flags:# quiz:flags.0?Bool text:string = KeyboardButton;
+keyboardButtonSwitchInline#568a748 flags:# same_peer:flags.0?true text:string query:string = KeyboardButton;
+keyboardButtonGame#50f41ccf text:string = KeyboardButton;
+keyboardButtonBuy#afd93fbb text:string = KeyboardButton;
+keyboardButtonUrlAuth#10b78d29 flags:# text:string fwd_text:flags.0?string url:string button_id:int = KeyboardButton;
+
+// Used by bots to send a keyboardButtonUrlAuth
+inputKeyboardButtonUrlAuth#d02e7fd4 flags:# request_write_access:flags.0?true text:string fwd_text:flags.1?string url:string bot:InputUser = KeyboardButton;
+
+keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;
+

Both reply and inline keyboards are composed of a vector of rows, each row containing a vector of buttons, for each column.
+Each row can have a different number of columns, and user clients should properly handle clicking buttons of every type.

+

Buttons available only in reply keyboards:

+ +

Buttons available only in inline keyboards:

+ +

Callback queries

+

keyboardButtonCallback buttons can be used to send the specified data payload back to the bot, when they are clicked.
+Additionally, a bot can verify a user's identity by requiring they verify their 2FA password with SRP.

+

Sending a callback query

+
keyboardButtonGame#50f41ccf text:string = KeyboardButton;
+keyboardButtonCallback#35bbdb6b flags:# requires_password:flags.0?true text:string data:bytes = KeyboardButton;
+
+messages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer;
+
+---functions---
+
+messages.getBotCallbackAnswer#9342ca07 flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes password:flags.2?InputCheckPasswordSRP = messages.BotCallbackAnswer;
+

When the user clicks on a keyboardButtonCallback in a message sent by a bot, or generated by an inline query, messages.getBotCallbackAnswer should be called, passing the peer and ID of the message.
+The same should happen when clicking on keyboardButtonGame buttons, with the difference that the game flag must be set instead of the data parameter.

+

Make sure to properly handle bot timeouts in the form of BOT_RESPONSE_TIMEOUT RPC errors, as the bot may be offline and unable to reply.

+

The returned messages.botCallbackAnswer constructor contains:

+
    +
  • message if specified, a message that should be shown in a non-blocking toast notification
  • +
  • alert indicates whether the message should be shown as a dismissable prompt, instead of a simple toast notification
  • +
  • has_url Whether an URL is present
  • +
  • url if specified, the client should open the URL, without showing a confirmation prompt.
    This is safe and allowed, because here, bots can only return:
      +
    • URLs to themselves with added query parameters (t.me/bot?start=aaa)
    • +
    • URLs to a valid game, if the bot has manually configured games, and the clicked button was a keyboardButtonGame.
    • +
    +
  • +
  • native_ui whether to open game URLs in a WebView or in native UI.
  • +
  • cache_time specifies for how long should this answer be cached, client-side
  • +
+
SRP verification
+

If the requires_password flag is set, the SRP 2FA payload must also be generated and attached to the query, to verify the identity of the user.

+

Note that the bot will NOT be able to access your password or the SRP payload.

+

The SRP payload will be processed exclusively on the Telegram's servers, simply returning an RPC error without passing the query to the bot if the verification fails.
+This is just a way of verifying the identity of the user, mainly used by the official @botfather bot to allow securely transferring the ownership of a bot to another user.

+

Answering a callback query

+
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;
+
+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;
+
+---functions---
+
+messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long message:flags.0?string url:flags.2?string cache_time:int = Bool;
+

After the user invokes messages.getBotCallbackAnswer, an updateBotCallbackQuery or updateInlineBotCallbackQuery is generated and sent to the bot, depending on whether the query originated from a normal message sent by the bot, or from a message sent from an inline query.

+

Either way, bots must reply to the query as quickly as possible using messages.setBotCallbackAnswer:

+ +

If a game_short_name is present in the update, the bot should return the URL of the game with the specified name.
+The messages.setBotCallbackAnswer method must be called anyway, even if no message or url is returned, to avoid timeouts on the client.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/bots/commands.html b/data/core.telegram.org/api/bots/commands.html new file mode 100644 index 0000000000..145dcf980f --- /dev/null +++ b/data/core.telegram.org/api/bots/commands.html @@ -0,0 +1,140 @@ + + + + + Commands + + + + + + + + + + + + + +
+ +
+
+
+ +

Commands

+ +
+ +

Bots offer a set of commands that can be used by users in private, or in a chat.

+

For a simplified description using the HTTP bot API, see here ».

+

Getting commands

+
botCommand#c27ac8c7 command:string description:string = BotCommand;
+
+botInfo#98e81d3a user_id:int 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;
+
+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;
+

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.

+

Setting commands

+
botCommand#c27ac8c7 command:string description:string = BotCommand;
+
+---functions---
+
+bots.setBotCommands#805d46f6 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 new file mode 100644 index 0000000000..e2414edf79 --- /dev/null +++ b/data/core.telegram.org/api/bots/games.html @@ -0,0 +1,171 @@ + + + + + Games + + + + + + + + + + + + + +
+ +
+
+
+ +

Games

+ +
+ +

Bots can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats.

+

Sending a game

+
inputUserSelf#f7c1b13f = InputUser;
+
+inputGameID#32c3e77 id:long access_hash:long = InputGame;
+inputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame;
+
+inputMediaGame#d33f43f3 id:InputGame = InputMedia;
+
+game#bdf9653b flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document = Game;
+messageMediaGame#fdb19008 game:Game = MessageMedia;
+
+---functions---
+
+messages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int = Updates;
+

Bots can directly send a game using messages.sendMedia, providing:

+
    +
  • The bot's shortname obtained from @BotFather to inputGameShortName.short_name
  • +
  • The current bot's info to inputGameShortName.bot_id
  • +
+

The sent message will contain a messageMediaGame with a game, that can then be used by users to forward the game using sendMedia with inputGameID.

+

Starting a game

+

Games are started clicking on the button, which triggers an callback query that returns the game URL, for more info see here &raquo.
+The game should then be opened in a WebView or in native UI (specified by the native_ui flag), exposing the appropriate HTML5 APIs in order to receive various JS game events directly from the code of the game, as described here ».

+

Setting highscores

+
---functions---
+
+messages.setGameScore#8ef8ecc0 flags:# edit_message:flags.0?true force:flags.1?true peer:InputPeer id:int user_id:InputUser score:int = Updates;
+messages.setInlineGameScore#15ad9f64 flags:# edit_message:flags.0?true force:flags.1?true id:InputBotInlineMessageID user_id:InputUser score:int = Bool;
+

Games are supposed to report back to the MTProto API every time the user looses a game with a new highscore.
+Since games run in the browser, they cannot directly report data to the API using the bot token, which must be kept secret.
+Instead, they should send highscores to an intermediate server, that will then report scores using messages.setGameScore or messages.setInlineGameScore, depending on the source of the game.

+
    +
  • The edit_message flag should be set if the game message should be automatically edited to include the current scoreboard
  • +
  • The force flag should be set if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters.
  • +
+

Getting highscores

+
messageActionGameScore#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;
+
+highScore#58fffcd0 pos:int user_id:int score:int = HighScore;
+
+messages.highScores#9a3bfd99 scores:Vector<HighScore> users:Vector<User> = messages.HighScores;
+
+---functions---
+
+messages.getGameHighScores#e822649d peer:InputPeer id:int user_id:InputUser = messages.HighScores;
+messages.getInlineGameHighScores#f635e1b id:InputBotInlineMessageID user_id:InputUser = messages.HighScores;
+

Every time a highscore is reached, and the edit_message flag is set when reporting the score, a messageService with a messageActionGameScore is generated, indicating that the highscore of a certain game has changed, thanks to a certain user_id.
+Our own current position of the scoreboard is also reported as pos.

+

When receiving such an update, graphical clients should refetch the scoreboard using messages.getGameHighScores or messages.getInlineGameHighScores.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/bots/inline.html b/data/core.telegram.org/api/bots/inline.html new file mode 100644 index 0000000000..a62626c9c4 --- /dev/null +++ b/data/core.telegram.org/api/bots/inline.html @@ -0,0 +1,215 @@ + + + + + Inline + + + + + + + + + + + + + +
+ +
+
+
+
+

Inline

+ +
+ +

Users can interact with your bot via inline queries, straight from the text input field in any chat.
+This article describes the full inline bot flow, using the MTProto API.

+

For a simplified description using the HTTP bot API, see here ».

+

Making an inline query

+
messages.botResults#947ca848 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string switch_pm:flags.2?InlineBotSwitchPM results:Vector<BotInlineResult> cache_time:int users:Vector<User> = messages.BotResults;
+
+---functions---
+
+messages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults;
+

When, in a graphical client, the user starts a message with an @, clients should:

+
    +
  • Use the cached top peer rating for inline bots to show a list of frequently used inline bots.
  • +
  • If the user chooses a bot from the recent bot list or:
  • +
  • Finishes typing a full username followed by a whitespace, and if the username resolves to a valid bot
  • +
  • messages.getInlineBotResults is called, with the following parameters:
      +
    • bot - The bot peer
    • +
    • peer - The chat where the user made the query
    • +
    • geo_point - The user's current geolocation, if the bot requires location-based inline results (the bot_inline_geo flag of the bot's user constructor will be set)
    • +
    • query - What the user typed after the bot's username
    • +
    • offset - If the user scrolls past the first len(results) results, and next_offset field is set, the inline query should be repeated with this offset.
    • +
    +
  • +
+

Answering to an inline query

+
inputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
+inputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
+inputBotInlineMessageMediaGeo#96929a85 flags:# geo_point:InputGeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
+inputBotInlineMessageMediaVenue#417bbf11 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
+inputBotInlineMessageMediaContact#a6edbffd flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
+inputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
+
+inputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;
+inputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;
+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;
+
+---functions---
+
+messages.setInlineBotResults#eb5ea206 flags:# gallery:flags.0?true private:flags.1?true query_id:long results:Vector<InputBotInlineResult> cache_time:int next_offset:flags.2?string switch_pm:flags.3?InlineBotSwitchPM = Bool;
+

Bots can answer to incoming updateBotInlineQuery updates using messages.setInlineBotResults.
+Just like its bot API counterpart, the method can be used to send a set of inline results to the user; see the constructor page for more info on the MTProto method parameters ».

+

In general, the method accepts a vector of InputBotInlineResult constructors, that when chosen, generates a message with optionally attached media, and even inline buttons.

+

Sending the inline query result

+
botInlineMessageMediaAuto#764cf810 flags:# message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
+botInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
+botInlineMessageMediaGeo#51846fd flags:# geo:GeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
+botInlineMessageMediaVenue#8a86659c flags:# geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
+botInlineMessageMediaContact#18d1cdc2 flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
+
+botInlineResult#11965f3a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?WebDocument content:flags.5?WebDocument send_message:BotInlineMessage = BotInlineResult;
+botInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult;
+
+messages.botResults#947ca848 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string switch_pm:flags.2?InlineBotSwitchPM results:Vector<BotInlineResult> cache_time:int users:Vector<User> = messages.BotResults;
+
+---functions---
+
+messages.sendInlineBotResult#220815b0 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string schedule_date:flags.10?int = Updates;
+

The user client should display the results obtained during querying in a list, making sure to handle eventual bot timeouts in the form of a BOT_RESPONSE_TIMEOUT RPC error, by simply not displaying anything.

+

If the user then chooses a specific BotInlineResult, the messages.sendInlineBotResult method should be invoked, passing:

+
    +
  • The query_id from messages.botResults
  • +
  • The id of the chosen result
  • +
  • The peer where to send the chosen result
  • +
+

The resulting message will have the via_bot_id field set, to indicate that the result was generated by the bot that generated the inline result.
+Graphical clients should display the bot @username in the header of the message, allowing the user to click on it, automatically starting an inline query by inserting @username in the text bar.

+

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;
+

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.

+

Either way, feedback collection should only be used for statistical purposes rather than functional.

+

The updateBotInlineSend will contain:

+
    +
  • id - The ID of the chosen result
  • +
  • msg_id - The ID of the sent inline message
  • +
  • user_id - The ID of the user that chose the result
  • +
  • query - The query string that was used to obtain the result
  • +
  • geo - For bots requiring location-based inline results, the user's location
  • +
+

Editing sent inline messages

+
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;
+
+inputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;
+
+---functions---
+
+messages.editInlineBotMessage#83557dba flags:# no_webpage:flags.1?true id:InputBotInlineMessageID message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Bool;
+

Sent inline messages can be edited by the bot, for example in response to a button press callback query.

+

Simply pass the inputBotInlineMessageID specified in the updateInlineBotCallbackQuery to messages.editInlineBotMessage along with the new message, making sure to send the query to the datacenter specified in inputBotInlineMessageID.dc_id.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/channel.html b/data/core.telegram.org/api/channel.html new file mode 100644 index 0000000000..ce16d9c590 --- /dev/null +++ b/data/core.telegram.org/api/channel.html @@ -0,0 +1,150 @@ + + + + + Channels + + + + + + + + + + + + + +
+ +
+
+
+ +

Channels

+ +
+ +

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.

+

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. +The chats field of the result will have two objects:

+
    +
  • A chat constructor with a migrated_to field, indicating the address of the new supergroup
  • +
  • The new channel megagroup constructor
  • +
+

When getting full info about the migrated channel, the channelFull object will have migrated_from_chat_id and migrated_from_max_id fields indicating the original ID of the chat, and the message ID in the original chat at which the group was migrated.

+

All users of the chat will receive an updateNewMessage from the old chat with a messageService containing a messageActionChatMigrateTo constructor.

+

All new messages have to be sent to the new supergroup.

+

When working with migrated groups clients need to handle loading of the message history (as well as search results et cetera) from both the legacy group and the new supergroup. This is done by merging the two messages lists (requested with different Peer values) client side.

+

Rights

+

Channels, legacy groups and supergroups allow setting granular permissions both for admins and specific users; channels, supergroups and legacy groups also allow setting global granular permissions for users.

+

For more info on how to set and modify rights, see here ».

+

Pinned messages

+

Telegram allows pinning multiple messages on top in a chat, group, supergroup or channel.

+

See here » for more info on pinning and unpinning messages.

+

Discussion

+

Groups can be associated to a channel as a discussion group, to allow users to discuss about posts.

+

For more info on how to set a discussion group in channel, see here »

+

Recent actions

+

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.

+

See here » for more info.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/config.html b/data/core.telegram.org/api/config.html new file mode 100644 index 0000000000..cf24734f2e --- /dev/null +++ b/data/core.telegram.org/api/config.html @@ -0,0 +1,320 @@ + + + + + Client configuration + + + + + + + + + + + + + +
+ +
+
+
+ +

Client configuration

+ +
+ +

The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.

+

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;
+
+---functions---
+
+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

+
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.
+While help.getConfig returns MTProto-specific configuration with information about server-side limitations and other MTProto-related information, help.getAppConfig returns configuration parameters useful for graphical Telegram clients.

+

Typical fields included in the resulting JSON object are:

+
    +
  • emojies_animated_zoom - Animated emojis and animated dice should be scaled by this factor before being shown to the user (float)
  • +
  • keep_alive_service - Whether app clients should start a keepalive service to keep the app running and fetch updates even when the app is closed (boolean)
  • +
  • background_connection - Whether app clients should start a background TCP connection for MTProto update fetching (boolean)
  • +
  • emojies_send_dice - A list of supported animated dice stickers (array of strings).
  • +
  • emojies_send_dice_success - For animated dice emojis other than the basic 🎲, indicates the winning dice value and the final frame of the animated sticker, at which to show the fireworks 🎆 (object with emoji keys and object values, containing value and frame_start float values)
  • +
  • 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)
  • +
  • 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)
  • +
+

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"
+    ],
+    "emojies_send_dice_success": {
+        "\ud83c\udfaf": {
+            "value": 6,
+            "frame_start": 62
+        },
+        "\ud83c\udfc0": {
+            "value": 5,
+            "frame_start": 110
+        },
+        "\u26bd": {
+            "value": 5,
+            "frame_start": 110
+        },
+        "\u26bd\ufe0f": {
+            "value": 5,
+            "frame_start": 110
+        },
+        "\ud83c\udfb0": {
+            "value": 64,
+            "frame_start": 110
+        }
+    },
+    "emojies_sounds": {
+        "\ud83c\udf83": {
+            "id": "4956223179606458539",
+            "access_hash": "-2107001400913062971",
+            "file_reference_base64": "AF-4ApC7ukC0UWEPZN0TeSJURe7T"
+        },
+        "\u26b0": {
+            "id": "4956223179606458540",
+            "access_hash": "-1498869544183595185",
+            "file_reference_base64": "AF-4ApCLKMGt96WCvLm58kbqZHd3"
+        },
+        "\ud83e\udddf\u200d\u2642": {
+            "id": "4960929110848176331",
+            "access_hash": "3986395821757915468",
+            "file_reference_base64": "AF-4ApAedNln3IMEHH-SUQuH8L9g"
+        },
+        "\ud83e\udddf": {
+            "id": "4960929110848176332",
+            "access_hash": "-8929417974289765626",
+            "file_reference_base64": "AF-4ApArGURtGa2KVC-Yovh1kQoW"
+        },
+        "\ud83e\udddf\u200d\u2640": {
+            "id": "4960929110848176333",
+            "access_hash": "9161696144162881753",
+            "file_reference_base64": "AF-4ApD-eOqXvTBmcszAEkzQN615"
+        },
+        "\ud83c\udf51": {
+            "id": "4963180910661861548",
+            "access_hash": "-7431729439735063448",
+            "file_reference_base64": "AF-4ApBimvRxhcXg-iQ5Gw4Eelit"
+        },
+        "\u2764": {
+            "id": "4978826754966683841",
+            "access_hash": "3926211553285686901",
+            "file_reference_base64": "AF-4ApDBkyjgN2Tk9zJvXPhfJXPA"
+        }
+    },
+    "gif_search_branding": "tenor",
+    "gif_search_emojies": [
+        "\ud83d\udc4d",
+        "\ud83d\ude18",
+        "\ud83d\ude0d",
+        "\ud83d\ude21",
+        "\ud83e\udd73",
+        "\ud83d\ude02",
+        "\ud83d\ude2e",
+        "\ud83d\ude44",
+        "\ud83d\ude0e",
+        "\ud83d\udc4e"
+    ],
+    "qr_login_camera": true,
+    "qr_login_code": "secondary",
+    "dialog_filters_enabled": true,
+    "dialog_filters_tooltip": false
+}
+

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;
+help.noAppUpdate#c45a6536 = help.AppUpdate;
+
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+updateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector<MessageEntity> = Update;
+
+help.inviteText#18cb9f78 message:string = help.InviteText;
+
+---functions---
+
+help.getAppUpdate#522d5a7d source:string = help.AppUpdate;
+help.getAppChangelog#9010ef6f prev_app_version:string = Updates;
+
+help.getInviteText#4d392343 = help.InviteText;
+
    +
  • help.getAppUpdate - Get info about an application update, can contain the updated application binary in the attached document
  • +
  • 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

+
help.termsOfServiceUpdateEmpty#e3309f7f expires:int = help.TermsOfServiceUpdate;
+help.termsOfServiceUpdate#28ecf961 expires:int terms_of_service:help.TermsOfService = help.TermsOfServiceUpdate;
+
+help.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector<MessageEntity> min_age_confirm:flags.1?int = help.TermsOfService;
+
+auth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;
+
+---functions---
+
+help.getTermsOfServiceUpdate#2ca51fd1 = help.TermsOfServiceUpdate;
+help.acceptTermsOfService#ee72f79a id:DataJSON = Bool;
+
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
+
+account.deleteAccount#418d4e0b reason:string = Bool;
+

These methods can be used for managing consent to Telegram's Terms Of Service.

+

Typically, before a user signs up by invoking auth.signUp, apps should show a pop-up (if the popup flag of the help.termsOfService method is set), asking the user to accept Telegram's terms of service; in case of denial, the user is to be returned to the initial page of the login flow.

+

When signing up for the first time, the help.termsOfService is to be obtained from the auth.authorizationSignUpRequired constructor returned by the auth.signIn.

+

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;
+
+help.support#17c6b5f6 phone_number:string user:User = help.Support;
+help.supportName#8c05f1c9 name:string = help.SupportName;
+
+---functions---
+
+help.getSupport#9cdf08cd = help.Support;
+help.getSupportName#d360e72c = help.SupportName;
+

These methods can be used for fetching info about Telegram's support user, that users can use to get support and ask questions about the app.

+ +

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;
+
+help.countriesListNotModified#93cc1f32 = help.CountriesList;
+help.countriesList#87d0759e countries:Vector<help.Country> hash:int = help.CountriesList;
+
+---functions---
+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.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/datacenter.html b/data/core.telegram.org/api/datacenter.html new file mode 100644 index 0000000000..11cfe243a0 --- /dev/null +++ b/data/core.telegram.org/api/datacenter.html @@ -0,0 +1,151 @@ + + + + + Working with Different Data Centers + + + + + + + + + + + + + +
+ +
+
+
+ +

Working with Different Data Centers

+ +

The servers are divided into several data centers (hereinafter “DCs”) in different parts of the world. +A complete list of proxy access points for these DCs may be obtained using help.getConfig:

+
dcOption#18b7a10d flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true id:int ip_address:string port:int secret:flags.10?bytes = DcOption;
+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.

+

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.

+

The client does not yet know which DC it will be associated with; therefore, it establishes an encrypted connection to a random address and sends its query to that address. +Having received a phone_number from a client, we can find out whether or not it is registered in the system. If it is, then, if necessary, instead of sending a text message, we request that it establish a connection with a different DC first (PHONE_MIGRATE_X error). +If we do not yet have a user with this number, we examine its IP-address. We can use it to identify the closest DC. Again, if necessary, we redirect the user to a different DC (NETWORK_MIGRATE_X error).

+

Testing Redirects

+

There are reserved phone number prefixes to test the correctness of the application’s handling of redirects between DCs. Read more in User Authorization article.

+

File Access

+

A file saved by a user with upload.saveFilePart will be available for direct download only from the DC where the query was executed. That is why each file has a dc_id parameter:

+
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;
+
+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;
+

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.

+

User Migration

+

During 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.

+

Authorization Transfer

+

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.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization;
+---functions---
+auth.importAuthorization#e3ef9613 id:int 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/dice.html b/data/core.telegram.org/api/dice.html new file mode 100644 index 0000000000..e42cf38a73 --- /dev/null +++ b/data/core.telegram.org/api/dice.html @@ -0,0 +1,149 @@ + + + + + Dice + + + + + + + + + + + + + +
+ +
+
+
+ +

Dice

+ +

Telegram supports sending animated dice emojis.
+This is implemented by using the dice constructors:

+
inputMediaDice#e66fbf7b emoticon:string = InputMedia;
+messageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia;
+
+inputStickerSetDice#e67f520e emoticon:string = InputStickerSet;
+
+messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
+
+---functions---
+
+messages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int = Updates;
+
+messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;
+
+help.getAppConfig#98914110 = JSONValue;
+

On startup, clients should fetch app configuration using help.getAppConfig.
+Then, for each dice emoji contained in the emojies_send_dice field, clients should fetch the dice emoji stickerset by calling the messages.getStickerSet method, providing the properly populated inputStickerSetDice to the stickerset field.
+The returned stickerset will contain a set of animated stickers, one for each of the dice outcomes, plus a first looping sticker that should be shown as preview to the user before actually sending the dice.

+

If a user attempts to send a single emoji from the ones specified in emojies_send_dice, the dice should be sent using messages.sendMedia, providing the dice emoji to the emoticon field.

+

Incoming dice stickers will be received as a messageMediaDice constructor, along with a randomly generated server-side value, ranging from 1 to the maximum allowed value for this type of dice.
+Clients should display the correct dice animated sticker for the specified value: since dice values start from 1, and the first animated sticker in dice stickerset is the preview, value can be used to directly index the documents sticker array from the animated stickerset.

+

The emojies_send_dice_success configuration parameter contains more info about dice emojis other than the basic 🎲:

+
    "emojies_send_dice_success": {
+        "\ud83c\udfaf": {
+            "value": 6,
+            "frame_start": 62
+        },
+        "\ud83c\udfc0": {
+            "value": 5,
+            "frame_start": 110
+        }
+    }
+

For each of the dice emojis, a maximum "winning" value is specified, along with the frame number at which to show the fireworks 🎆.
+Please note that dice animated stickers should loop only once, right after being sent/received for the first time; clicking on the dice sticker should bring up a popup, inviting the user to send a new dice of the same type.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/discussion.html b/data/core.telegram.org/api/discussion.html new file mode 100644 index 0000000000..f03d904938 --- /dev/null +++ b/data/core.telegram.org/api/discussion.html @@ -0,0 +1,151 @@ + + + + + Discussion groups + + + + + + + + + + + + + +
+ +
+
+
+ +

Discussion groups

+ +
+ +

Groups can be associated to a channel as a discussion group, to allow users to discuss about posts.

+
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;
+
+messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
+
+---functions---
+
+channels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool;
+channels.getGroupsForDiscussion#f5dad378 = messages.Chats;
+

A discussion group can be associated to a channel using channels.setDiscussionGroup.
+The discussion group can be accessed in the client by clicking on the discuss button of the channel, or by accessing the comment section of a specific post; the discussion group ID is also present in the linked_chat_id field of the channelFull constructor.

+

All messages sent to the channel will also be sent to the linked group (with sender peer from_id equal to the peer of the linked channel); those messages will also be automatically pinned in the group.

+

Linking a discussion group

+

To obtain a list of admined supergroups that a channel admin can possibly associate to a channel, use channels.getGroupsForDiscussion.
+Returned legacy group chats must be first upgraded to supergroups before they can be set as a discussion group.
+Before linking a supergroup to a channel, access to the supergroup's old messages must also be enabled using channels.togglePreHistoryHidden.

+

To set a returned supergroup as a discussion group use channels.setDiscussionGroup.

+

Schema:

+
boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
+
+---functions---
+
+channels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool;
+channels.getGroupsForDiscussion#f5dad378 = messages.Chats;
+
+channels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates;
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/drafts.html b/data/core.telegram.org/api/drafts.html new file mode 100644 index 0000000000..73a71a1d98 --- /dev/null +++ b/data/core.telegram.org/api/drafts.html @@ -0,0 +1,131 @@ + + + + + Message drafts + + + + + + + + + + + + + +
+ +
+
+
+ +

Message drafts

+ +
+ +

Message drafts in Telegram allow syncing the text typed into message fields between devices.

+

Drafts

+

Drafts are represented by the DraftMessage constructors. +The parameters of the peer-specific draft should be used as defaults when composing a message to be sent to a certain peer (in the case of media, the same draft should still be used as base, the message will become the caption). +If the user exits the app before sending the message, the message should be saved as a draft:

+

Saving drafts

+

Drafts can be saved using the messages.saveDraft method.

+

Downloading drafts

+

New drafts are automatically sent to all devices via updateDraftMessage updates.

+

Dialog objects fetched via the API also contain the draft associated with the dialog.

+

Clearing drafts

+

Drafts can be cleared by setting the clear_draft flag when sending messages or media using messages.sendMessage, messages.sendMedia, messages.sendMultiMedia, messages.sendInlineBotResult and similar or manually by passing empty values to messages.saveDraft.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/end-to-end.html b/data/core.telegram.org/api/end-to-end.html new file mode 100644 index 0000000000..83b41bbc72 --- /dev/null +++ b/data/core.telegram.org/api/end-to-end.html @@ -0,0 +1,244 @@ + + + + + End-to-End Encryption, Secret Chats + + + + + + + + + + + + + +
+ +
+
+
+ +

End-to-End Encryption, Secret Chats

+ +
+ +
+

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
+

+
+

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:

+
    +
  • SHA-256 is used instead of SHA-1;
  • +
  • Padding bytes are involved in the computation of msg_key;
  • +
  • msg_key depends not only on the message to be encrypted, but on a portion of the secret chat key as well;
  • +
  • 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

+

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

+

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 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 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, for example, by generating a client random number of the same length (client_random) and using final_random := random XOR client_random.

+

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

+

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).

+

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

+

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

+

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 »

+
+

The resulting construct is serialized as an array of bytes using generic TL rules. The resulting array is prepended by 4 bytes containing the array length not counting these 4 bytes.

+

The byte array is padded with 12 to 1024 random padding bytes to make its length divisible by 16 bytes. (In the older MTProto 1.0 encryption, only 0 to 15 padding bytes were used.)

+

Message key, msg_key, is computed as the 128 middle bits of the SHA256 of the data obtained in the previous step, prepended by 32 bytes from the shared key key. (For the older MTProto 1.0 encryption, msg_key was computed differently, as the 128 lower bits of SHA1 of the data obtained in the previous steps, excluding the padding bytes.)

+

For MTProto 2.0, the AES key aes_key and initialization vector aes_iv are computed ( key is the shared key obtained during Key Generation ) as follows:

+
    +
  • msg_key_large = SHA256 (substr (key, 88+x, 32) + plaintext + random_padding);
  • +
  • msg_key = substr (msg_key_large, 8, 16);
  • +
  • sha256_a = SHA256 (msg_key + substr (key, x, 36));
  • +
  • sha256_b = SHA256 (substr (key, 40+x, 36) + msg_key);
  • +
  • aes_key = substr (sha256_a, 0, 8) + substr (sha256_b, 8, 16) + substr (sha256_a, 24, 8);
  • +
  • aes_iv = substr (sha256_b, 0, 8) + substr (sha256_a, 8, 16) + substr (sha256_b, 24, 8);
  • +
+

For MTProto 2.0, x=0 for messages from the originator of the secret chat, x=8 for the messages in the opposite direction.

+

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

+

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

+

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

+

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:

+
    +
  • 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.

+

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.

+

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

+

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

+

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:

+
    +
  1. As soon as a new secret chat has been created, immediately after the secret key has been successfully exchanged.
  2. +
  3. 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).
  4. +
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/end-to-end/pfs.html b/data/core.telegram.org/api/end-to-end/pfs.html new file mode 100644 index 0000000000..38f16820ab --- /dev/null +++ b/data/core.telegram.org/api/end-to-end/pfs.html @@ -0,0 +1,176 @@ + + + + + Perfect Forward Secrecy + + + + + + + + + + + + + +
+ +
+
+
+ +

Perfect Forward Secrecy

+ +
+

Telegram supports Perfect Forward Secrecy (PFS) in Secret Chats as of Layer 20. See updating to new layers.

+
+

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.

+

Any client participating in a Secret Chat can initiate re-keying as soon as it perceives that the current key has been used for too long or for encrypting too many messages. Please note that you should never initiate a new instance of the re-keying protocol if an uncompleted instance exists, initiated by either party.

+

Note: third-party developers are required to maintain the same level of security. All clients with secret chat support must be able to initiate re-keying and accept relevant service messages. See Security Guidelines.

+

Re-keying protocol

+

New keys are generated by exchanging special messages, using previously established keys for encryption. The re-keying protocol between parties A and B normally consists of four steps:

+
1. decryptedMessageActionRequestKey
+

A (re-keying initiator) generates a new value of a, subject to the same limitations as for the initial Diffie-Hellman key exchange, and sends the value of pow(g,a) to B, embedded in a decryptedMessageService:

+
decryptedMessageActionRequestKey exchange_id:long g_a:string = DecryptedMessageAction;
+
    +
  • exchange_id is a random number identifying this instance of the Re-Keying Protocol for both parties
  • +
  • g_a is the value of pow(g,a) mod p
  • +
+

Note that the same Diffie--Hellman parameters (p,g) as for the initial Diffie--Hellman key exchange in this secret chat are used. They do not need to be re-transmitted explicitly.

+
2. decryptedMessageActionAcceptKey
+

Upon receipt of the above service message, B checks its content, and generates a response with same exchange_id, for a newly generated value of b:

+
decryptedMessageActionAcceptKey exchange_id:long g_b:string key_fingerprint:long = DecryptedMessageAction;
+
    +
  • exchange_id is the same as in the received decryptedMessageActionRequestKey
  • +
  • g_b is the value of pow(g,b) mod p
  • +
  • key_fingerprint is the 64-bit fingerprint of the newly generated key = pow(g_a, b) mod p, used as a sanity check of the implementation
  • +
+

At this stage, B can already compute the new key key = pow(g_a, b) mod p and its key_fingerprint (last 64 bits of its SHA-1). However, it continues using the previous key until the completion of the exchange.

+

Once side B sends decryptedMessageActionAcceptKey, it cannot abort the key exchange; it must be ready to switch to the new key immediately after a decryptedMessageActionCommitKey is received. Therefore, if side B wishes to delay the usage of new key, for example in order to fill some seq_no gaps first, it must delay the decryptedMessageActionAcceptKey answer accordingly.

+
3. decryptedMessageActionCommitKey
+

Once A receives a valid decryptedMessageActionAcceptKey, it performs all necessary checks, and "commits" the new key by means of the following service message:

+
decryptedMessageActionCommitKey exchange_id:long key_fingerprint:long = DecryptedMessageAction;
+
    +
  • exchange_id is the same as in the two previous messages
  • +
  • key_fingerprint is the value of the hash (last 64 bits of SHA-1) of the new key computed by A, for implementation sanity check
  • +
+

After that, A can (and must) encrypt all following messages with the new key.

+

If side A wishes to delay installation of the new key, for example because there are some seq_no gaps that it wants to fill first, it must delay decryptedMessageActionCommitKey answer accordingly.

+
4. Final step
+

When B receives either a decryptedMessageActionCommitKey or a message encrypted by the new key, recognized by the value of key_fingerprint prepended to the encrypted message (it may happen that the decryptedMessageActionCommitKey has been lost and will be re-requested later), it assumes that A has started using the new key for encryption, and does the same.

+

However, the previous key may be kept until there are no gaps in received messages up to the switch to the new key. Once all the gaps have been filled, the old key must be securely discarded.

+

There is one exception to this rule — the SHA-1 of the original key (generated during the establishment of Secret Chat in question) is always stored, in order to show key visualizations on the clients.

+

Aborting protocol

+

Any of the parties may abort any instance of an uncompleted re-keying protocol, unless decryptedMessageActionCommitKey or decryptedMessageActionAcceptKey has been already sent by the party in question. In order to abort re-keying, send

+
decryptedMessageActionAbortKey exchange_id:long = DecryptedMessageAction;
+

This could be done, for example, if the party is already participating in a different instance of the re-keying protocol, or if the received values of g_a, g_b and other parameters do not pass security checks. In the latter case, it might be advisable to abort the Secret Chat altogether.

+

Discarding Previous Keys

+

Once B receives decryptedMessageActionCommitKey, it can safely discard the previous key provided there are no gaps. However, A may only discard the previous key after a message encrypted with the new key has been received. If no ordinary messages are scheduled to be sent, a special no-op message should sent by B for this purpose:

+
decryptedMessageActionNoop = DecryptedMessageAction;
+

Concurrent Re-Keying

+

It may happen that both parties concurrently initiate re-keying by sending decryptedMessageActionRequestKey without knowing that the other party has already done so. If each side aborts re-keying because it is already participating in another instance of the protocol initiated by itself, the re-keying will never happen.

+

Because of this possibility, we suggest that only the instance with the smaller exchange_id is aborted, with the option to re-use its (a,g_a) for the re-keying protocol instance with the larger exchange_id (when compared as a long, i.e. signed little-endian 64-bit integer).

+

In other words, if a decryptedMessageActionRequestKey is received after A has sent its decryptedMessageActionRequestKey, but has not yet received decryptedMessageActionAcceptKey, the following is to be done:

+
    +
  • if exchange_id in the sent decryptedMessageActionRequestKey was larger than that in the decryptionActionRequestKey just received, abort the newly-suggested re-keying protocol instance without sending explicit decryptedMessageActionAbortKey (the other side will do the same according to the next rule).
  • +
  • if exchange_id in our decryptedMessageActionRequestKey was smaller, respond to the newly-received decryptedMessageActionRequestKey with a decryptedMessageActionAcceptKey, and participate only in the re-keying protocol instance initiated by the other side. It is possible to re-use at this stage the value of g_a (now called g_b) that was generated for the original decryptedMessageActionRequestKey, now abandoned, or totally new (b,g_b) can be generated.
  • +
  • in the unlikely (2^{-64}) case both exchange_id are equal, abort both instances without sending an explicit decryptedMessageActionAbortKey. The other side will do the same.
  • +
+
Key Visualization
+

Since all re-keying instances are carried over the secure channel established when the secret chat is created, it is necessary for the user to confirm that no MITM attack had taken place during the initial exchange. The key visualization on the clients uses the first 128-bits of the SHA-1 of the original key created when the Secret Chat was first established, followed by the first 160 bits of the SHA-256 of the key in use when the secret chat was updated to layer 46 (coincides with the original key if chat was created using layer 46).

+
+

Please note that the key_fingerprint parameter was introduced as a maintenance tool (with a misleading name) and is not related to key visualization on the clients.

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/end-to-end/seq_no.html b/data/core.telegram.org/api/end-to-end/seq_no.html new file mode 100644 index 0000000000..2aa9c6ea1a --- /dev/null +++ b/data/core.telegram.org/api/end-to-end/seq_no.html @@ -0,0 +1,173 @@ + + + + + Sequence numbers in Secret Chats + + + + + + + + + + + + + +
+ +
+
+
+ +

Sequence numbers in Secret Chats

+ +

It is necessary to interpret all messages in their original order to protect against reordering, reflection, replay, omission and other manipulations (decryptedMessageActionResend messages are the only exception to this rule, see avoiding concurrent gaps). Secret chats support a special mechanism for handling seq_no counters independently from the server. Note that any service messages in secret chats must also increment the seq_no.

+

All Secret Chats messages in clients using Layer 17 or higher are wrapped in decryptedMessageLayer and have seq_no (sequence number) counters attached to them. The seq_no counters in their raw form are initialized with (out_seq_no, in_seq_no) := (0,0), and incremented strictly by 1 after any message (service or not) is sent/received and processed. They must be protected from mirroring before being sent to the remote client by transformation according to formula 2*raw_seq_no+x, where x is 0 or 1, determined by the following rule:

+ + + + + + + + + + + + + + + + + +
in_seq_noout_seq_no
secret chat initiated by sender01
secret chat initiated by recipient10
+

In this way the least significant bit of each seq_no field included in the message is different for incoming and outgoing messages. This is done to prevent a possible attacker from mirroring the messages. If any of the received in_seq_no or out_seq_no are not consistent in terms of parity (see table above), the client is required to immediately abort the secret chat.

+
+

E.g., the first message the local client sends to any secret chat will have out_seq_no of 0+x_out, the second one will have out_seq_no of 2*1+x_out, and so on, where x_out is 0 if the chat was initiated by the remote client, 1 otherwise; similarly for the received messages, but there x_in is used instead of x_out and is equal to 0 if the chat was initiated by the local client, 1 otherwise.

+
+

Raw sequence numbers will be used in the remaining part of this text, unless otherwise specified.

+

Preventing gaps

+

Your client must ensure that all outgoing secret chat messages are queued on the server in the correct order. This is achieved by correctly placing them into the invokeAfterMsgs chain. Failure to do this may result in gaps on the remote client, which may in turn lead to aborted secret chats. The local client must maintain the correct sequence of in_seq_no for the remote client. To achieve this, assign in_seq_no and out_seq_no to each message at the exact moment when the message is created, and never change them in the future.

+

Security checks

+

Checking out_seq_no

+

Your client must check that it has received each message with the sequence number out_seq_no starting from 0 to some current point C. It should then expect the next message to have the sequence number out_seq_no=C+1. If the out_seq_no in the received message does not match this, the following needs to be done:

+
    +
  • If the received out_seq_no<=C, the local client must drop the message (repeated message). The client should not check the contents of the message because the original message could have been deleted (see Deleting unacknowledged messages).
  • +
  • If the received out_seq_no>C+1, it most likely means that the server left out some messages due to a technical failure or due to the messages becoming obsolete. A temporary solution to this is to simply abort the secret chat. But since this may cause some existing older secret chats to be aborted, it is strongly recommended for the client to properly handle such seq_no gaps. Note that in_seq_no is not increased upon receipt of such a message; it is advanced only after all preceding gaps are filled.
  • +
+

Proper handling of gaps

+

In order to correctly handle incoming messages after a hole has been identified (when received out_seq_no>C+1), it is necessary to put received messages with the wrong seq_no into a "waiting queue" on the local client, and to re-request the missing messages using the special constructor decryptedMessageActionResend start_seq_no:int end_seq_no:int = DecryptedMessageAction;. The sequence numbers used in this constructor must be ready for interpretation by the remote client and therefore cannot be in their raw form: you can easily get the necessary start_seq_no by adding 2 to the out_seq_no of the last message before the hole and the end_seq_no by subtracting 2 from the out_seq_no of the received message with the wrong sequence number.

+

Each hole normally requires only one request to resend messages — if the remote client keeps sending out of sync messages, they should be put into the queue without sending a new request. Having received the missing messages, the local client must first interpret these messages in the right order by their seq_no. Once this is done, the client can proceed to interpret messages from the queue (again, in the right seq_no order).

+

Special cases:

+
    +
  • Note that having two gaps simultaneously is very rare (provided that the remote client and server are operating normally) and it is acceptable to abort the secret chat in this situation.
  • +
  • If a local client receives decryptedMessageActionResend but is unable to satisfy the request, it must abort the secret chat.
  • +
+

Avoiding concurrent gaps

+

In order to avoid getting stuck with concurrent gaps on both sides, decryptedMessageActionResend must always be interpreted immediately upon receipt in all cases, even if its out_seq_no>=C+1. Note that each decryptedMessageActionResend must only be handled once, it must not be interpreted again when we interpret messages in the queue.

+

Checking and handling in_seq_no

+

in_seq_no of all received messages must be valid. To ensure this, perform the following checks:

+
    +
  • in_seq_no must form a non-decreasing sequence of non-negative integer numbers.
  • +
  • in_seq_no must be valid at the moment of receiving the message, that is, if D is the out_seq_no of last message we sent, the received in_seq_no should not be greater than D + 1. This also allows us to insert the received message into its correct place in the secret chat. For example, imagine that the local client has sent 5 secret chat messages, and then receives a secret chat message with the text "Yes" and in_seq_no=2. In this situation the local client must place that message after the second message it sent. This makes manipulations with delayed messages impossible.
  • +
+

If in_seq_no contradicts these criteria, the local client is required to immediately abort the secret chat. This could happen only in case of malicious or buggy behaviour on either server or remote client side.

+

Deleting unacknowledged messages

+

In case the user on the local client has deleted a message before the server (or the remote client, if decryptedMessageActionResend is handled correctly) could acknowledge the message, for security reasons, you must:

+
    +
  • securely destroy the contents of the message (as in case of any other deleted Secret Chat message);
  • +
  • change the local copy of the original message to decryptedMessageActionDeleteMessages with random_id equal to its own random_id;
  • +
  • create a new outgoing message deleting the original message.
  • +
+

This must be done because your client doesn't know whether the remote client really received the message or not. In the case the message was already received, it will be deleted by the second message; otherwise it must arrive as a "self-delete" message to maintain the correct sequence of seq_no.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/end-to-end/video-calls.html b/data/core.telegram.org/api/end-to-end/video-calls.html new file mode 100644 index 0000000000..e97359be3c --- /dev/null +++ b/data/core.telegram.org/api/end-to-end/video-calls.html @@ -0,0 +1,215 @@ + + + + + End-to-End Encrypted Voice and Video Calls + + + + + + + + + + + + + +
+ +
+
+
+ +

End-to-End Encrypted Voice and Video Calls

+ +

This article describes the end-to-end encryption used for Telegram voice and video calls.

+
Related Articles
+

+ +
+

Establishing Calls

+

Before a call is ready, some preliminary actions have to be performed. The calling party needs to contact the party to be called and check whether it is ready to accept the call. Besides that, the parties have to negotiate the protocols to be used, learn the IP addresses of each other or of the Telegram relay servers to be used (so-called reflectors), and generate a one-time encryption key for this voice call with the aid of Diffie--Hellman key exchange. All of this is accomplished in parallel with the aid of several Telegram API methods and related notifications. This document covers details related to key generation, encryption and security.

+

Key Generation

+

The Diffie-Hellman key exchange, as well as the whole protocol used to create a new voice call, is quite similar to the one used for Secret Chats. We recommend studying the linked article before proceeding.

+

However, we have introduced some important changes to facilitate the key verification process. Below is the entire exchange between the two communicating parties, the Caller (A) and the Callee (B), through the Telegram servers (S).

+
    +
  • A executes messages.getDhConfig to find out the 2048-bit Diffie-Hellman prime p and generator g. The client is expected to check whether p is a safe prime and perform all the security checks necessary for secret chats.
  • +
  • A chooses a random value of a, 1 < a < p-1, and computes g_a:=power(g,a) mod p (a 256-byte number) and g_a_hash:=SHA256(g_a) (32 bytes long).
  • +
  • A invokes (sends to server S) phone.requestCall, which has the field g_a_hash:bytes, among others. For this call, this field is to be filled with g_a_hash, not g_a itself.
  • +
  • The Server S performs privacy checks and sends an updatePhoneCall update with a phoneCallRequested constructor to all of B's active devices. This update, apart from the identity of A and other relevant parameters, contains the g_a_hash field, filled with the value obtained from A.
  • +
  • B accepts the call on one of their devices, stores the received value of g_a_hash for this instance of the voice call creation protocol, chooses a random value of b, 1 < b < p-1, computes g_b:=power(g,b) mod p, performs all the required security checks, and invokes the phone.acceptCall method, which has a g_b:bytes field (among others), to be filled with the value of g_b itself (not its hash).
  • +
  • The Server S sends an updatePhoneCall with the phoneCallDiscarded constructor to all other devices B has authorized, to prevent accepting the same call on any of the other devices. From this point on, the server S works only with that of B's devices which has invoked phone.acceptCall first.
  • +
  • The Server S sends to A an updatePhoneCall update with phoneCallAccepted constructor, containing the value of g_b received from B.
  • +
  • A performs all the usual security checks on g_b and a, computes the Diffie--Hellman key key:=power(g_b,a) mod p and its fingerprint key_fingerprint:long, equal to the lower 64 bits of SHA1(key), the same as with secret chats. Then A invokes the phone.confirmCall method, containing g_a:bytes and key_fingerprint:long.
  • +
  • The Server S sends to B an updatePhoneCall update with the phoneCall constructor, containing the value of g_a in g_a_or_b:bytes field, and key_fingerprint:long
  • +
  • At this point B receives the value of g_a. It checks that SHA256(g_a) is indeed equal to the previously received value of g_a_hash, performs all the usual Diffie-Hellman security checks, and computes the key key:=power(g_a,b) mod p and its fingerprint, equal to the lower 64 bits of SHA1(key). Then it checks that this fingerprint equals the value of key_fingerprint:long received from the other side, as an implementation sanity check.
  • +
+

At this point, the Diffie--Hellman key exchange is complete, and both parties have a 256-byte shared secret key key which is used to encrypt all further exchanges between A and B.

+

It is of paramount importance to accept each update only once for each instance of the key generation protocol, discarding any duplicates or alternative versions of already received and processed messages (updates).

+

Encryption

+
+

This document describes encryption in voice and video calls as implemented in Telegram apps with versions 7.0 and above. See this document for details on encryption used in voice calls in app versions released before August 14, 2020.

+
+

The Telegram Voice and Video Call Library uses an optimized version of MTProto 2.0 to send and receive packets, consisting of one or more end-to-end encrypted messages of various types (ice candidates list, video formats, remote video status, audio stream data, video stream data, message ack or empty).

+

This document describes only the encryption process, leaving out encoding and network-dependent parts.

+

The library starts working with:

+
    +
  • An encryption key key shared between the parties, as generated above.
  • +
  • Information whether the call is outgoing or incoming.
  • +
  • Two data transfer channels: signaling, offered by the Telegram API, and transport based on WebRTC.
  • +
+

Both data transfer channels are unreliable (messages may get lost), but signaling is slower and more reliable.

+

Encrypting Call Data

+

The body of a packet (decrypted_body) consists of several messages and their respective seq numbers concatenated together.

+
    +
  • decrypted_body = message_seq1 + message_body1 + message_seq2 + message_body2
  • +
+

Each decrypted_body is unique because no two seq numbers of the first message can be the same. If only old messages need to be re-sent, an empty message with new unique seq is added to the packet first.

+

The encryption key key is used to compute a 128-bit msg_key and then a 256-bit aes_key and a 128-bit aes_iv:

+
    +
  • msg_key_large = SHA256 (substr(key, 88+x, 32) + decrypted_body);
  • +
  • msg_key = substr (msg_key_large, 8, 16);
  • +
  • sha256_a = SHA256 (msg_key + substr (key, x, 36));
  • +
  • sha256_b = SHA256 (substr (key, 40+x, 36) + msg_key);
  • +
  • aes_key = substr (sha256_a, 0, 8) + substr (sha256_b, 8, 16) + substr (sha256_a, 24, 8);
  • +
  • aes_iv = substr (sha256_b, 0, 4) + substr (sha256_a, 8, 8) + substr (sha256_b, 24, 4);
  • +
+

x depends on whether the call is outgoing or incoming and on the connection type:

+
    +
  • x = 0 for outgoing + transport
  • +
  • x = 8 for incoming + transport
  • +
  • x = 128 for outgoing + signaling
  • +
  • x = 136 for incoming + signaling
  • +
+

This allows apps to decide which packet types will be sent to which connections and work in these connections independently (with each having its own seq counter).

+

The resulting aes_key and aes_iv are used to encrypt decrypted_body:

+
    +
  • encrypted_body = AES_CTR (decrypted_body, aes_key, aes_iv)
  • +
+

The packet that gets sent consists of msg_key and encrypted_body:

+
    +
  • packet_bytes = msg_key + encrypted_body
  • +
+

When received, the packet gets decrypted using key and msg_key, after which msg_key is checked against the relevant SHA256 substring. If the check fails, the packet must be discarded.

+

Protecting Against Replay Attacks

+

Each of the peers maintains its own 32-bit monotonically increasing counter for outgoing messages, seq, starting with 1. This seq counter is prepended to each sent message and increased by 1 for each new message. No two seq numbers of the first message in a packet can be the same. If only old messages need to be re-sent, an empty message with a new unique seq is added to the packet first. When the seq counter reaches 2^30, the call must be aborted. Each peer stores seq values of all the messages it has received (and processed) which are larger than max_received_seq - 64, where max_received_seq is the largest seq number received so far.

+

If a packet is received, the first message of which has a seq that is smaller or equal to max_received_seq - 64 or its seq had already been received, the message is discarded. Otherwise, the seq values of all incoming messages are memorized and max_received_seq is adjusted. This guarantees that no two packets will be processed twice.

+

Key Verification

+

To verify the key, and ensure that no MITM attack is taking place, both parties concatenate the secret key key with the value g_a of the Caller ( A ), compute SHA256 and use it to generate a sequence of emoticons. More precisely, the SHA256 hash is split into four 64-bit integers; each of them is divided by the total number of emoticons used (currently 333), and the remainder is used to select specific emoticons. The specifics of the protocol guarantee that comparing four emoticons out of a set of 333 is sufficient to prevent eavesdropping (MiTM attack on DH) with a probability of 0.9999999999.

+

This is because instead of the standard Diffie-Hellman key exchange which requires only two messages between the parties:

+
    +
  • A->B : (generates a and) sends g_a := g^a
  • +
  • B->A : (generates b and true key (g_a)^b, then) sends g_b := g^b
  • +
  • A : computes key (g_b)^a
  • +
+

we use a three-message modification thereof that works well when both parties are online (which also happens to be a requirement for voice calls):

+
    +
  • A->B : (generates a and) sends g_a_hash := hash(g^a)
  • +
  • B->A : (stores g_a_hash, generates b and) sends g_b := g^b
  • +
  • A->B : (computes key (g_b)^a, then) sends g_a := g^a
  • +
  • B : checks hash(g_a) == g_a_hash, then computes key (g_a)^b
  • +
+

The idea here is that A commits to a specific value of a (and of g_a) without disclosing it to B. B has to choose its value of b and g_b without knowing the true value of g_a, so that it cannot try different values of b to force the final key (g_a)^b to have any specific properties (such as fixed lower 32 bits of SHA256(key)). At this point, B commits to a specific value of g_b without knowing g_a. Then A has to send its value g_a; it cannot change it even though it knows g_b now, because the other party B would accept only a value of g_a that has a hash specified in the very first message of the exchange.

+

If some impostor is pretending to be either A or B and tries to perform a Man-in-the-Middle Attack on this Diffie--Hellman key exchange, the above still holds. Party A will generate a shared key with B -- or whoever pretends to be B -- without having a second chance to change its exponent a depending on the value g_b received from the other side; and the impostor will not have a chance to adapt his value of b depending on g_a, because it has to commit to a value of g_b before learning g_a. The same is valid for the key generation between the impostor and the party B.

+

The use of hash commitment in the DH exchange constrains the attacker to only one guess to generate the correct visualization in their attack, which means that using just over 33 bits of entropy represented by four emoji in the visualization is enough to make a successful attack highly improbable.

+
+

For a slightly more user-friendly explanation of the above see: How are calls authenticated?

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/end-to-end/voice-calls.html b/data/core.telegram.org/api/end-to-end/voice-calls.html new file mode 100644 index 0000000000..fceff8b453 --- /dev/null +++ b/data/core.telegram.org/api/end-to-end/voice-calls.html @@ -0,0 +1,178 @@ + + + + + End-to-End Encrypted Voice Calls + + + + + + + + + + + + + +
+ +
+
+
+ +

End-to-End Encrypted Voice Calls

+ +
+

This document describes encryption in voice calls as implemented in Telegram apps with versions < 7.0. See this document for details on encryption used in voice and video calls in app versions released on August 14, 2020 and later.

+
+
Related articles
+

+ +

Establishing voice calls

+

Before a voice call is ready, some preliminary actions have to be performed. The calling party needs to contact the party to be called and check whether it is ready to accept the call. Besides that, the parties have to negotiate the protocols to be used, learn the IP addresses of each other or of the Telegram relay servers to be used (so-called reflectors), and generate a one-time encryption key for this voice call with the aid of Diffie--Hellman key exchange. All of this is accomplished in parallel with the aid of several Telegram API methods and related notifications. This document details the generation of the encryption key. Other negotiations will be eventually documented elsewhere.

+

Key Generation

+

The Diffie-Hellman key exchange, as well as the whole protocol used to create a new voice call, is quite similar to the one used for Secret Chats. We recommend studying the linked article before proceeding.

+

However, we have introduced some important changes to facilitate the key verification process. Below is the entire exchange between the two communicating parties, the Caller (A) and the Callee (B), through the Telegram servers (S).

+
    +
  • A executes messages.getDhConfig to find out the 2048-bit Diffie-Hellman prime p and generator g. The client is expected to check whether p is a safe prime and perform all the security checks necessary for secret chats.
  • +
  • A chooses a random value of a, 1 < a < p-1, and computes g_a:=power(g,a) mod p (a 256-byte number) and g_a_hash:=SHA256(g_a) (32 bytes long).
  • +
  • A invokes (sends to server S) phone.requestCall, which has the field g_a_hash:bytes, among others. For this call, this field is to be filled with g_a_hash, not g_a itself.
  • +
  • The Server S performs privacy checks and sends an updatePhoneCall update with a phoneCallRequested constructor to all of B's active devices. This update, apart from the identity of A and other relevant parameters, contains the g_a_hash field, filled with the value obtained from A.
  • +
  • B accepts the call on one of their devices, stores the received value of g_a_hash for this instance of the voice call creation protocol, chooses a random value of b, 1 < b < p-1, computes g_b:=power(g,b) mod p, performs all the required security checks, and invokes the phone.acceptCall method, which has a g_b:bytes field (among others), to be filled with the value of g_b itself (not its hash).
  • +
  • The Server S sends an updatePhoneCall with the phoneCallDiscarded constructor to all other devices B has authorized, to prevent accepting the same call on any of the other devices. From this point on, the server S works only with that of B's devices which has invoked phone.acceptCall first.
  • +
  • The Server S sends to A an updatePhoneCall update with phoneCallAccepted constructor, containing the value of g_b received from B.
  • +
  • A performs all the usual security checks on g_b and a, computes the Diffie--Hellman key key:=power(g_b,a) mod p and its fingerprint key_fingerprint:long, equal to the lower 64 bits of SHA1(key), the same as with secret chats. Then A invokes the phone.confirmCall method, containing g_a:bytes and key_fingerprint:long.
  • +
  • The Server S sends to B an updatePhoneCall update with the phoneCall constructor, containing the value of g_a in g_a_or_b:bytes field, and key_fingerprint:long
  • +
  • At this point B receives the value of g_a. It checks that SHA256(g_a) is indeed equal to the previously received value of g_a_hash, performs all the usual Diffie-Hellman security checks, and computes the key key:=power(g_a,b) mod p and its fingerprint, equal to the lower 64 bits of SHA1(key). Then it checks that this fingerprint equals the value of key_fingerprint:long received from the other side, as an implementation sanity check.
  • +
+

At this point, the Diffie--Hellman key exchange is complete, and both parties have a 256-byte shared secret key key which is used to encrypt all further exchanges between A and B.

+

It is of paramount importance to accept each update only once for each instance of the key generation protocol, discarding any duplicates or alternative versions of already received and processed messages (updates).

+

Encryption of voice data

+

Both parties A (the Caller) and B (the Callee) transform the voice information into a sequence of small chunks or packets, not more than 1 kilobyte each. This information is to be encrypted using the shared key key generated during the initial exchange, and sent to the other party, either directly (P2P) or through Telegram's relay servers (so-called reflectors). This document describes only the encryption process for each chunk, leaving out voice encoding and the network-dependent parts.

+

Encapsulation of low-level voice data

+

The low-level data chunk raw_data:string, obtained from voice encoder, is first encapsulated into one of the two constructors for the DecryptedDataBlock type, similar to DecryptedMessage used in secret chats:

+
decryptedDataBlock#dbf948c1 random_id:long random_bytes:string flags:# voice_call_id:flags.2?int128 in_seq_no:flags.4?int out_seq_no:flags.4?int recent_received_mask:flags.5?int proto:flags.3?int extra:flags.1?string raw_data:flags.0?string = DecryptedDataBlock;
+simpleDataBlock#cc0d0e76 random_id:long random_bytes:string raw_data:string = DecryptedDataBlock;
+

Here out_seq_no is the chunk's sequence number among all sent by this party (starting from one), in_seq_no -- the highest known out_seq_no from the received packets. The parameter recent_received_mask is a 32-bit mask, used to track delivery of the last 32 packets sent by the other party. The bit i is set if a packet with out_seq_no equal to in_seq_no-i has been received.

+

The higher 8 bits in flags are reserved for use by the lower-level protocol (the one which generates and interprets raw_data), and will never be used for future extensions of decryptedDataBlock.

+

The parameters voice_call_id and proto are mandatory until the other side confirms reception of at least one packet by sending a packet with a non-zero in_seq_no. After that, they become optional, and the simpleDataBlock constructor can be used if the lower level protocol wants to.

+

The parameter voice_call_id is computed from the key key and equals the lower 128 bits of its SHA-256.

+

The random_bytes string should contain at least 7 bytes of random data. The field random_id also contains 8 random bytes, which can be used as a unique packet identifier if necessary.

+

MTProto encryption

+

Once the data is encapsulated in DecryptedDataBlock, it is TL-serialized and encrypted with MTProto, using key instead of auth_key; the parameter x is to be set to 0 for messages from A to B, and to 8 for messages in the opposite direction. Encrypted data are prepended by the 128-bit msg_key (usual for MTProto); before that, either the 128-bit voice_call_id (if P2P is used) or the peer_tag (if reflectors are used) is prepended. The resulting data packet is sent by UDP either directly to the other party (if P2P is possible) or to the Telegram relay servers (reflectors).

+

Key Verification

+

To verify the key, both parties concatenate the secret key key with the value g_a of the Caller ( A ), compute SHA256 and use it to generate a sequence of emoticons. More precisely, the SHA256 hash is split into four 64-bit integers; each of them is divided by the total number of emoticons used (currently 333), and the remainder is used to select specific emoticons. The specifics of the protocol guarantee that comparing four emoticons out of a set of 333 is sufficient to prevent eavesdropping (MiTM attack on DH) with a probability of 0.9999999999.

+

This is because instead of the standard Diffie-Hellman key exchange which requires only two messages between the parties:

+
    +
  • A->B : (generates a and) sends g_a := g^a
  • +
  • B->A : (generates b and true key (g_a)^b, then) sends g_b := g^b
  • +
  • A : computes key (g_b)^a
  • +
+

we use a three-message modification thereof that works well when both parties are online (which also happens to be a requirement for voice calls):

+
    +
  • A->B : (generates a and) sends g_a_hash := hash(g^a)
  • +
  • B->A : (stores g_a_hash, generates b and) sends g_b := g^b
  • +
  • A->B : (computes key (g_b)^a, then) sends g_a := g^a
  • +
  • B : checks hash(g_a) == g_a_hash, then computes key (g_a)^b
  • +
+

The idea here is that A commits to a specific value of a (and of g_a) without disclosing it to B. B has to choose its value of b and g_b without knowing the true value of g_a, so that it cannot try different values of b to force the final key (g_a)^b to have any specific properties (such as fixed lower 32 bits of SHA256(key)). At this point, B commits to a specific value of g_b without knowing g_a. Then A has to send its value g_a; it cannot change it even though it knows g_b now, because the other party B would accept only a value of g_a that has a hash specified in the very first message of the exchange.

+

If some impostor is pretending to be either A or B and tries to perform a Man-in-the-Middle Attack on this Diffie--Hellman key exchange, the above still holds. Party A will generate a shared key with B -- or whoever pretends to be B -- without having a second chance to change its exponent a depending on the value g_b received from the other side; and the impostor will not have a chance to adapt his value of b depending on g_a, because it has to commit to a value of g_b before learning g_a. The same is valid for the key generation between the impostor and the party B.

+

The use of hash commitment in the DH exchange constrains the attacker to only one guess to generate the correct visualization in their attack, which means that using just over 33 bits of entropy represented by four emoji in the visualization is enough to make a successful attack highly improbable.

+
+

For a slightly more user-friendly explanation of the above see: How are calls authenticated?

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/end-to-end_v1.html b/data/core.telegram.org/api/end-to-end_v1.html new file mode 100644 index 0000000000..28fd6bd30d --- /dev/null +++ b/data/core.telegram.org/api/end-to-end_v1.html @@ -0,0 +1,225 @@ + + + + + Secret chats, end-to-end encryption (v. 1.0, DEPRECATED) + + + + + + + + + + + + + +
+ +
+
+
+ +

Secret chats, end-to-end encryption (v. 1.0, DEPRECATED)

+ +
+

This document describes end-to-end encrypted Secret Chats in MTProto 1.0, its status is DEPRECATED. +For information on end-to-end encryption used in up-to-date Telegram clients, kindly see this document.

+
+
Related articles
+

+
+

Secret Chats are one-on-one chats wherein messages are encrypted with a key held only by the chat’s participants. Please note that the schema for end-to-end encrypted Secret Chats is different from what is used for cloud chats:

+
+ +
+

Key Generation

+

The Diffie-Hellman protocol is used for key generation. For more information, see Wikipedia.

+

Let us consider the following scenario: User A would like to initiate encrypted communication with User B.

+

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 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 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, for example, by generating a client random number of the same length (client_random) and using final_random := random XOR client_random.

+

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

+

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).

+

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 receive 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

+

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

+

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 8). +The TL-Schema for end-to-end encrypted messages contents is represented here ».

+

The resulting construct is serialized as an array of bytes using generic TL rules. The resulting array is padded at the top with 4 bytes of the array length not counting these 4 bytes. +A message key, msg_key, is computed as the 128 low-order bits of the SHA1 of the data obtained in the previous step. +The byte array is padded with random data until its length is divisible by 16 bytes. +An AES key and an initialization vector are computed ( key is the shared key obtained during Key Generation; in MTProto 1.0, x = 0 ):

+
    +
  • msg_key = substr (SHA1 (plaintext), 4, 16);
  • +
  • sha1_a = SHA1 (msg_key + substr (key, x, 32));
  • +
  • sha1_b = SHA1 (substr (key, 32+x, 16) + msg_key + substr (key, 48+x, 16));
  • +
  • sha1_с = SHA1 (substr (key, 64+x, 32) + msg_key);
  • +
  • sha1_d = SHA1 (msg_key + substr (key, 96+x, 32));
  • +
  • aes_key = substr (sha1_a, 0, 8) + substr (sha1_b, 8, 12) + substr (sha1_c, 4, 12);
  • +
  • aes_iv = substr (sha1_a, 8, 12) + substr (sha1_b, 0, 8) + substr (sha1_c, 16, 4) + substr (sha1_d, 0, 8);
  • +
+

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.

+

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 low-order bits of the SHA1 hash of the decrypted message. +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

+

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:

+
    +
  • 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.

+

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.

+

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.

+

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

+

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 8, the first layer where Secret Chats became available. 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>=17, 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

+

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. For instance, if the remote layer for the chat in question is deemed to be lower than 17, the notification must be wrapped as if it were the decryptedMessageService constructor of the obsolete layer 8 (constructor decryptedMessageService#aa48327d), despite the fact that the decryptedMessageActionNotifyLayer constructor is actually not present in Layer 8.

+

There are three cases when your client must notify the remote client about its local layer:

+
    +
  1. As soon as a new secret chat has been created, immediately after the secret key has been successfully exchanged.
  2. +
  3. Immediately after the remote layer value is updated to layer 17 or higher. An exception to this case is when the secret chat in question has been created less than 15 seconds ago. In this case the notification was already sent (see 1).
  4. +
  5. 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 17 to Layer 18).
  6. +
+
+

Note that all pending obsolete layer messages must be sent prior to the layer update notification (more on this in Handling Sequence numbers).

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/entities.html b/data/core.telegram.org/api/entities.html new file mode 100644 index 0000000000..35be5bb67b --- /dev/null +++ b/data/core.telegram.org/api/entities.html @@ -0,0 +1,137 @@ + + + + + Styled text with message entities + + + + + + + + + + + + + +
+ +
+
+
+ +

Styled text with message entities

+ +

Telegram supports styled text using message entities.

+

A client that wants to send styled messages would simply have to integrate a Markdown/HTML parser, and generate an array of message entities by iterating through the parsed tags.

+

Special care must be taken to consider the UTF-8 length of strings when generating message entities, see example implementations: tdlib, MadelineProto.

+

Nested entities are supported.
+For example the following HTML/Markdown aliases for message entities can be used:

+ +
+```c++
+code
+```
+
+

The following entities can also be used to mention users:

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/errors.html b/data/core.telegram.org/api/errors.html new file mode 100644 index 0000000000..b97fb4dd60 --- /dev/null +++ b/data/core.telegram.org/api/errors.html @@ -0,0 +1,188 @@ + + + + + Error handling + + + + + + + + + + + + + +
+ +
+
+
+ +

Error handling

+ +

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

+

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

+

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

+

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

+

The request must be repeated, but directed to a different data center.

+

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

+

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:

+
    +
  • FIRSTNAME_INVALID: The first name is invalid
  • +
  • LASTNAME_INVALID: The last name is invalid
  • +
  • PHONE_NUMBER_INVALID: The phone number is invalid
  • +
  • PHONE_CODE_HASH_EMPTY: phone_code_hash is missing
  • +
  • PHONE_CODE_EMPTY: phone_code is missing
  • +
  • PHONE_CODE_EXPIRED: The confirmation code has expired
  • +
  • API_ID_INVALID: The api_id/api_hash combination is invalid
  • +
  • PHONE_NUMBER_OCCUPIED: The phone number is already in use
  • +
  • PHONE_NUMBER_UNOCCUPIED: The phone number is not yet being used
  • +
  • USERS_TOO_FEW: Not enough users (to create a chat, for example)
  • +
  • USERS_TOO_MUCH: The maximum number of users has been exceeded (to create a chat, for example)
  • +
  • TYPE_CONSTRUCTOR_INVALID: The type constructor is invalid
  • +
  • FILE_PART_INVALID: The file part number is invalid
  • +
  • FILE_PARTS_INVALID: The number of file parts is invalid
  • +
  • FILE_PART_Х_MISSING: Part X (where X is a number) of the file is missing from storage
  • +
  • MD5_CHECKSUM_INVALID: The MD5 checksums do not match
  • +
  • PHOTO_INVALID_DIMENSIONS: The photo dimensions are invalid
  • +
  • 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 waiting call returned an error
  • +
+

401 UNAUTHORIZED

+

There was an unauthorized attempt to use functionality available only to authorized users.

+

Examples of Errors:

+
    +
  • AUTH_KEY_UNREGISTERED: The key is not registered in the system
  • +
  • AUTH_KEY_INVALID: The key is invalid
  • +
  • USER_DEACTIVATED: The user has been deleted/deactivated
  • +
  • SESSION_REVOKED: The authorization has been invalidated, because of the user terminating all sessions
  • +
  • SESSION_EXPIRED: The authorization has expired
  • +
  • AUTH_KEY_PERM_EMPTY: The method is unavailble for temporary authorization key, not bound to permanent
  • +
+

403 FORBIDDEN

+

Privacy violation. For example, an attempt to write a message to someone who has blacklisted the current user.

+

404 NOT_FOUND

+

An attempt to invoke a non-existent object, such as a method.

+

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

+

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:

+
    +
  • FLOOD_WAIT_X: A wait of X seconds is required (where X is a number)
  • +
+

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.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/file_reference.html b/data/core.telegram.org/api/file_reference.html new file mode 100644 index 0000000000..bab0245cf9 --- /dev/null +++ b/data/core.telegram.org/api/file_reference.html @@ -0,0 +1,125 @@ + + + + + File references + + + + + + + + + + + + + +
+ +
+
+
+ +

File references

+ +

File references are strings of bytes, that can be encountered in the file_reference fields of document and photo objects.

+

They must be cached by the client, along with the origin context where the document/photo object was found, in order to be refetched when the file reference expires.

+

Example implementation of a reference database: MadelineProto, android, telegram desktop, tdlib.

+

Another example:

+

Assume you receive a message from your friend: that message contains a messageMediaPhoto with a photo.

+

Your client has to cache not only the file_reference field of the photo, but also the context in which the file reference was seen (in this case, a message coming from a specific user).

+

The context info is in this case, an origin context of type message, containing the message ID and the peer ID of the chat/channel/user where the message was seen.

+

The context info has to be associated with the file reference: when downloading a file using upload.getFile, a FILE_REFERENCE_EXPIRED error (or another error starting with FILE_REFERENCE_) may be returned.
+If this happens, the context info must be used to refetch the object that contained the file reference: in this example, the peer info and the message ID have to be used with channels.getMessages or messages.getMessages to refetch the message, recache the file reference and use it in a new file download request.

+

More than one origin context can be associated to one file reference, for greater resilience (in the case of a message that was deleted in one chat but was also forwarded in another chat, the file reference can be refetched from the second chat, instead).

+

Origin contexts for objects returned by method calls with certain parameters can be considered, too (for example, in the case of favorited sticker sets returned by messages.getFavedStickers).

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/files.html b/data/core.telegram.org/api/files.html new file mode 100644 index 0000000000..5d3ebb8eff --- /dev/null +++ b/data/core.telegram.org/api/files.html @@ -0,0 +1,550 @@ + + + + + Uploading and Downloading Files + + + + + + + + + + + + + +
+ +
+
+
+ +

Uploading and Downloading Files

+ +
+ +

When working with the API, it is sometimes necessary to send a relatively large file to the server. For example, when sending a message with a photo/video attachment or when setting the current user’s profile picture.

+

Uploading files

+

There are a number of API methods to save files. The schema of the types and methods used is presented below:

+
inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
+
+inputSecureFileUploaded#3334b0f0 id:long parts:int md5_checksum:string file_hash:bytes secret:bytes = InputSecureFile;
+inputSecureFile#5367e5be id:long access_hash:long = InputSecureFile;
+
+inputMediaUploadedPhoto#1e287d04 flags:# file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
+inputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true force_file:flags.4?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector<DocumentAttribute> stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
+
+inputChatUploadedPhoto#c642724e flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = InputChatPhoto;
+
+
+---functions---
+
+messages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int = Updates;
+messages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia;
+messages.sendEncryptedFile#5559481d flags:# silent:flags.0?true peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
+
+photos.uploadProfilePhoto#89f30f69 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = photos.Photo;    
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
+

Before transmitting the contents of the file itself, the file has to be assigned a unique 64-bit client identifier: file_id.

+

The file’s binary content is then split into parts. All parts must have the same size ( part_size ) and the following conditions must be met:

+
    +
  • part_size % 1024 = 0 (divisible by 1KB)
  • +
  • 524288 % part_size = 0 (512KB must be evenly divisible by part_size)
  • +
+

The last part does not have to satisfy these conditions, provided its size is less than part_size.

+

Each part should have a sequence number, file_part, with a value ranging from 0 to 2,999.

+

After the file has been partitioned you need to choose a method for saving it on the server. Use upload.saveBigFilePart in case the full size of the file is more than 10 MB and upload.saveFilePart for smaller files.

+

Each call saves a portion of the data in a temporary location on the server to be used later. The storage life of each portion of data is between several minutes and several hours (depending on how busy the storage area is). After this time, the file part will become unavailable. To increase the time efficiency of a file save operation, we recommend using a call queue, so X pieces of the file are being saved at any given moment in time. Each successful operation to save a part invokes the method call to save the next part. The value of X can be tuned to achieve maximum performance.

+

When using one of the methods mentioned above to save file parts, one of the following data input errors may be returned:

+
    +
  • FILE_PARTS_INVALID - Invalid number of parts. The value is not between 1..3000
  • +
  • FILE_PART_INVALID: The file part number is invalid. The value is not between 0 and 2,999.
  • +
  • FILE_PART_TOO_BIG: The size limit (512 KB) for the content of the file part has been exceeded
  • +
  • FILE_PART_EMPTY: The file part sent is empty
  • +
  • FILE_PART_SIZE_INVALID - 512KB cannot be evenly divided by part_size
  • +
  • FILE_PART_SIZE_CHANGED - The part size is different from the size of one of the previous parts in the same file
  • +
+

While the parts are being uploaded, an MD5 hash of the file contents can also be computed to be used later as the md5_checksum parameter in the inputFile constructor (since it is checked only by the server, for encrypted secret chat files it must be generated from the encrypted file). +After the entire file is successfully saved, the final method may be called and passed the generated inputFile object. In case the upload.saveBigFilePart method is used, the inputFileBig constructor must be passed, in other cases use inputFile.

+ +

The file save operation may return one of the following data input errors:

+
    +
  • FILE_PARTS_INVALID: The number of file parts is invalid The value is not between 1 and 3,000.
  • +
  • FILE_PART_Х_MISSING: Part X (where X is a number) of the file is missing from storage. Try repeating the method call to resave the part.
  • +
  • MD5_CHECKSUM_INVALID: The file’s checksum did not match the md5_checksum parameter
  • +
+

Albums, grouped media

+
inputMediaUploadedPhoto#1e287d04 flags:# file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
+inputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true force_file:flags.4?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector<DocumentAttribute> stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
+
+inputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector<MessageEntity> = InputSingleMedia;
+
+---functions---
+
+messages.sendMultiMedia#cc0110cb flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector<InputSingleMedia> schedule_date:flags.10?int = Updates;
+

Telegram allows grouping photos into albums and generic files (audio, docuemnts) into media groups.

+

To do this, messages.sendMultiMedia is used, wrapping each InputMedia constructor (uploaded or pre-existing, maximum 10 per media group) into an inputSingleMedia constructor, optionally providing a custom per-file caption in message.

+

For photo albums, clients should display an album caption only if exactly one photo in the group has a caption, otherwise no album caption should be displayed, and only when viewing in detail a specific photo of the group the caption should be shown.
+Other grouped media can display a caption under each file.

+

Re-using pre-uploaded files

+
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;
+
+---functions---
+
+messages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document;
+

For some types of documents like GIFs, messages.getDocumentByHash can be used to search for the document on Telegram servers. +The SHA256 hash of the file is computed, and it is passed along with the file's mime type and size to the method: if the file type is correct and the file is found, a document is returned.

+

Uploading profile or chat pictures

+
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;
+
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+
+inputPhoto#3bb3b94a id:long access_hash:long file_reference:bytes = InputPhoto;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+
+inputChatUploadedPhoto#c642724e flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = InputChatPhoto;
+inputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto;
+
+---functions---
+
+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;
+
+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.
+photos.uploadProfilePhoto can also be used to reupload previously uploaded profile pictures.

+

Animated profile pictures

+

Animated profile pictures are also supported, by populating the video constructor: square MPEG4 videos up to 1080x1080 are supported, 800x800 is the recommended resolution.
+The video_start_ts is a floating point UNIX timestamp in seconds, indicating the frame of the video that should be used as static preview.

+

Chat, channel and supergroup profile photos and videos can be uploaded using messages.editChatPhoto (legacy groups) or channels.editPhoto (channels, supergroups).
+Use the inputChatPhoto to reuse previously uploaded profile pictures.

+

Downloading files

+

There are methods available to download files which have been successfully uploaded. The schema of the types and methods used is presented below:

+
upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
+upload.fileCdnRedirect#f18cda44 dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes file_hashes:Vector<FileHash> = upload.File;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+---functions---
+
+upload.getFile#b15a9afc flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:int limit:int = upload.File;
+

Any file can be downloaded by calling upload.getFile. +The data for the input parameter of the InputFileLocation type is generated as follows:

+
inputFileLocation#dfdaabe1 volume_id:long local_id:int secret:long file_reference:bytes = InputFileLocation;
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
+inputDocumentFileLocation#bad07584 id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;
+inputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;
+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;
+
+inputStickerSetEmpty#ffb62b95 = InputStickerSet;
+inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;
+inputStickerSetShortName#861cc8a0 short_name:string = 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;
+
+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;
+
    +
  • +

    For photos, inputPhotoFileLocation is used:

    +
      +
    • id, file_reference and access_hash taken from the photo constructor
    • +
    • thumb_size taken from the type field of the desired PhotoSize of the photo
    • +
    +
  • +
  • +

    For 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:

    +
      +
    • peer is the identifier of the peer whose photo we want to download
    • +
    • volume_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)
    • +
    +
  • +
  • +

    For documents, inputDocumentFileLocation is used:

    +
      +
    • id, file_reference and access_hash taken from the document constructor
    • +
    • If downloading the thumbnail of a document, thumb_size should be taken from the type field of the desired PhotoSize of the photo; otherwise, provide an empty string.
    • +
    +
  • +
  • +

    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 previews of sticker sets, inputStickerSetThumb is used (note: to download stickers and previews of stickers use the document method described above):

    + +
  • +
  • +

    For 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):

    +
      +
    • All fields are taken from the previously cached fileLocation except for id, file_reference and access_hash taken from the photo constructor
    • +
    +
  • +
+

The size of each file in bytes is available, which makes it possible to download the file in parts using the parameters offset and limit, similar to the way files are uploaded.

+

If precise flag is not specified, then

+
    +
  • The parameter offset must be divisible by 4 KB.
  • +
  • The parameter limit must be divisible by 4 KB.
  • +
  • 1048576 (1 MB) must be divisible by limit.
  • +
+

If precise is specified, then

+
    +
  • The parameter offset must be divisible by 1 KB.
  • +
  • The parameter limit must be divisible by 1 KB.
  • +
  • limit must not exceed 1048576 (1 MB).
  • +
+

In any case the requested part should be within one 1 MB chunk from the beginning of the file, i. e.

+
    +
  • offset / (1024 * 1024) == (offset + limit - 1) / (1024 * 1024).
  • +
+

The file download operation may return a FILE_REFERENCE_EXPIRED error (or another error starting with FILE_REFERENCE_): in this case, the file_reference field of the input location must be refreshed. +The file download operation may return an upload.fileCdnRedirect constructor: in this case, these instructions must be followed for downloading CDN files. +The file download operation may also return one of the following data input errors:

+
    +
  • FILE_ID_INVALID: The file address is invalid
  • +
  • OFFSET_INVALID: The offset value is invalid
  • +
  • LIMIT_INVALID: The limit value is invalid
  • +
  • FILE_MIGRATE_X: The file is in the datacenter No. X
  • +
+

Verifying downloaded chunks

+
fileHash#6242c773 offset:int limit:int hash:bytes = FileHash;
+
+---functions---
+
+upload.getFileHashes#c7025931 location:InputFileLocation offset:int = Vector<FileHash>;
+

In order to confirm the integrity of the downloaded file, clients are recommended to verify hashes for each downloaded part, as for CDN DCs. +upload.getFileHashes contain FileHash constructors. Each of these constructors contains the SHA-256 hash of a part of the file that starts with 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.

+

Handling audio, video and vector previews

+

Scheme:

+
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;
+photoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;
+photoSizeProgressive#5aa86a51 type:string location:FileLocation 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;
+
+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;
+
+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;
+

Telegram attaches a vector of thumbnails with reduced resolution to all uploaded media.
+The server also generates a trimmed and scaled down video preview for videos, GIFs and animated profile pictures.

+

Image thumbnail types

+

Each photo preview has a specific type, indicating the resolution and image transform that was applied server-side.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeImage filterSize
sbox100x100
mbox320x320
xbox800x800
ybox1280x1280
wbox2560x2560
acrop160x160
bcrop320x320
ccrop640x640
dcrop1280x1280
+

Special types:

+ + + + + + + + + + + + + + + + + +
TypeImage filter
istrip
joutline
+

Stripped thumbnails

+
photoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;
+

A photoStrippedSize (with type i) is an extremely low-res thumbnail, embedded directly inside media location objects.
+It should be shown to the user in chat message previews, or while still downloading the most appropriately sized photoSize through the media DCs as described above.

+

The stripped bytes payload should be inflated to a JPG payload as seen here ».

+

Vector thumbnails

+
photoPathSize#d8214d41 type:string bytes:bytes = PhotoSize;
+

Messages with animated stickers can have a compressed svg (< 300 bytes) to show the outline of the sticker before fetching the actual lottie animation. +Animated sticker outlines will have a j type photoPathSize thumbnail.

+

This specific vector thumbnail consists in an SVG path, specially encoded to save space.
+This path will be the outline of the animated sticker, and should be shown to the user while downloading the actual sticker.

+

As for stripped sizes, the payload should be inflated using the following algorithm:

+
encoded := photoPathSize.bytes
+
+lookup := "AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,"
+
+path := "M"
+
+len := strlen(encoded)
+for (i = 0; i < len; i++) {
+  num := ord(encoded[i])
+  if (num >= 128 + 64) {
+    path += lookup[num - 128 - 64]
+  } else {
+    if (num >= 128) {
+      path += ','
+    } else if (num >= 64) {
+      path += '-'
+    }
+    path += itoa(num & 63)
+  }
+}
+path += "z"
+

path will contain the actual SVG path that can be directly inserted in the d attribute of an svg <path> element:

+
<?xml version="1.0" encoding="utf-8"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
+   viewBox="0 0 512 512" xml:space="preserve">
+<path d="{$path}"/>
+</svg>
+

Video types

+
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.

+ + + + + + + + + + + + + + + + + + + + +
TypeDescriptionFormat
uAnimated profile pictureMPEG4
vVideo previewMPEG4
+

Downloading webfiles

+

Remote HTTP files sent by inline bots in response to inline queries and in other places are represented by WebDocument constructors. +When forwarding such remote HTTP files, they should be sent using external InputMedia constructors. +Remote HTTP files can only be downloaded directly by the client if contained in a webDocumentNoProxy constructor: in this case, the file is deemed safe to download (this is the case for HTTPS files from certain trusted domains).

+

However, if the remote file is contained in a webDocument, to avoid leaking sensitive information the file must be downloaded through telegram's servers. +This can be done in a manner similar to normal files, with the difference that upload.getWebFile must be used, instead.

+
upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+ ---functions---
+
+upload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;
+

The InputWebFileLocation constructor is generated as follows.

+
inputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation;
+inputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w:int h:int zoom:int scale:int = InputWebFileLocation;
+
+webDocument#1c570ed1 url:string access_hash:long size:int mime_type:string attributes:Vector<DocumentAttribute> = WebDocument;
+
+inputGeoPoint#48222faf flags:# lat:double long:double accuracy_radius:flags.0?int = InputGeoPoint;
+
+geoPoint#b2a2f663 flags:# long:double lat:double access_hash:long accuracy_radius:flags.0?int = GeoPoint;
+
    +
  • inputWebFileLocation is simply generated by taking the url and access_hash fields of the webDocument constructor.
  • +
  • inputWebFileGeoPointLocation is used to download a server-generated image with the map preview from a geoPoint.
      +
    • geo_point is generated from the lat, long accuracy_radius parameters of the geoPoint
    • +
    • access_hash is the access hash of the geoPoint
    • +
    • w - Map width in pixels before applying scale; 16-1024
    • +
    • h - Map height in pixels before applying scale; 16-1024
    • +
    • zoom - Map zoom level; 13-20
    • +
    • scale - Map scale; 1-3
    • +
    +
  • +
+

General Considerations

+

It is recommended that large queries (upload.getFile, upload.saveFilePart, upload.getWebFile) be handled through a separate session and a separate connection, in which no methods other than these should be executed. If this is done, then data transfer will cause less interference with getting updates and other method calls.

+

Related articles

+

Handling file references

+

How to handle file references.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/folders.html b/data/core.telegram.org/api/folders.html new file mode 100644 index 0000000000..93daeb805d --- /dev/null +++ b/data/core.telegram.org/api/folders.html @@ -0,0 +1,179 @@ + + + + + Folders + + + + + + + + + + + + + +
+ +
+
+
+ +

Folders

+ +
+ +

Telegram allows placing chats into folders, based on their type, mute status, or other custom criteria, thanks to folder blacklists and whitelists.
+In the API, folders are called "dialog filters"; in the UI, they are typically represented as tabs.

+

Scheme:

+
dialogFilter#7438f7e8 flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true id:int title:string emoticon:flags.25?string pinned_peers:Vector<InputPeer> include_peers:Vector<InputPeer> exclude_peers:Vector<InputPeer> = DialogFilter;
+
+dialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested;
+
+updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;
+updateDialogFilterOrder#a5d72105 order:Vector<int> = Update;
+updateDialogFilters#3504914f = Update;
+
+---functions---
+
+messages.getDialogFilters#f19ed96d = Vector<DialogFilter>;
+messages.getSuggestedDialogFilters#a29cd42c = Vector<DialogFilterSuggested>;
+messages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool;
+messages.updateDialogFiltersOrder#c563c1e4 order:Vector<int> = Bool;
+
+help.getAppConfig#98914110 = JSONValue;
+

Folders

+

On startup, clients call:

+ +

The boolean under the dialog_filters_tooltip JSON key in the result of help.getAppConfig can be used to determine whether a folder tooltip should be presented to the user right away.
+The UI should then show a list of suggested folder combinations.

+

Once configuration is finished, apps call messages.updateDialogFilter to create or update existing folders.
+As per the dialogFilter constructor, folders have multiple flags that can be combined to determine which chats should be included in (or excluded from) the folder.
+Folders can also have unlimited pinned chats, as determined by the pinned_peers field.

+

To reorder existing folders, messages.updateDialogFiltersOrder should be used with the IDs of the various dialog filters.

+

To delete folders, use messages.updateDialogFilter without populating the filter flag field.

+

Clients can receive updateDialogFilter, updateDialogFilterOrder updates with new filter information, generated by other clients when modifying folder info.
+Clients can also receive updateDialogFilters, in which case folder info should be refetched manually using messages.getDialogFilters.

+

Peer folders

+

The API also has another method for identifying groups of peers, typically used only by archived chats.

+

Scheme:

+
inputDialogPeer#fcaafeb7 peer:InputPeer = InputDialogPeer;
+inputDialogPeerFolder#64600527 folder_id:int = InputDialogPeer;
+
+dialogPeer#e56dbf05 peer:Peer = DialogPeer;
+dialogPeerFolder#514519e2 folder_id:int = DialogPeer;
+
+updateFolderPeers#19360dc0 folder_peers:Vector<FolderPeer> pts:int pts_count:int = Update;
+
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+
+---functions---
+
+folders.editPeerFolders#6847d0ab folder_peers:Vector<InputFolderPeer> = Updates;
+folders.deleteFolder#1c295881 folder_id:int = Updates;
+

API peer folders are typically used only by archived chats, and are really handy for distinguishing groups of peers, since most peer-related constructors (updates, chat info) will contain the folder_id assigned the the specified chat.

+

In Telegram apps, API peer folders are used only to implement the chat archive, identified by folder_id 1; all other peers are in folder_id 0 by default; no other folder_id is allowed at the moment.

+
    +
  • folders.editPeerFolders can be used to add and remove peers from peer folders.
  • +
  • folders.deleteFolder can be used to delete peer folders, moving all peers previously present in that folder to the default 0 folder.
  • +
+

Both methods return an updates constructor, containing a single updateFolderPeers with the new folder_id of moved peers.
+Clients can also receive updateFolderPeers as a normal update, generated by other clients when modifying peer folders.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/geochats.html b/data/core.telegram.org/api/geochats.html new file mode 100644 index 0000000000..703ed750f7 --- /dev/null +++ b/data/core.telegram.org/api/geochats.html @@ -0,0 +1,115 @@ + + + + + Nope + + + + + + + + + + + + + +
+ +
+
+
+ +

Nope

+ +

Deprecated old docs. This was definitely not the droid you were looking for.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/invoking.html b/data/core.telegram.org/api/invoking.html new file mode 100644 index 0000000000..13e792b8c4 --- /dev/null +++ b/data/core.telegram.org/api/invoking.html @@ -0,0 +1,155 @@ + + + + + Calling API Methods + + + + + + + + + + + + + +
+ +
+
+
+ +

Calling API Methods

+ +
+ +

Layers

+

Versioning in the API is supported by so-called TL layers.

+

The need to add a new object constructor or to add/remove a field in a constructor creates a backwards compatibility problem for previous versions of API clients. After all, simply changing a constructor in a schema also changes its number. To address this problem, each schema update is separated into a layer. +A layer is a collection of updated methods or constructors in a TL schema. Each layer is numbered with sequentially increasing numbers starting with 2. The first layer is the base layer -- the TL schema without any changes.

+

There is helper method to let the API know that a client supports Layer layer:

+
invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;
+

The helper method invokeWithLayer can be used only together with initConnection: the present layer will be saved with all other parameters of the client and future calls will be using this saved value. See more below..

+

List of Available Layers

+

Saving Client Info

+

It is possible to save information about the current client on the server in conjunction with an authorization key. This may help eliminate client-side problems with certain releases on certain devices or with certain localizations, as well as eliminate the need for sending layer information in each call.

+

The helper method initConnection accepts client parameters. This method must be called when first calling the API after the application has restarted or in case the value of one of the parameters could have changed.

+

initConnection must also be called after each auth.bindTempAuthKey.

+

When calling this method, the current layer used by the client is also saved (the layer in which initConnection was wrapped is used). After a successful call to initConnection it is no longer necessary to wrap each API call in invokeWithLayerN.

+

Disabling updates

+
invokeWithoutUpdates#bf9459b7 {X:Type} query:!X = X;
+

invokeWithoutUpdates can be used to invoke a request without subscribing the used connection for updates (this is enabled by default for file queries).

+

Sequential Calls

+

Sometimes a client needs to transmit several send message method calls to the server all at once in a single message or in several consecutive messages. However, there is a chance that the server may execute these requests out of order (queries are handled by different servers to improve performance, which introduces a degree of randomness to the process).

+

There are helper methods for making several consecutive API calls without wasting time waiting for a response:

+
+

invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
+invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector query:!X = X;

+
+

They may be used, for example, if a client attempts to send accumulated messages after the Internet connection has been restored after being absent for a long time. In this case, the 32-bit number 0xcb9f372d must be added before the method number in each call, followed by a 64-bit message identifier, msg_id, which contains the previous call in the queue. +The second method is similar, except it takes several messages that must be waited for.

+

If the waiting period exceeds 0.5 seconds (this value may change in the future) and no result has appeared, the method will be executed just the same. If any of the queries returns an error, all its dependent queries will also return the 400 MSG_WAIT_FAILED error.

+

Helper Method Sequence

+

Important: if the helper methods invokeAfterMsg / invokeAfterMsgs are used together with invokeWithLayerN or other helper methods, invokeAfterMsg / invokeAfterMsgs must always be the outermost wrapper.

+

Data Compression

+

We recommend using gzip compression when making method calls in order to reduce the amount of network traffic.

+

The schema and constructor information are given in the protocol documentation.

+

Data Compression when Making a Call

+

Before transmitting a query, the string containing the entire body of the serialized high-level query (starting with the method number) must be compressed using gzip. If the resulting string is smaller than the original, it makes sense to transmit the gzip_packed constructor.

+

There is no point in doing the above when transmitting binary multimedia data (photos, videos) or small messages (up to 255 bytes).

+

Uncompressing Data

+

By default, the server compresses the response to any call as well as updates, in accordance with the rules stated above. If the gzip_packed constructor is received as a response in rpc_result, then the string that follows must be extracted and uncompressed. Processing then continues on the resulting new string.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/live-location.html b/data/core.telegram.org/api/live-location.html new file mode 100644 index 0000000000..d6b8d19956 --- /dev/null +++ b/data/core.telegram.org/api/live-location.html @@ -0,0 +1,178 @@ + + + + + Live geolocation + + + + + + + + + + + + + +
+ +
+
+
+ +

Live geolocation

+ +
+ +

Telegram allows sending the live geolocation of a user in a chat, optionally setting a proximity alert.

+

Sending live locations

+
inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
+
+inputGeoPoint#48222faf flags:# lat:double long:double accuracy_radius:flags.0?int = InputGeoPoint;
+
+inputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia;
+
+---functions---
+
+messages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int = Updates;
+
+messages.editMessage#48f71778 flags:# no_webpage:flags.1?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int = Updates;
+

To send a live geolocation, use messages.sendMedia with an inputMediaGeoLive media .

+

The inputMediaGeoLive allows sending the geolocation as an inputGeoPoint with floating point latitude and longitude, with an optional accuracy_radius in meters.
+Clients can also provide a heading, a direction in degrees (1-360) that can be used to indicate the direction of the user, a validity period for the current location, and a proximity_notification_radius .

+

The sent geolocation should be updated perioducally using messages.editMessage at most every period seconds, in order to implement the "live" part of live geolocations.

+

To stop sharing the location, pass inputGeoPointEmpty as location and set the stopped flag to true in a last messages.editMessage call.

+

Receiving live locations

+
geoPoint#b2a2f663 flags:# long:double lat:double access_hash:long accuracy_radius:flags.0?int = GeoPoint;
+messageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia;
+
+updateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;
+

Clients will receive a message with a messageMediaGeoLive, containing the information passed by the sender; when the geolocation message is marked as read, an updateGeoLiveViewed is generated.

+

Periodically, the geolocation will be updated with updateEditMessage/updateEditChannelMessage updates.

+

Live location previews

+
inputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w:int h:int zoom:int scale:int = InputWebFileLocation;
+
+inputGeoPoint#48222faf flags:# lat:double long:double accuracy_radius:flags.0?int = InputGeoPoint;
+
+---functions---
+
+upload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;
+

A map preview can be generated by passing the received geoPoint to upload.getWebFile, to download an image preview of the map.

+
    +
  • geo_point is generated from the lat , long accuracy_radius parameters of the geoPoint
  • +
  • access_hash is the access hash of the geoPoint
  • +
  • w - Map width in pixels before applying scale; 16-1024
  • +
  • h - Map height in pixels before applying scale; 16-1024
  • +
  • zoom - Map zoom level; 13-20
  • +
  • scale - Map scale; 1-3
  • +
+

The image is then downloaded as specified here »

+

Proximity alert

+
messageActionGeoProximityReached#98e0d697 from_id:Peer to_id:Peer distance: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;
+

If:

+
    +
  • A user sets a proximity_notification_radius when sending a location
  • +
  • Multiple users share their location within the same chat
  • +
  • One of the other users comes within proximity_notification_radius meters of the first user, and updates their location accordingly
  • +
+

An updateNewMessage/updateNewChannelMessage is generated for all chat members, containing a messageService with action messageActionGeoProximityReached:

+
    +
  • messageActionGeoProximityReached.to_id is the peer that enabled proximity alerts
  • +
  • messageActionGeoProximityReached.from_id is the peer that is now in proximity of messageActionGeoProximityReached.to_id
  • +
  • messageActionGeoProximityReached.distance is the distance between them, in meters
  • +
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/mentions.html b/data/core.telegram.org/api/mentions.html new file mode 100644 index 0000000000..a2fe10611f --- /dev/null +++ b/data/core.telegram.org/api/mentions.html @@ -0,0 +1,152 @@ + + + + + Mentions + + + + + + + + + + + + + +
+ +
+
+
+ +

Mentions

+ +
+ +

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.

+
messageEntityMention#fa04579d offset:int length:int = MessageEntity;
+messageEntityMentionName#352dca58 offset:int length:int user_id:int = MessageEntity;
+inputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity;
+
+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;
+
+channelParticipantsMentions#e04b5ceb flags:# q:flags.0?string top_msg_id:flags.1?int = ChannelParticipantsFilter;
+
+---functions---
+
+messages.sendMessage#520c3870 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int = Updates;
+
+channels.getParticipants#123e05e9 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:int = channels.ChannelParticipants;
+

Mentions are implemented as message entities, passed to the messages.sendMessage method:

+ +

Incoming messages mentioning to the current user will have the mentioned flag set, and will contain one or more messageEntityMention and messageEntityMentionName constructors.

+

Graphical clients can show a list of mentionable users when the user starts entering an @ in the text bar; for this purpose, the channelParticipantsMentions filter can be used in channels.getParticipants.
+This filter can be enhanced by providing an additional query string q (anything the user enters after @); it will also return non-participant users, in case of channel users commenting in post comment sections.

+

Dialog mentions

+
dialog#2c171f72 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog;
+
+---functions---
+
+messages.getUnreadMentions#46578472 peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;
+messages.readMentions#f0189d3 peer:InputPeer = messages.AffectedHistory;
+

Graphical clients are supposed to show a blue mention indicator next to the message counter of chats in the dialog list.
+The dialog constructor contains an unread_mentions_count field to isolate chats with unread mentions; the actual mention counter should be shown inside of the chat itself, above an @ button that can be used, by clicking multiple times, to navigate back (using messages.getUnreadMentions) through the mention history.

+

When the last unread mention is read, or when long-clicking on the @ button, all mentions for a chat should marked as read using messages.readMentions.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/min.html b/data/core.telegram.org/api/min.html new file mode 100644 index 0000000000..887c326ac9 --- /dev/null +++ b/data/core.telegram.org/api/min.html @@ -0,0 +1,142 @@ + + + + + Min constructors + + + + + + + + + + + + + +
+ +
+
+
+ +

Min constructors

+ +

In some situations user and channel constructors have reduced set of fields present (although id is always there) and min flag set. This is done for performance and privacy reasons.

+

When receiving said constructors, the client must first check if user or chat object without min flag is already present in local cache. If it is present, then the client should just ignore constructors with min flag and use local one instead.

+

The rest of article assumes the client receives min-constructor without full object in local cache.

+

The client must store the context (similar to file references) in which the user/channel was seen. Later, when the client needs to pass the user/channel as input argument (e.g. fetch profile, mute, ban etc), the context is used to generate the input*FromMessage constructor, instead of normal inputUser, inputChannel or inputPeer.

+ +

The access_hash value, if present, is only suitable to use in inputPeerPhotoFileLocation, to directly download the profile pictures of channels and users without having to generate an inputPeer*FromMessage, simply using inputPeer* with the specified access hash.

+

Usually min constructors are encountered in messages inside of groups or channels. +When a message mentioning (sender, forwarder or forwardee, et cetera) such a user or channel is found, the constuctor must be associated with the message ID of the message and with the chat where the message was seen.

+

Example

+

Assume a message with id 34 is received from supergroup (actually channel) 123456789. +Said message was sent by from_id 102424212. +The updates container that contained the message has a user with ID 102424212 in the users field, but it has the min flag set, and the provided access_hash may be absent, or otherwise can't be used to generate a typical inputPeerUser constructor to send messages or do other actions.

+

What the client does is associate 102424212 with the channel 123456789 and message ID 34. +When and if the client will need to interact with user 102424212, it will generate one of the *FromMessage constructors mentioned above, setting:

+
    +
  • msg_id to 34
  • +
  • peer to the InputPeer associated with channel 123456789
  • +
  • user_id to 102424212
  • +
+

user_id can also be set to the IDs of users met in the fwd_header (messages forwarded from a user can be used to interact with the original sender, if they don't have privacy settings for forwards enabled). +Users mentioned via messageEntityMentionName in a message can also be used.

+

The same can be done with min channels.

+

Example implementations: Telegram for iOS, tdlib.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/obtaining_api_id.html b/data/core.telegram.org/api/obtaining_api_id.html new file mode 100644 index 0000000000..10d2f80e72 --- /dev/null +++ b/data/core.telegram.org/api/obtaining_api_id.html @@ -0,0 +1,140 @@ + + + + + Creating your Telegram Application + + + + + + + + + + + + + +
+ +
+
+
+ +

Creating your Telegram Application

+ +

We welcome all developers to use our API and source code to create Telegram-like messaging applications on our platform free of charge.

+
+

In order to ensure consistency and security across the Telegram ecosystem, +all third-party client apps must comply with the API Terms of Service.

+
+

Obtaining api_id

+

In order to obtain an API id and develop your own application using the Telegram API you need to do the following:

+
    +
  • Sign up for Telegram using any application.
  • +
  • Log in to your Telegram core: https://my.telegram.org.
  • +
  • Go to 'API development tools' and fill out the form.
  • +
  • You will get basic addresses as well as the api_id and api_hash parameters required for user authorization.
  • +
  • For the moment each number can only have one api_id connected to it.
  • +
+

We will be sending important developer notifications to the phone number that you use in this process, so please use an up-to-date number connected to your active Telegram account.

+

Using the api_id

+

Before using the MTProto Telegram API, please note that all API client libraries are strictly monitored to prevent abuse.

+

If you use the Telegram API for flooding, spamming, faking subscriber and view counters of channels, you will be banned forever.

+

Due to excessive abuse of the Telegram API, all accounts that sign up or log in using unofficial Telegram API clients are automatically put under observation to avoid violations of the Terms of Service.

+

If you didn't violate the Terms of Service but your account does get banned after using the API, write to recover@telegram.org explaining what you intend to do with the API, asking to unban your account.
+Please note that emails are checked by a human, so automatically generated emails will be detected and banned.

+

Using Telegram's open source code

+

Everyone is welcome to use our open source code. We have included a sample API id with the code. This API id is limited on the server side and is not suitable for apps released to end-users — using it for anything but testing purposes will result in the API_ID_PUBLISHED_FLOOD error for your users. It is necessary that you obtain your own API id before you publish your app.

+
+

Please remember to publish your code as well in order to comply with the GNU GPL licences.

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/offsets.html b/data/core.telegram.org/api/offsets.html new file mode 100644 index 0000000000..450c35c847 --- /dev/null +++ b/data/core.telegram.org/api/offsets.html @@ -0,0 +1,165 @@ + + + + + Pagination in the API + + + + + + + + + + + + + +
+ +
+
+
+ +

Pagination in the API

+ +
+ +

Lots of Telegram API methods provide access to potentially large lists of objects, which requires pagination.

+

In order to fetch only relevant subset of results for each request there is a number of available input parameters. Here is a list in order how they are applied in API.

+

Typically, results are returned in antichronological order with descending object ID values.

+

limit parameter

+

A limit on the number of objects to be returned, typically between 1 and 100. When 0 is provided the limit will often default to an intermediate value like ~20.

+

offset-based pagination

+

For a few methods with mostly static data this parameter allows to skip offset elements from the beginning of list; negative values are ignored.

+

offset_id-based pagination

+

For most methods where results are real-time data (e.g. any chat history) offset value is not passed directly. Instead it is calculated from the passed offset_id and add_offset parameter values as offsetFromID(offset_id) + add_offset, where offsetFromID(offset_id) is a number of results from the beginning of list up to the result with ID offset_id, inclusive.

+

Sample use cases:

+
    +
  • +

    Loading 20 messages, older than message with ID MSGID:

    +

    messages.getHistory({offset_id: MSGID, add_offset: 0, limit: 20})

    +
  • +
  • +

    Loading 20 messages, newer than message with ID MSGID:

    +

    messages.getHistory({offset_id: MSGID, add_offset: -20, limit: 20})

    +
  • +
  • +

    Loading 20 messages around message with ID MSGID:

    +

    messages.getHistory({offset_id: MSGID, add_offset: -10, limit: 20})

    +
  • +
+

Additional filtering

+

There is a number of parameters, which are applied to the list after slicing with offset and limit, to reduce the result subset even more:

+
    +
  • max_id: Can be used to only return results with ID strictly smaller than max_id (e.g. message ID)
  • +
  • min_id: Can be used to only return results with ID strictly greater than min_id(e.g. message ID)
  • +
  • max_date: Can be used to only return results that are older than max_date:
  • +
  • min_date: Can be used to only return results with are newer than min_date:
  • +
  • hash: See below.
  • +
+

Hash generation

+

To further reduce the result subset, there is a mechanism to avoid fetching data if the resulting list hasn't changed from the one stored on client, similar to ETag.

+

When the client has cached results for API request, it can calculate the hash value for it by taking the result IDs (message IDs or other fields with name id) and using them to compute a 32-bit hash with the following algorithm:

+
hash = 0
+for id in ids:
+    hash = (((hash * 0x4F25) & 0x7FFFFFFF) + id) & 0x7FFFFFFF
+

In some cases, the result container already has a hash field, that can be used instead.

+

When the client passes a correct value, the API will return one of *NotModified constructors, e.g. messages.messagesNotModified instead of the actual results.

+

Example methods

+
    +
  • messages.getHistory supports all result navigation parameters including message ID hashes and except filters
  • +
  • channels.getParticipants supports simple navigation using limit and offset, along with filtering and hash reducing using the user IDs of returned participants
  • +
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/optimisation.html b/data/core.telegram.org/api/optimisation.html new file mode 100644 index 0000000000..807d38d2e7 --- /dev/null +++ b/data/core.telegram.org/api/optimisation.html @@ -0,0 +1,150 @@ + + + + + Client-Side Optimization + + + + + + + + + + + + + +
+ +
+
+
+ +

Client-Side Optimization

+ +

Simplified Acknowledgment of Message Delivery

+

An outgoing message may be considered sent once the server has assigned it an identifier. Normally, a client would learn of this from the result of the messages.sendMessage method. +The MTProto server provides a mechanism for “quick acknowledgments". Upon receiving such an acknowledgment, the client may be certain that the call to the send message method has at least been fully received by the server and placed in a processing queue, and can inform the user that the delivery was successful. +It is possible that the server’s actual response will never be received by the client (an interrupted connection; or the app restarts at exactly the wrong time). To correctly handle these situations, you can use a special type of notification generated by the server when updates.getDifference is called: updateMessageID. When processing this notification, the client can use the random_id identifier to associate the previously transmitted message with the one delivered to the server. +If such a notification is not issued when updates.getDifference is called for one of the previously sent messages, the message must be marked as undelivered.

+

Server Salt

+

Server salt is a 64-bit number added to every outgoing and incoming message. At present, a single salt’s lifespan is 1 hour, following which it is considered invalid and the server will return an error for all the messages that contain it. The error message will contain the correct salt, which may be immediately used for sending. Given this approach, there will always be a period of waiting before the client receives a new salt if it connects to the server less frequently than once an hour. +For improved performance, there is a special get_future_salts method, which fetches in advance a list of the salts that will be valid during the course of a specified period of time following the call (1 day, for example). A start time and an end time are specified for each salt. The salts overlap one another by half an hour. We recommend always using the record with the longest remaining lifespan.

+

Downloading Files and Uploading Data to the Server

+

We recommend that separate connections and sessions be created for these tasks. Remember that the extra sessions must be deleted when no longer needed. +It makes sense to download files over several connections (optimally to have a pool). When uploading data to a server one connection is enough to achieve the best results.

+

The file handling API is designed to perform data operations in parts. In its simplest implementation, the process of uploading files to a server looks like this: send a query, wait for a response, send the next query, etc. This approach does not optimize the use of network resources and the ping time has a huge effect. +The upload and download process is optimal when two or more queries are continuously being executed through one connection. In this arrangement, uploading to the server would look like this:

+
    +
  1. Send Query 1
  2. +
  3. Send Query 2
  4. +
  5. Wait for a response to Query 1
  6. +
  7. Send Query 3
  8. +
  9. Wait for a response to Query 2
  10. +
  11. Send Query 4
  12. +
  13. etc.
  14. +
+

This will help reduce the effect of ping latency and maximize the channel workload.

+

Sending Messages in Bulk

+

Sometimes a client needs to transmit several send message method calls to the server all at once in a single message or in several consecutive messages. However, the server may execute these requests out of order (queries are handled by different servers to improve performance, which introduces a degree of randomness to the process). +This requires that dependencies be explicitly stated when processing queries by using the function

+
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
+

Actually, this means padding the beginning of the query with the 32-bit number 0xcb9f372d and the 64-bit message identifier of the query on which the current query is dependent.

+

Grouping Updates

+

Generating updates (notifications about various server events) and delivering them to the client form two different parts of the system (respectively, the messenger API and MTProto). By itself, MTProto cannot modify in any way the data transmitted to the client, and the server API cannot respond to client-MTProto connection events. +Imagine the situation where a client loses its connection (or is intentionally disconnected from the network) for some time. If lots of different events occur before a new connection is established (contacts come online, typing event messages are sent), then when a connection is established the client will receive lots of data containing all of the intervening events, despite the fact that most of the data is obsolete. +The grouping of messages has been introduced to optimize such situations. If new events occur and the client has not managed to “collect” the previously generated updates, then the server API can combine them into a single package.

+

A client is able to control when the MTProto server begins to consider that the connection has been lost and grouping can begin (the earlier this occurs when there is no connection, the better for the client). This functionality is implemented through a special type of Ping message, ping_delay_disconnect, which specifies a time delay following which the server will close the current connection and start grouping messages.

+

It makes sense to combine the transmission of ping_delay_disconnect with that of other recurring tasks, such as updating the user status (account.updateStatus).

+

Setting the Typing Status

+

If a contact is not online, there is no need to invoke messages.setTyping.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/passport.html b/data/core.telegram.org/api/passport.html new file mode 100644 index 0000000000..1edc0cfedb --- /dev/null +++ b/data/core.telegram.org/api/passport.html @@ -0,0 +1,674 @@ + + + + + Telegram passport + + + + + + + + + + + + + +
+ +
+
+
+ +

Telegram passport

+ +
+ +

Telegram Passport is a unified authorization method for services that require personal identification. Users can upload their documents once, then instantly share their data with services that require real-world ID (finance, ICOs, etc.). Telegram doesn‘t have access to the users’ personal information thanks to end-to-end encryption.

+

This page describes the request flow that client apps must used to send the requested data to the service.

+

Overview

+

From the perspective of a service that requires real-world ID, the process looks like this:

+
    +
  • A user presses “Log in with Telegram” on your website or in your app.
  • +
  • You request the data you need.
  • +
  • The user accepts your privacy policy and agrees to share their data.
  • +
  • The user's Telegram app downloads and decrypts the data you requested from the end-to-end encrypted storage on Telegram.
  • +
  • If some of the data you requested is missing, the user can add it to their Telegram Passport at this point.
  • +
  • The user's app encrypts the data with your public key and sends it to you.
  • +
  • You decrypt the data, check it for errors and re-request any missing or invalid information.
  • +
  • You sign the user up for your service. Tada!
  • +
+

See As a bot to see how to request passport data using a bot, through the MTProto API. +Look at the Passport Manual to see how to request passport data using a bot, through the simplified bot API.

+

From the perspective of a user, the process looks something like this:

+
    +
  • Your app receives an event/intent from one of the SDKs, or from a custom source.
  • +
  • The user accepts your privacy policy and agrees to share their data.
  • +
  • The user's Telegram app downloads the data you requested from the end-to-end encrypted storage on Telegram.
  • +
  • If some of the data you requested is missing, the user can add it to their Telegram Passport at this point.
  • +
  • The user's app encrypts the data with your public key and sends it to the service.
  • +
  • You sign the user up for your service. Tada!
  • +
+

See As a user to see how user client apps should send passport data to a service, through the MTProto API.

+

As a bot

+

A simplified version of this process can be used using the bot API, for more info see the Passport Manual.

+

Using the MTProto API, the process is pretty much the same, up until the actual API calls.

+
+

Note that all binary fields are in raw binary format, unlike in the bot API where they are base64-encoded

+
+

Setting Up Telegram Passport

+

As per the bot API.

+

Requesting Information

+

As per the bot API.

+

Receiving information

+

Scheme:

+
secureData#8aeabec3 data:bytes data_hash:bytes secret:bytes = SecureData;
+
+securePlainPhone#7d6099dd phone:string = SecurePlainData;
+securePlainEmail#21ec5a5f email:string = SecurePlainData;
+
+secureFile#e0277a62 id:long access_hash:long size:int dc_id:int date:int file_hash:bytes secret:bytes = SecureFile;
+
+secureValueTypePersonalDetails#9d2a81e3 = SecureValueType;
+secureValueTypePassport#3dac6a00 = SecureValueType;
+secureValueTypeDriverLicense#6e425c4 = SecureValueType;
+secureValueTypeIdentityCard#a0d0744b = SecureValueType;
+secureValueTypeInternalPassport#99a48f23 = SecureValueType;
+secureValueTypeAddress#cbe31e26 = SecureValueType;
+secureValueTypeUtilityBill#fc36954e = SecureValueType;
+secureValueTypeBankStatement#89137c0d = SecureValueType;
+secureValueTypeRentalAgreement#8b883488 = SecureValueType;
+secureValueTypePassportRegistration#99e3806a = SecureValueType;
+secureValueTypeTemporaryRegistration#ea02ec33 = SecureValueType;
+secureValueTypePhone#b320aadb = SecureValueType;
+secureValueTypeEmail#8e3ca7ee = SecureValueType;
+
+secureValue#187fa0ca flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?SecureFile reverse_side:flags.2?SecureFile selfie:flags.3?SecureFile translation:flags.6?Vector<SecureFile> files:flags.4?Vector<SecureFile> plain_data:flags.5?SecurePlainData hash:bytes = SecureValue;
+
+secureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted;
+
+messageActionSecureValuesSentMe#1b287353 values:Vector<SecureValue> credentials:SecureCredentialsEncrypted = 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;
+
+updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
+

When the user confirms your request by pressing the 'Authorize' button, the MTProto API sends an updateNewMessage from the user, with a messageService constructor, containing a messageActionSecureValuesSentMe constructor that contains the encrypted Telegram Passport data.

+

Decrypting data

+
secureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted;
+
+messageActionSecureValuesSentMe#1b287353 values:Vector<SecureValue> credentials:SecureCredentialsEncrypted = MessageAction; 
+

To decrypt the received data, first, decrypt the credentials contained in secureCredentialsEncrypted.

+
    +
  1. +

    Decrypt the credentials secret ( secret field in secureCredentialsEncrypted) using your private key (set OAEP padding option, e.g. OPENSSL_PKCS1_OAEP_PADDING in PHP)

    +
  2. +
  3. +

    Use this secret and the credentials hash ( hash field in secureCredentialsEncrypted) to calculate credentials_key and credentials_iv as described below:

    +
     credentials_secret_hash = SHA512( credentials_secret + credentials_hash )
    + credentials_key = slice( credentials_secret_hash, 0, 32 )
    + credentials_iv = slice( credentials_secret_hash, 32, 16 )
    +
  4. +
  5. +

    Decrypt the credentials data ( data field in secureCredentialsEncrypted) by AES256-CBC using these credentials_key and credentials_iv. IMPORTANT: At this step, make sure that the credentials hash is equal to SHA256( credentials_data )

    +
  6. +
  7. +

    Credentials data is padded with 32 to 255 random padding bytes to make its length divisible by 16 bytes. The first byte contains the length of this padding (including this byte). Remove the padding to get the data.

    +
  8. +
+
+

Note that all hashes are raw binary data, not hexits

+
+

Credentials

+

The credentials are a JSON-serialized object, structured exactly as in the bot API ». +Since decryption credentials are E2E encrypted, apps have to store the decryption credentials as JSON and not TL payloads.

+

The credentials are used as described in the Passport Manual to decrypt the files attached to the secureValue. +In this case, the container for the E2E encrypted data is in TL, while the encrypted data itself is in JSON.

+
secureValue
+
secureValue#187fa0ca flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?SecureFile reverse_side:flags.2?SecureFile selfie:flags.3?SecureFile translation:flags.6?Vector<SecureFile> files:flags.4?Vector<SecureFile> plain_data:flags.5?SecurePlainData hash:bytes = SecureValue;
+
+messageActionSecureValuesSentMe#1b287353 values:Vector<SecureValue> credentials:SecureCredentialsEncrypted = MessageAction; 
+

The scheme for the secureValue constructor defines the constructor that can be found in each field.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
typeSecureValueTypeSecure passport value type
dataflags.0?SecureDataEncrypted Telegram Passport element data
front_sideflags.1?SecureFileEncrypted passport file with the front side of the document
reverse_sideflags.2?SecureFileEncrypted passport file with the reverse side of the document
selfieflags.3?SecureFileEncrypted passport file with a selfie of the user holding the document
translationflags.6?Vector<SecureFile>Array of encrypted passport files with translated versions of the provided documents
filesflags.4?Vector<SecureFile>Array of encrypted passport files with photos the of the documents
plain_dataflags.5?SecurePlainDataPlaintext verified passport data
hashbytesData hash
+

Here's a list of possible SecureValueTypes, and the parameters that can be set/requested when using each type.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeAllowed fields
secureValueTypeEmailplain_data
secureValueTypePhoneplain_data
secureValueTypePersonalDetailsdata
secureValueTypePassportdata, front_side, selfie, translation
secureValueTypeDriverLicensedata, front_side, reverse_side, selfie, translation
secureValueTypeIdentityCarddata, front_side, reverse_side, selfie, translation
secureValueTypeInternalPassportdata, front_side, selfie, translation
secureValueTypeAddressdata
secureValueTypeUtilityBillfiles, translation
secureValueTypeBankStatementfiles, translation
secureValueTypeRentalAgreementfiles, translation
secureValueTypePassportRegistrationfiles, translation
secureValueTypeTemporaryRegistrationfiles, translation
+
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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Chosen typeJSON object
secureValueTypePersonalDetailsPersonalDetails
secureValueTypePassportIdDocumentData
secureValueTypeDriverLicenseIdDocumentData
secureValueTypeIdentityCardIdDocumentData
secureValueTypeInternalPassportIdDocumentData
secureValueTypeAddressResidentialAddress
+

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;
+
+---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.

+
    +
  • The id field is the id of the secureFile
  • +
  • The access_hash field is the access_hash of the secureFile
  • +
+

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;
+
+
+---functions---
+
+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 ».

+

As a user

+

Receiving requests

+

The process starts when your app receives an event from one of the SDKs, or from a custom source.

+

URI format

+

The SDKs trigger a passport authorization request by opening the following Telegram-specific URI:

+
tg://resolve?params
+

With the following query string parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParametersTypeRequired
domainStringYes
bot_idIntegerYes
scopeUriPassportScopeYes
public_keyStringYes
nonceStringYes
callback_urlStringOptional
payloadStringOptional
+

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=nonce
+

UriPassportScope

+

This object represents the data to be requested.

+ + + + + + + + + + + + + + + + + + +
FieldTypeDescription
dArray of UriPassportScopeElementList of requested elements, each type may be used only once in the entire array of UriPassportScopeElement objects
vIntegerScope version, must be 1
+
UriPassportScopeElement
+

This object represents a requested element, should be one of:

+ +

Passport document type identifiers are aliased with the following reduced type identifiers:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FullAlias
personal_detailspd
passportpp
driver_licensedl
identity_cardic
internal_passportip
id_documentidd
addressad
utility_billub
bank_statementbs
rental_agreementra
passport_registrationpr
temporary_registrationtr
address_documentadd
phone_numberpn
emailem
+

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".

+

UriPassportScopeElementOneOfSeveral

+

This object represents several elements one of which must be provided.

+ + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
_Array of UriPassportScopeElementOneList of elements one of which must be provided; must contain either several of “pp”, “dl”, “ic”, “ip” or several of “ub”, “bs”, “ra”, “pr”, “tr”
sBooleanOptional. Use this parameter if you want to request a selfie with the document from this list that the user chooses to upload.
tBooleanOptional. Use this parameter if you want to request a translation of the document from this list that the user chooses to upload. Note: We suggest to only request translations after you have received a valid document that requires one.
+

UriPassportScopeElementOne

+

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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
_StringElement type. One of "pd", "pp", "dl", "ic", "ip", "ad", "ub", "bs", "ra", "pr", "tr", "pn", "em"
sBooleanOptional. Use this parameter if you want to request a selfie with the document as well. Available for "pp", "dl", "ic" and "ip"
tBooleanOptional. 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.
nBooleanOptional. 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".

+

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;
+

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 ».

+

Submitting the passport form

+
secureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted;
+
+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;
+

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.

+
    +
  • As before, 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 ».
  • +
+

Finally, the client opens the callback URL (if present).

+

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;
+
+---functions---
+
+account.getAuthorizationForm#b86ba8e1 bot_id:int 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).

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/pattern.html b/data/core.telegram.org/api/pattern.html new file mode 100644 index 0000000000..1e4d16c81f --- /dev/null +++ b/data/core.telegram.org/api/pattern.html @@ -0,0 +1,122 @@ + + + + + Pattern matching + + + + + + + + + + + + + +
+ +
+
+
+ +

Pattern matching

+ +

Some methods require the client to verify if the data obtained from an external source matches a certain pattern.

+

For example, when requesting a login code, if the chosen verification method is a flash call, it is required that the phone number (which is the login code) matches the specified pattern.

+

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.

+

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 new file mode 100644 index 0000000000..cea7b3b259 --- /dev/null +++ b/data/core.telegram.org/api/payments.html @@ -0,0 +1,366 @@ + + + + + Payments API + + + + + + + + + + + + + +
+ +
+
+
+ +

Payments API

+ +
+ +

You can accept payments from Telegram users via Telegram Bots.

+
+

Note: This article is intended for MTProto API developers. If you're looking for a general overview of Telegram Payments, check out the Telegram blog and the bot API payment manual.

+
+

Introducing Payments

+

Telegram bots can accept payments for goods and services from users. +For more info on how payments work, check out the Telegram Blog and the bot API payment manual.

+

This page will elaborate on the actions required to work with payments using the MTProto API.

+
+

A simplified version of the process is available only for bots using the bot API.

+
+

The first step for bots is enable payments as described here ».

+

Then, we work with payments as follows.

+

1. Create Invoice

+
inputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = InputWebDocument;
+
+labeledPrice#cb296bf8 label:string amount:long = LabeledPrice;
+
+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;
+
+inputMediaInvoice#f4e096c3 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:string = InputMedia;
+
+---functions---
+
+messages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int = Updates;
+

The user contacts the bot and requests to purchase something. +The bot forms an inputMediaInvoice with an invoice constructor with a description of the goods or service, amount to be paid, as well as requested shipping info. +The provider parameter of the inputMediaInvoice constructor is where you put the token value that you've obtained earlier via Botfather. It is possible for one merchant bot to use several different tokens for different users or different goods and services.

+

Use the messages.sendMedia method to send the invoice. +You can also attach an inline keyboard to the message using the reply_markup field: if provided, the first button must be a keyboardButtonBuy button. Otherwise, an inline keyboard will be generated automatically, with a Pay 'total price' keyboardButtonBuy as only button.

+

An invoice message with a pay button can only be sent to a private chat with the user. Groups and channels are not supported.

+

2. Order information

+

2.1 Invoice message

+
keyboardButtonBuy#afd93fbb text:string = KeyboardButton;
+
+keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;
+replyInlineMarkup#48a30254 rows:Vector<KeyboardButtonRow> = ReplyMarkup;
+
+webDocument#1c570ed1 url:string access_hash:long size:int mime_type:string attributes:Vector<DocumentAttribute> = WebDocument;
+webDocumentNoProxy#f9c8bcc6 url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = WebDocument;
+
+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;
+
+updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
+

The user receives an 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.

+

2.2 Getting invoice info about the product

+
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;
+
+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;
+
+---functions---
+
+payments.getPaymentForm#99f09745 msg_id:int = 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.

+

2.3 Verifying information

+
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;
+
+postAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress;
+
+paymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo;
+
+payments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = payments.ValidatedRequestedInfo;
+
+---functions---
+
+payments.validateRequestedInfo#770a8e74 flags:# save:flags.0?true 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.

+

If no errors are found in the submitted info, the response of the method will contain an id flag, to be used later to complete the payment.

+

If the flexible flag of the invoice is set, calling the payments.validateRequestedInfo method will send a shipping query update to the bot, to which the bot will reply with the available shipping options for the specified address as described here ». +The return value in this case will also contain a shipping_options field with the available shipping options.

+

If any errors are found in the submmitted data, a service notification will be sent to the user, with a description of the error from the bot.

+

2.3.1 Autofill

+
payments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;
+
+---functions---
+
+payments.getSavedInfo#227d824b = payments.SavedInfo;
+payments.clearSavedInfo#d83d70c1 flags:# credentials:flags.0?true info:flags.1?true = Bool;
+

The requested fields can be autofilled with the info provided in the saved_info field of the payment form, or with the info fetched manually using payments.getSavedInfo.

+

Saved order information can also be cleared using payments.clearSavedInfo.

+

2.4 Select delivery option

+
labeledPrice#cb296bf8 label:string amount:long = LabeledPrice;
+
+shippingOption#b6213cdf id:string title:string prices:Vector<LabeledPrice> = ShippingOption;
+
+updateBotShippingQuery#e0cdc940 query_id:long user_id:int payload:bytes shipping_address:PostAddress = Update;
+
+---functions---
+
+messages.setBotShippingResults#e5f672fa flags:# query_id:long error:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = Bool;
+

If a shipping address was requested and the bot included the parameter flexible, when the user validates order information the Telegram API will send an updateBotShippingQuery to the bot. +The bot must respond using messages.setBotShippingResults either with a list of possible delivery options and the relevant delivery prices, or with an error (for example, if delivery to the specified address is not possible).

+

The returned shipping options or the shipping error will be returned to the user while validating order information.

+

3. Payment

+
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;
+
+
+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;
+

3.1 Web payment

+
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;
+

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). +The data is used to generate an inputPaymentCredentials constructor. +Eventually, you can set the save flag to save the credit card info for future use, only if 2FA is enabled.

+

Telegram does not have access to your card information. Credit card details will be handled only by the payment system.

+

3.2 Native payment

+
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;
+

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:

+
    +
  • publishable_key: Stripe API publishable key
  • +
  • apple_pay_merchant_id: Apple Pay merchant ID
  • +
  • android_pay_public_key: Android Pay public key
  • +
  • android_pay_bgcolor: Android Pay form background color
  • +
  • android_pay_inverse: Whether to use the dark theme in the Android Pay form
  • +
  • need_country: True, if the user country must be provided,
  • +
  • need_zip: True, if the user ZIP/postal code must be provided,
  • +
  • need_cardholder_name: True, if the cardholder name must be provided
  • +
+

The payment gateway to use is decided based on the value of the native_provider field.

+
3.2.1 Stripe
+
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;
+

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. +Eventually, you can set the save flag to save the credit card info for future use, only if 2FA is enabled.

+

Telegram does not have access to your card information. Credit card details will be handled only by the payment system.

+

Example implementation: Telegram for Android.

+

3.3 Apple pay

+
inputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;
+

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.

+

3.4 Android pay

+
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.

+

Example implementation: Telegram for Android.

+

3.5 Using saved payment credentials

+
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;
+
+account.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;
+
+---functions---
+
+account.getTmpPassword#449e0b51 password:InputCheckPasswordSRP period:int = account.TmpPassword;
+

To reuse saved payment methods, the saved_credentials field of the payment form is used. +The title of the paymentSavedCredentialsCard can be used to preview a censored version of credit card info. +The id field is provided by the payment provider directly to the Telegram servers when saving the payment method, and identifies the payment method. +Full credit card info is not saved on Telegram Servers, and cannot be fetched by the user.

+

In order to use the saved payment method, 2FA must be enabled: the user must verify their identity by entering their 2FA password, which is then used as described in the SRP docs to generate SRP parameters which must be passed to account.getTmpPassword.

+

The generated temporary password can then be used to make payments using the saved credentials using the inputPaymentCredentialsSaved constructor.

+ +

Example implementation: Telegram for Android.

+

4. Pre-Checkout

+
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;
+
+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;
+

After verifying order information, the final step for the client is to call payments.sendPaymentForm, with the following parameters:

+
    +
  • The msg_id is set to the ID of the invoice message
  • +
  • requested_info_id is set to the id of the verified order information, if it was requested
  • +
  • shipping_option_id is set to the selected delivery option, if shipping was requested.
  • +
  • credentials are the payment credentials generated by the payment provider, required to complete the order.
  • +
+

Payment method info can also be saved to the Telegram Servers and reused, by setting the save flag of inputPaymentCredentials when sending the form. +This is only possible on accounts with 2FA enabled.

+

The bot then replies to the received precheckout query, finally the user proceeds to checkout.

+

Please note that if the result of the method is a payments.paymentVerificationNeeded, before proceeding to checkout the payment provider requires the user to verify his identity by opening the provided url and following instructions. +Once the user finishes working with the webpage, the client can proceed to checkout.

+

Eventual errors are returned in the form of RPC errors, with the description of the error by the bot contained in service updates.

+

4.1 Receiving pre-checkout query

+
paymentRequestedInfo#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;
+
+---functions---
+
+messages.setBotPrecheckoutResults#9c2dd95 flags:# success:flags.1?true query_id:long error:flags.0?string = Bool;
+

The user enters their payment information as described above and presses the final pay button. +At this moment the Telegram API sends an updateBotPrecheckoutQuery constructor that contains all the available information about the order to the bot. +The bot must reply using messages.setBotPrecheckoutResults within 10 seconds after receiving this update or the transaction is canceled.

+

The bot may return an error if it can‘t process the order for any reason. We highly recommend specifying a reason for failure to complete the order in human readable form (e.g. "Sorry, we’re all out of rubber ducks! Would you be interested in a steel bear instead?"). Telegram will display this reason to the user.

+

5. Checkout

+
keyboardButtonBuy#afd93fbb text:string = KeyboardButton;
+
+keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;
+replyInlineMarkup#48a30254 rows:Vector<KeyboardButtonRow> = ReplyMarkup;
+
+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;
+
+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;
+
+---functions---
+
+payments.getPaymentReceipt#a092a980 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. +Clients should treat invoice messages with a receipt_msg_id field as receipt messages, locally modifying the label of the keyboardButtonBuy button to a localized version of the word Receipt. +From this point, clicking on the Receipt button should trigger a call to payments.getPaymentReceipt, providing the receipt_msg_id to the msg_id field, which will return info about the transaction.

+

The payment will also generate one service message of type messageActionPaymentSent or messageActionPaymentSentMe, replying to the invoice. +For bots, the service message will be of type messageActionPaymentSentMe, for users it will be a messageActionPaymentSent.

+
messageActionPaymentSentMe#8f31b327 flags:# currency:string total_amount:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string charge:PaymentCharge = MessageAction;
+messageActionPaymentSent#40699cd0 currency:string total_amount:long = MessageAction;
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/pfs.html b/data/core.telegram.org/api/pfs.html new file mode 100644 index 0000000000..fb931f0d94 --- /dev/null +++ b/data/core.telegram.org/api/pfs.html @@ -0,0 +1,138 @@ + + + + + Perfect Forward Secrecy + + + + + + + + + + + + + +
+ +
+
+
+ +

Perfect Forward Secrecy

+ +
Related articles
+

+
+

This article is about Perfect Forward Secrecy in cloud chats, see also PFS in Secret Chats.

+
+
+

Telegram supports Perfect Forward Secrecy (PFS).

+

To make this possible, the client generates a permanent authorization key using p_q_inner_data and a temporary key using p_q_inner_data_temp. (See Creating an Authorization Key for more info.) These 2 operations may be done in parallel and even using the same connection. The client must save an expires_at unix timestamp expires_at = time + expires_in.

+

Important: in order to achieve PFS, the client must never use the permanent auth_key_id directly. Every message that is sent to MTProto, must be encrypted by a temp_auth_key_id, that was bound to the perm_auth_key_id.

+

An unbound temp_auth_key_id may only be used with the following methods:

+ +

In order to bind a temporary authorization key to the permanent key the client creates a special binding message and executes the auth.bindTempAuthKey method using temp_auth_key. Once auth.bindTempAuthKey has been executed successfully, the client may signUp / signIn using other auth.* methods and continue using the API as usual; the client must also rewrite client info using initConnection after each binding. Each permanent key may only be bound to one temporary key at a time, binding a new temporary key overwrites the previous one.

+

Once the temporary key expires, the client needs to generate a new temporary key using p_q_inner_data_temp. Then it needs to re-bind that new temporary key to the initial permanent key. A new key can also be generated in advance, so that the client has a new key ready by the time the old one has expired.

+

For additional security, the client can store the temporary authorization key in RAM only and never save it in persistent storage.

+

A temporary authorization key may expire at any moment before expires_at, since such keys are also stored only in the RAM on the server-side. Be prepared to handle resulting MTProto errors correctly (non-existent auth_key_id results in a 404 error).

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/pin.html b/data/core.telegram.org/api/pin.html new file mode 100644 index 0000000000..51e6db24c0 --- /dev/null +++ b/data/core.telegram.org/api/pin.html @@ -0,0 +1,149 @@ + + + + + Pinned messages + + + + + + + + + + + + + +
+ +
+
+
+ +

Pinned messages

+ +
+ +

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;
+
+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;
+
+---functions---
+
+messages.updatePinnedMessage#d2aaf7ec flags:# silent:flags.0?true unpin:flags.1?true pm_oneside:flags.2?true peer:InputPeer id:int = Updates;
+messages.unpinAllMessages#f025bc8b peer:InputPeer = messages.AffectedHistory;
+
+messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
+channels.getMessages#ad8c9a23 channel:InputChannel id:Vector<InputMessage> = messages.Messages;
+

The messages.updatePinnedMessage method can be used to pin or unpin a specific message in an arbitrary chat.
+The unpin flags specifies whether to unpin or pin the message, and pm_oneside specifies whether the message should only be pinned on the local side of a one-to-one chat.

+

messages.unpinAllMessages can be used to unpin all messages in a chat.

+

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;
+
+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;
+

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.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/poll.html b/data/core.telegram.org/api/poll.html new file mode 100644 index 0000000000..b6a24f8418 --- /dev/null +++ b/data/core.telegram.org/api/poll.html @@ -0,0 +1,199 @@ + + + + + Poll + + + + + + + + + + + + + +
+ +
+
+
+ +

Poll

+ +
+ +

Telegram allows sending polls and quizes, that can be voted on by thousands, if not milions of users in chats and channels.

+

Sending a poll

+
pollAnswer#6ca9c2e9 text:string option:bytes = PollAnswer;
+
+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;
+
+inputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector<bytes> solution:flags.1?string solution_entities:flags.1?Vector<MessageEntity> = InputMedia;
+
+---functions---
+
+messages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int = Updates;
+

To send a poll in a chat, call messages.sendMedia, providing an inputMediaPoll:

+
    +
  • +

    poll is the actual poll constructor, containing:

    +
      +
    • question - The poll title, aka the poll's title
    • +
    • answers - A vector of possible answers (2-10), each with a visible title text , and a unique option identifier (1-100 bytes)
    • +
    • closed - Whether the poll is closed
    • +
    • public_voters - Whether cast votes are publicly visible to all users (non-anonymous poll)
    • +
    • multiple_choice - Whether multiple options can be chosen as answer
    • +
    • quiz - Whether this is a quiz with correct answer IDs specified in inputMediaPoll.correct_answers
    • +
    • close_period - Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date .
    • +
    • close_date - Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future; can't be used together with close_period .
      +These last two parameters are exactly the same, except that one uses absolute, the other relative unixtime.
    • +
    +
  • +
  • +

    correct_answers - For quizes, option ID of the only correct answer

    +
  • +
  • +

    solution - Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds

    +
  • +
  • +

    solution_entities - Styled text message entities for the solution explanation

    +
  • +
+

In order to prematurely close the poll, preventing further votes, use messages.editMessage, setting the poll.closed flag to true.

+

Voting in polls

+
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;
+
+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;
+
+messageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;
+
+updateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update;
+
+---functions---
+
+messages.sendVote#10ea6184 peer:InputPeer msg_id:int options:Vector<bytes> = Updates;
+

When receiving a message with a messageMediaPoll, users can vote in it using messages.sendVote, specifying the chosen option identifiers.

+

The method will return an updateMessagePoll, containing an updated pollResults constructor, with the chosen flag set on the options we chose, and the correct flag set on the correct answers.

+

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;
+
+updateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update;
+
+---functions---
+
+messages.getPollResults#73bb643b peer:InputPeer msg_id:int = Updates;
+

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;
+
+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;
+
+---functions---
+
+messages.getPollVotes#b86e380e flags:# peer:InputPeer id:int option:flags.0?bytes offset:flags.1?string limit:int = messages.VotesList; 
+

messages.getPollVotes can be used to get poll results for non-anonymous polls, to see how each user voted for a poll option.
+Bots will also receive an updateMessagePollVote every time a user their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/push-updates.html b/data/core.telegram.org/api/push-updates.html new file mode 100644 index 0000000000..e5bd34b668 --- /dev/null +++ b/data/core.telegram.org/api/push-updates.html @@ -0,0 +1,985 @@ + + + + + Handling PUSH-notifications + + + + + + + + + + + + + +
+ +
+
+
+ +

Handling PUSH-notifications

+ +
+ +

Configuring the application

+

To be able to send APNS notifications to Apple servers or GCM notifications to Google servers, application certificates (APNS) or an application key (GCM) must be specified in the application settings.

+

Subscribing to notifications

+

To subscribe to notifications, the client must invoke the account.registerDevice query, passing in token_type and token as parameters that identify the current device. It is useful to repeat this query at least once every 24 hours or when restarting the application. Use account.unregisterDevice to unsubscribe.

+

The following modes are supported:

+
    +
  • 1 - APNS (device token for apple push)
  • +
  • 2 - FCM (firebase token for google firebase)
  • +
  • 3 - MPNS (channel URI for microsoft push)
  • +
  • 4 - Deprecated: Simple push (endpoint for firefox's simple push API)
  • +
  • 5 - Ubuntu phone (token for ubuntu push)
  • +
  • 6 - Blackberry (token for blackberry push)
  • +
  • 7 - MTProto separate session
  • +
  • 8 - WNS (windows push)
  • +
  • 9 - APNS VoIP (token for apple push VoIP)
  • +
  • 10 - Web push (web push, see below)
  • +
  • 11 - MPNS VoIP (token for microsoft push VoIP)
  • +
  • 12 - Tizen (token for tizen push)
  • +
+

For 10 web push, the token must be a JSON-encoded object with the following keys:

+
    +
  • endpoint: Absolute URL exposed by the push service where the application server can send push messages
  • +
  • keys: P-256 elliptic curve Diffie-Hellman parameters in the following object
      +
    • p256dh: Base64url-encoded P-256 elliptic curve Diffie-Hellman public key
    • +
    • auth: Base64url-encoded authentication secret
    • +
    +
  • +
+

Notification encryption

+

For FCM and APNS VoIP, an optional encryption key used to encrypt push notifications can be passed to account.registerDevice (secret). This key (auth_key) is used to encrypt the payloads using MTProto v2.

+

The FCM payload will be a JSON payload, containing a p field with the base64-encoded encrypted MTProto payload. After decryption, the result will be a JSON object, prefixed by a 32-bit little-endian integer with the length of the JSON payload. As usual, make sure to follow all security checks as described in the MTProto docs.

+

Example implementation.

+

As mentioned above, payloads can also be encrypted using P-256 Elliptic Curve Diffie-Hellman when using web push.

+

Notification structure

+

An (optionally encrypted) notification is provided as a JSON object in the following format:

+
{
+  "data": {
+    "loc_key": "CHAT_MESSAGE_CONTACT",
+    "loc_args": ["John Doe", "My magical group", "Contact Exchange"],
+    "user_id": 14124122,
+    "custom": {
+      "chat_id": 241233,
+      "msg_id": 123
+    },
+    "sound": "sound1.mp3",
+  }
+}
+

Each notification has several parameters that describe it.

+

Notification type

+

data.loc_key - A string literal in the form /[A-Z_0-9]+/, which summarizes the notification. For example, CHAT_MESSAGE_TEXT.

+

Notification text arguments

+

data.loc_args - A list or arguments which, when inserted into a template, produce a readable notification.

+

Custom parameters

+

data.custom - Parameters which are be passed into the application when a notification is opened.

+

Sound

+

data.sound - The name of an audio file to be played.

+

User id

+

data.user_id - ID of the account to which the PUSH notification should be delivered, in case of clients with multiple accounts active and running.

+

Processing notifications

+

In principle, data.loc_key, data.custom, and an Internet connection are sufficient to generate a notification. Obviously, if possible, when generating a visual notification you need not use all of the transmitted data and may rely on the information already stored on the client. But if a user or a chat is not cached locally, the values passed in loc_args may also be used. data.user_id is the ID of the account to which the PUSH notification should be delivered, in case of clients with multiple accounts active and running.

+

Service notifications

+

The following notifications can be used to update app settings.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeExtra custom argumentsDescription
DC_UPDATEdc - number of the data-center
addr - server address with port number in the format 111.112.113.114:443
In case the client gets this notification, it is necessary to add the received server address to the list of possible addresses. In case the address of the first DC was passed (dc=1), it is recommended to call it immediately using help.getConfig to update dc-configuration.
MESSAGE_DELETEDchannel_id: For channels and supergroups, Channel/supergroup identifier
chat_id: For chats, Chat identifier
from_id: For PMs, Author identifier
messages: Comma-separated IDs of messages that were deleted
Messages were deleted, remove multiple notifications for this chat
READ_HISTORYchannel_id: For channels and supergroups, Channel/supergroup identifier
chat_id: For chats, Chat identifier
from_id: For PMs, Author identifier
max_id: Maximum ID of read messages
Message history was read, remove multiple notifications for this chat
GEO_LIVE_PENDING Any of the live locations currently being shared should be updated
SESSION_REVOKE Logout and remove DB for specified session by data.user_id, only apply if coming from an MTProto-encrypted payload
MESSAGE_MUTED Sent rarely, every 10th message in chats or once per 15 sec in PM, to update badge or download messages
+

Possible Notifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeTemplate exampleArgumentsExtra custom arguments
MESSAGE_PLAYLIST{1} sent you {2} music files1. 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)
MESSAGE_DOCS{1} sent you {2} files1. 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)
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_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_PLAYLIST{1} posted {2} music files1. 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_DOCS{1} posted {2} files1. Channel name
2. Number of documents that were posted
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)
MESSAGE_NOTEXT{1} sent you a message1. Message authorattachb64: 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 photo1. Message authorattachb64: 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 photo1. User nameattachb64: 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 video1. Message authorattachb64: 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 video1. User nameattachb64: 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 screenshot1. User nameattachb64: 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 message1. User nameattachb64: 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 file1. User nameattachb64: 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}sticker1. 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 message1. Message authorattachb64: 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 you1. 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 map1. Message authorattachb64: 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 location1. User nameattachb64: 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 GIF1. User nameattachb64: 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{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_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)
MESSAGE_FWDS{1} forwarded you {2} messages1. 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_PHOTOS{1} sent you {2} photos1. 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} videos1. 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 album1. User namefrom_id: author identifier
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_NOTEXT{1} posted a message1. Channel nameattachb64: 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_PHOTO{1} posted a photo1. Channel nameattachb64: 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 video1. Channel nameattachb64: 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_ROUND{1} posted a video message1. Channel nameattachb64: 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 file1. Message authorattachb64: 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}sticker1. 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 message1. Message authorattachb64: 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 map1. Channel nameattachb64: 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 location1. Channel nameattachb64: 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_POLL{1} posted a poll {2}1. Channel name
2. Poll 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_QUIZ{1} posted a quiz {2}1. Channel name
2. Quiz 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_GIF{1} posted a GIF1. Channel nameattachb64: 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
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
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 messages1. 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} photos1. 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_VIDEOS{1} posted {2} videos1. Channel name
2. Number of videos that were posted
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 album1. Message authorattachb64: 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_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_NOTEXT{1} sent a 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_PHOTO{1} sent a photo 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_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_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_POLL{1} sent a poll {3} to the group {2}1. User name
2. Group name
3. Poll 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_QUIZ{1} sent a quiz {3} to the group {2}1. User name
2. Group name
3. Quiz 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_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_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)
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} name1. User name
2. Group name
chat_id: chat identifier
CHAT_PHOTO_EDITED{1} edited the group's {2} photo1. 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}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
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_NOTEXT{1} pinned a message1. User nameattachb64: 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 photo1. User nameattachb64: 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_VIDEO{1} pinned a video1. User nameattachb64: 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 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 message1. User nameattachb64: 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 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_DOC{1} pinned a file1. User nameattachb64: 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_STICKER{1} pinned a {2}sticker1. 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)
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)
PINNED_AUDIO{1} pinned a voice message1. User nameattachb64: 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_AUDIO{1} pinned a voice 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_CONTACT{1} pinned a contact {2}1. User name
2. Contact 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_CONTACT{1} pinned a contact {3} in the group {2}1. User name
2. Group name
3. Contact 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 map1. User nameattachb64: 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 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_GEOLIVE{1} pinned a live location1. User nameattachb64: 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_GEOLIVE{1} pinned a live location 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
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 {3} in the group {2}1. User name
2. Group name
3. Poll 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_QUIZ{1} pinned a quiz {2}1. User name
2. Quiz 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_QUIZ{1} pinned a quiz {3} in the group {2}1. User name
2. Group name
3. Quiz 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 game1. User nameattachb64: 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 score1. User nameattachb64: 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_INVOICE{1} pinned an invoice1. User nameattachb64: 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 GIF1. User nameattachb64: 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 namecontact_id: contact identifier
AUTH_UNKNOWNNew login from unrecognized device {1}1. Device name 
AUTH_REGIONNew login from unrecognized device {1}, location: {2}1. Device name
2. Location
 
ENCRYPTION_REQUESTYou have a new message encryption_id: secret chat identifier
ENCRYPTION_ACCEPTYou have a new message encryption_id: secret chat identifier
ENCRYPTED_MESSAGEYou have a new message encryption_id: secret chat identifier
random_id: message identifier
LOCKED_MESSAGEYou have a new message  
PHONE_CALL_REQUEST{1} is calling you!1. User namecall_ah: Call access hash
call_id: Call ID
PHONE_CALL_MISSEDYou missed a call from {1}1. User name 
MESSAGE_ANNOUNCEMENT{1}1. Announcementannouncement: 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 new file mode 100644 index 0000000000..7f6826e861 --- /dev/null +++ b/data/core.telegram.org/api/qr-login.html @@ -0,0 +1,154 @@ + + + + + Login via QR code + + + + + + + + + + + + + +
+ +
+
+
+ +

Login via QR code

+ +
+ +

QR code login flow.

+

Related TL schema:

+
auth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken;
+auth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken;
+auth.loginTokenSuccess#390d5c5e authorization:auth.Authorization = auth.LoginToken;
+
+updateLoginToken#564fe691 = Update;
+
+authorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;
+
+---functions---
+
+auth.exportLoginToken#b1b41517 api_id:int api_hash:string except_ids:Vector<int> = auth.LoginToken;
+auth.acceptLoginToken#e894ad4d token:bytes = Authorization;
+auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;
+

Exporting a login token

+

First of all, auth.exportLoginToken must be called by the app that wants to log in to an existing Telegram account.
+The method will return an auth.loginToken constructor, containing a binary login token and an expiry date (usually 30 seconds).

+

The login token must be encoded using base64url, embedded in a tg://login?token=base64encodedtoken URL and shown in the form of a QR code to the user.
+After the expiration of the current QR code, the auth.exportLoginToken method must be recalled and a new QR code must be generated automatically.

+

Accepting a login token

+

In order to log in, the QR code must be scanned and accepted by an already logged-in Telegram app using auth.acceptLoginToken.
+The token must be extracted from the tg://login URI and base64url-decoded before using it in the method.

+

Possible errors returned by the method are:

+
    +
  • 400 - AUTH_TOKEN_INVALID, an invalid authorization token was provided
  • +
  • 400 - AUTH_TOKEN_EXPIRED, the provided authorization token has expired and the updated QR-code must be re-scanned
  • +
  • 400 - AUTH_TOKEN_ALREADY_ACCEPTED, the authorization token was already used
  • +
+

The method will return an authorization object, containing info about the app and session that we just authorized.

+

Confirming (importing) the login token

+

After the logged-in app calls auth.acceptLoginToken and accepts the login token, the app that is trying to login will receive an updateLoginToken update, which should trigger a second call to the auth.exportLoginToken method.

+

This second call should then return an auth.loginTokenSuccess constructor, indicating successful login, essentially allowing further authorized interaction with the API.

+

If, however, there is a DC mismatch between the two apps, auth.loginTokenMigrateTo is returned instead, to which the app that is trying to login should respond by calling auth.importLoginToken with the specified token, to the specified DC.

+

This call should then finally return a auth.loginTokenSuccess constructor.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/recent-actions.html b/data/core.telegram.org/api/recent-actions.html new file mode 100644 index 0000000000..433be8da35 --- /dev/null +++ b/data/core.telegram.org/api/recent-actions.html @@ -0,0 +1,154 @@ + + + + + Admin log + + + + + + + + + + + + + +
+ +
+
+
+ +

Admin log

+ +
+ +

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.

+
channelAdminLogEventActionChangeTitle#e6dfb825 prev_value:string new_value:string = ChannelAdminLogEventAction;
+channelAdminLogEventActionChangeAbout#55188a2e prev_value:string new_value:string = ChannelAdminLogEventAction;
+channelAdminLogEventActionChangeUsername#6a4afc38 prev_value:string new_value:string = ChannelAdminLogEventAction;
+channelAdminLogEventActionChangePhoto#434bd2af prev_photo:Photo new_photo:Photo = ChannelAdminLogEventAction;
+channelAdminLogEventActionToggleInvites#1b7907ae new_value:Bool = ChannelAdminLogEventAction;
+channelAdminLogEventActionToggleSignatures#26ae0971 new_value:Bool = ChannelAdminLogEventAction;
+channelAdminLogEventActionUpdatePinned#e9e82c18 message:Message = ChannelAdminLogEventAction;
+channelAdminLogEventActionEditMessage#709b2405 prev_message:Message new_message:Message = ChannelAdminLogEventAction;
+channelAdminLogEventActionDeleteMessage#42e047bb message:Message = ChannelAdminLogEventAction;
+channelAdminLogEventActionParticipantJoin#183040d3 = ChannelAdminLogEventAction;
+channelAdminLogEventActionParticipantLeave#f89777f2 = ChannelAdminLogEventAction;
+channelAdminLogEventActionParticipantInvite#e31c34d8 participant:ChannelParticipant = ChannelAdminLogEventAction;
+channelAdminLogEventActionParticipantToggleBan#e6d83d7e prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;
+channelAdminLogEventActionParticipantToggleAdmin#d5676710 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;
+channelAdminLogEventActionChangeStickerSet#b1c3caa7 prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction;
+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;
+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;
+
+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;
+
+---functions---
+
+channels.getAdminLog#33ddf480 flags:# channel:InputChannel q:string events_filter:flags.0?ChannelAdminLogEventsFilter admins:flags.1?Vector<InputUser> max_id:long min_id:long limit:int = channels.AdminLogResults;
+

channels.getAdminLog can be used to list recent admin activity.
+A channelAdminLogEventsFilter can be used to filter out actions of a certain type, and the admins field can be used to show only actions by certain admins.
+q can also be used to filter only logs matching a query string.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/requests.html b/data/core.telegram.org/api/requests.html new file mode 100644 index 0000000000..2fd75ee2c4 --- /dev/null +++ b/data/core.telegram.org/api/requests.html @@ -0,0 +1,133 @@ + + + + + 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/rights.html b/data/core.telegram.org/api/rights.html new file mode 100644 index 0000000000..d9bbb09f23 --- /dev/null +++ b/data/core.telegram.org/api/rights.html @@ -0,0 +1,133 @@ + + + + + Admin, banned, default rights + + + + + + + + + + + + + +
+ +
+
+
+ +

Admin, banned, default rights

+ +
+ +

Channels and supergroups allow setting granular permissions both for admins and specific users. +Channels, supergroups and legacy groups also allow setting global granular permissions for users.

+

They can be modified as follows:

+

Admin rights

+

channels.editAdmin can be used to modify the admin rights of a user in a channel or supergroup. +Legacy groups do not allow setting granular admin permissions, messages.editChatAdmin has to be used, instead.

+

Permissions are defined by the chatAdminRights constructor, some admin rights can only be used for channels, others both for channels and supergroups (see the constructor page).

+

Banned rights

+

channels.editBanned can be used to modify the rights of a user in a channel or supergroup, to ban/kick a user from the group, or restrict the user from doing certain things. +Legacy groups do not allow setting granular user permissions for single users, single users can only be removed from groups using messages.deleteChatUser: however, setting global granular permissions with legacy groups is supported.

+

Permissions are defined by the chatBannedRights constructor, for more info see the constructor page.

+

Default rights

+

messages.editChatDefaultBannedRights can be used to modify the rights of all users in a channel, supergroup or legacy group, to restrict them from doing certain things.

+

Permissions are defined by the chatBannedRights constructor: all flags can be used except for view_messages, for more info see the constructor page.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/scheduled-messages.html b/data/core.telegram.org/api/scheduled-messages.html new file mode 100644 index 0000000000..c32f442277 --- /dev/null +++ b/data/core.telegram.org/api/scheduled-messages.html @@ -0,0 +1,156 @@ + + + + + Scheduled messages + + + + + + + + + + + + + +
+ +
+
+
+ +

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;
+
+updateNewScheduledMessage#39a51dfb message:Message = Update;
+updateDeleteScheduledMessages#90866cee peer:Peer messages:Vector<int> = Update;
+
+---functions---
+
+messages.sendMessage#520c3870 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int = Updates;
+
+messages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int = Updates;
+

To schedule a message, simply provide a future unixtime in the schedule_date flag of messages.sendMessage or messages.sendMedia.

+

The specified message or media will be added to a server-side schedule queue for the current chat, and will be automatically sent at the specified time.
+The method call generates the following updates:

+
    +
  • Immediately, an updateNewScheduledMessage, with ID equal to the ID of the message in the schedule queue for the current chat (each PM, chat, supergroup and channel has its own schedule queue and ID sequence).
  • +
  • At schedule_date, an updateNewMessage or updateNewChannelMessage with the from_scheduled flag set, indicating to the sender that the specified scheduled message was sent.
  • +
  • At schedule_date, an updateDeleteScheduledMessages, indicating that the message was flushed from the schedule queue.
  • +
+

If the schedule_date is less than 10 seconds in the future, the message will be sent immediately, generating a normal updateNewMessage/updateNewChannelMessage .

+

Manipulating the schedule queue

+
updateNewScheduledMessage#39a51dfb message:Message = Update;
+updateDeleteScheduledMessages#90866cee peer:Peer messages:Vector<int> = Update;
+
+---functions---
+
+messages.getScheduledHistory#e2c2685b peer:InputPeer hash:int = 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;
+
+messages.editMessage#48f71778 flags:# no_webpage:flags.1?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int = Updates;
+

Clients can manually edit the schedule queue of a certain chat, providing the scheduled message ID obtained from updateNewScheduledMessage.

+ +

Modifying scheduled messages will generate an updateNewScheduledMessage with the same ID, and updated information.
+Deleting scheduled messages will generate an updateDeleteScheduledMessages.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/search.html b/data/core.telegram.org/api/search.html new file mode 100644 index 0000000000..45f6d282c9 --- /dev/null +++ b/data/core.telegram.org/api/search.html @@ -0,0 +1,179 @@ + + + + + Search + + + + + + + + + + + + + +
+ +
+
+
+ +

Search

+ +
+ +

Telegram allows applying detailed message filters while looking for messages in chats.

+

Search filters

+
inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
+inputMessagesFilterPhotos#9609a51c = MessagesFilter;
+inputMessagesFilterVideo#9fc00e65 = MessagesFilter;
+inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
+inputMessagesFilterDocument#9eddf188 = MessagesFilter;
+inputMessagesFilterUrl#7ef0dd87 = MessagesFilter;
+inputMessagesFilterGif#ffc86587 = MessagesFilter;
+inputMessagesFilterVoice#50f5c392 = MessagesFilter;
+inputMessagesFilterMusic#3751b49e = MessagesFilter;
+inputMessagesFilterChatPhotos#3a20ecb8 = MessagesFilter;
+inputMessagesFilterPhoneCalls#80c99768 flags:# missed:flags.0?true = MessagesFilter;
+inputMessagesFilterRoundVoice#7a7c17a4 = MessagesFilter;
+inputMessagesFilterRoundVideo#b549da53 = MessagesFilter;
+inputMessagesFilterMyMentions#c1f8e69a = MessagesFilter;
+inputMessagesFilterGeo#e7026d0d = MessagesFilter;
+inputMessagesFilterContacts#e062db83 = MessagesFilter;
+inputMessagesFilterPinned#1bb00451 = MessagesFilter;
+
+messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesSlice#3a54685e flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.channelMessages#64479808 flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesNotModified#74535f21 count:int = messages.Messages;
+
+---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.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.
+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. +Available filters:

+ +

The returned messages.Messages constructors contain parameters for pagination, the messages themselves and two offset_id_offset/count parameters that can be used to display a progress/total counter like photo 134 of 200.
+For example, when displaying the chat photo gallery, we could display a photo ${offset_id_offset} of ${count} indicator on top.

+

Search counters

+
messages.searchCounter#e844ebff flags:# inexact:flags.1?true filter:MessagesFilter count:int = messages.SearchCounter;
+
+---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.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/srp.html b/data/core.telegram.org/api/srp.html new file mode 100644 index 0000000000..8bc0a6cdfb --- /dev/null +++ b/data/core.telegram.org/api/srp.html @@ -0,0 +1,255 @@ + + + + + Two-factor authentication + + + + + + + + + + + + + +
+ +
+
+
+ +

Two-factor authentication

+ +
+ +

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.

+

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).

+

The main hashing function H is sha256:

+
    +
  • H(data) := sha256(data)
  • +
+

The salting hashing function SH is defined as follows:

+
    +
  • SH(data, salt) := H(salt | data | salt)
  • +
+

The primary password hashing function is defined as follows:

+
    +
  • PH1(password, salt1, salt2) := SH(SH(password, salt1), salt2)
  • +
+

The secondary password hashing function is defined as follows:

+
    +
  • PH2(password, salt1, salt2) := SH(pbkdf2(sha512, PH1(password, salt1, salt2), salt1, 100000), salt2)
  • +
+

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.

    +

    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)

    +
  • +
  • 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:

+
    +
  • k := H(p | g)
  • +
+

The shared param u is generated: the client does this, and the server does the same with the g_a we will send him later (see below)

+
    +
  • u := H(g_a | g_b)
  • +
+

The final parameters are generated client-side only:

+
    +
  • x := PH2(password, salt1, salt2)
  • +
  • v := pow(g, x) mod p
  • +
+

The server already has v, from when we set the password.

+

A final shared param is generated, for commodity:

+
    +
  • k_v := (k * v) mod p
  • +
+

Finally, the key exchange process starts on both parties.

+

The client computes a 2048-bit number a (using sufficient entropy or the server’s random; see above) and generates:

+
    +
  • g_a := pow(g, a) mod p.
  • +
+

The server computes a 2048-bit number b using sufficient entropy and generates the g_b parameter that was sent to us (see above).

+
    +
  • g_b := (k_v + (pow(g, b) mod p)) mod p
  • +
+

Finally, the SRP session keys are generated:

+

Client side:

+
    +
  • t := (g_b - k_v) mod p (positive modulo, if the result is negative increment by p)
  • +
  • s_a := pow(t, a + u * x) mod p
  • +
  • k_a := H(s_a)
  • +
+

Server side:

+
    +
  • s_b := pow(g_a * (pow(v, u) mod p), b) mod p
  • +
  • k_b := H(s_b)
  • +
+

Since:

+
    +
  • g_b := (k_v + (pow(g, b) mod p)) mod p
  • +
  • t := (g_b - k_v) mod p
  • +
  • t := ((k_v + (pow(g, b) mod p)) - k_v) mod p
  • +
  • t := pow(g, b) mod p
  • +
  • s_a := pow(t, a + u * x) mod p
  • +
  • s_a := pow(pow(g, b) mod p, a + u * x) mod p
  • +
+

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

    +
  • +
  • s_a := pow(pow(g, b) mod p, a + u * x) mod p

    +
  • +
+

This means:

+
    +
  • s_b === s_a
  • +
  • k_b === k_a
  • +
+

Finally, as per SRP:

+
    +
  • M1 := H(H(p) xor H(g) | H(salt1) | H(salt2) | g_a | g_b | k_a)
  • +
+

M1 is passed to inputCheckPasswordSRP, along with g_a (as A parameter) and the srp_id, extracted from the account.password object.

+

The server then computes:

+
    +
  • M2 := H(H(p) xor H(g) | H(salt1) | H(salt2) | g_a | g_b | k_b)
  • +
+

Since we said that:

+
    +
  • s_b === s_a
  • +
  • k_b === k_a
  • +
+

This means, if everything was done correctly,

+
    +
  • 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:

+
    +
  • 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.

+

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

+
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/stats.html b/data/core.telegram.org/api/stats.html new file mode 100644 index 0000000000..61391864a5 --- /dev/null +++ b/data/core.telegram.org/api/stats.html @@ -0,0 +1,297 @@ + + + + + Channel statistics + + + + + + + + + + + + + +
+ +
+
+
+ +

Channel statistics

+ +
+ +

Telegram offers detailed channel statistics for channels and supergroups.

+

Channel statistics

+

Scheme:

+
statsDateRangeDays#b637edaf min_date:int max_date:int = StatsDateRangeDays;
+
+statsAbsValueAndPrev#cb43acde current:double previous:double = StatsAbsValueAndPrev;
+
+statsPercentValue#cbce2fe0 part:double total:double = StatsPercentValue;
+
+statsGraphAsync#4a27eb2d token:string = StatsGraph;
+statsGraphError#bedc9822 error:string = StatsGraph;
+statsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph;
+
+messageInteractionCounters#ad4fc9bd msg_id:int views:int forwards:int = MessageInteractionCounters;
+
+stats.broadcastStats#bdf78394 period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph recent_message_interactions:Vector<MessageInteractionCounters> = stats.BroadcastStats;
+
+---functions---
+
+stats.getBroadcastStats#ab42441a flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastStats;
+stats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph;
+

Administrators of channels of a certain size (the exact limit is a server-side config, returned in the can_view_stats flag of channelFull) can call stats.getBroadcastStats to get detailed channel statistics.
+The returned stats.broadcastStats contains multiple statistics:

+
    +
  • Period-related statistics: a pair of values, one at the beginning and one at the end of the period in consideration (period).
    The period typically depends on channel activity.
      +
    • Absolute follower count (followers)
    • +
    • total_viewcount/postcount, for posts posted during the period in consideration (views_per_post).
      +Note that in this case, current refers to the period in consideration (min_date till max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) till min_date).
    • +
    • total_sharecount/postcount, for posts posted during the period in consideration (shares_per_post).
      +Note that in this case, current refers to the period in consideration (min_date till max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) till min_date).
    • +
    +
  • +
  • Percentage statistics
      +
    • Percentage of subscribers with enabled notifications (enabled_notifications)
    • +
    +
  • +
  • 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;
+
+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;
+
+---functions---
+
+stats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel = stats.MegagroupStats;
+

Administrators of supergroups of a certain size (the exact limit is a server-side config, returned in the can_view_stats flag of channelFull) can call stats.getMegagroupStats to get detailed supergroup statistics.
+The returned stats.broadcastStats contains multiple statistics, see the constructor page for more info ».

+

Message statistics

+
stats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats;
+
+---functions---
+
+stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;
+

Administrators of channels of a certain size (the exact limit is a server-side config, returned in the can_view_stats flag of channelFull) can call stats.getMessageStats to get statistics of a specific message.
+The returned stats.messageStats contains the view graph of the message.

+

Graph visualization

+

There are four available visualizations for graph types:

+ +

Graph modifiers (see various graphs for examples):

+
    +
  • y_scaled - Indicates that each of the two (!) lines in a step graph must be visualized on its own scale, with two different tick axes on the left and right parts of the graph
  • +
  • percentage - Indicates whether value percentages should be shown in labels
  • +
  • stacked - Depending on the graph type, indicates stacking of multiple columns in the same graph
  • +
+

Graph syntax

+
statsGraphAsync#4a27eb2d token:string = StatsGraph;
+statsGraphError#bedc9822 error:string = StatsGraph;
+statsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph;
+
+dataJSON#7d748d04 data:string = DataJSON;
+
+---functions---
+
+stats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph;
+

Certain graphs are not directly sent in the stats.broadcastStats constructor to reduce server load: instead, those graphs will be sent as a statsGraphAsync constructor, and should be fetched separately using stats.loadAsyncGraph.

+

After obtaining the full statsGraph constructor, clients should parse the JSON graph object in the json field.

+

Object structure:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyGraph title
columnsArray of all data column arrays in the chart. Each column array has its label at position 0, followed by values.
typesGraphs types for each of the column arrays (object, "label": "type"):
- line - line graph
- area - area graph
- step - step graph
- bar - bar graph
- x - x axis values for each of the charts at the corresponding positions, UNIX timestamps in milliseconds.
colorsColor for each type (object, "label": "colorKey#AAAAAA"; see chart colors).
namesLocalized name for each variable (object, "label": "Name")
subchartObject indicating the default zoom range for the graph, this is object's structure:
- show - Whether to use the specified zoom range (boolean)
- defaultZoom - An array with two x values, indicating the two ends of the default zoom range
y_scaledIndicates that each of the two (!) lines in a step graph must be visualized on its own scale, with two different tick axes on the left and right parts of the graph (boolean, see various graphs for examples)
percentageIndicates whether value percentages should be shown in labels (boolean, see various graphs for examples)
stackedDepending on the graph type, indicates stacking of multiple columns in the same graph (boolean, see various graphs for examples)
+ +

The following chart restrictions apply:

+
    +
  • Up to 50 columns on one graph must be supported.
  • +
  • Chart types are always the same for every column in the graph.
  • +
  • The bar chart type and stacked option are always used together.
  • +
  • percentage is always used with the area graph. + +
  • +
+

Chart zooming

+
statsGraphError#bedc9822 error:string = StatsGraph;
+statsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph;
+
+dataJSON#7d748d04 data:string = DataJSON;
+
+---functions---
+
+stats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph;
+

Graphs that support zooming will contain a zoom_token in the statsGraph constructor.
+Said token should be then used as token in a new stats.loadAsyncGraph call triggered when the user clicks on the label, related to a certain x axis in the graph (see graph examples).
+The x coordinate of the label should be provided to the x parameter; the method will then return (if available) a more detailed subgraph.
+If not enough data is available, a localized statsGraphError will be returned.

+

Typical zoom visualization rules:

+ +

Chart colors

+

Chart colors can be provided as a color key, followed by the primary color value in hex format:

+
red#e05356
+

The color key can be one of red, lightblue, lightgreen, golden, green, orange, blue, indigo.
+Apps can choose to use a color value specified by the currently loaded theme: for example, the android app uses statisticChartLine_* themekeys for each of the color keys, check out the assets directory for a bunch of default themes with various colors for channel statistics.

+

However, the server may also choose to return just a plain color value in hex format:

+
#e05356
+

In this case, the dark flag of the stats.getBroadcastStats method can be used to choose the palette of returned colors.

+

Graph examples

+

Line graph

+

Simple single line graph

+

Step graph

+

Step graph, always "stacked" (to indicate multiple lines)

+

Bar graph

+

Bar graph with multiple lines, always "stacked" (to indicate actual stacked bars, biggest bars first)

+

Area graph

+

Mixed bar/line graph, always "stacked" (to indicate actual stacked bars, biggest bars first)

+

Piechart

+

Piechart, typically obtained only when zooming into percentage graphs

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/terms.html b/data/core.telegram.org/api/terms.html new file mode 100644 index 0000000000..434e3efd4d --- /dev/null +++ b/data/core.telegram.org/api/terms.html @@ -0,0 +1,140 @@ + + + + + Telegram API Terms of Service + + + + + + + + + + + + + +
+ +
+
+
+ +

Telegram API Terms of Service

+ +
+ +

We welcome all developers to use our API and source code to create Telegram-like messaging applications on our platform free of charge. In order to ensure consistency and security across the Telegram ecosystem, all third-party client apps must comply with the following Terms of Service.

+

1. Privacy & Security

+

1.1. Telegram is a privacy-oriented platform. All client apps must, therefore, guard their users' privacy with utmost care and comply with our Security Guidelines.
+1.2. Developers are welcome to add new features or improve and extend existing Telegram features provided that these modifications do not violate these Terms of Service.
+1.3. As a client developer, you must make sure that all the basic features of the main Telegram apps function correctly and in an expected way both in your app and when users of your app communicate with other Telegram users. It is forbidden to force users of other Telegram clients to download your app in order to view certain messages and content sent using your app.
+1.4. It is forbidden to interfere with the basic functionality of Telegram. This includes but is not limited to: making actions on behalf of the user without the user's knowledge and consent, preventing self-destructing content from disappearing, preventing last seen and online statuses from being displayed correctly, tampering with the 'read' statuses of messages (e.g. implementing a 'ghost mode'), preventing typing statuses from being sent/displayed, etc.

+

2. Transparency

+

2.1. You must obtain your own api_id for your application.
+2.2. We offer our API free of charge, but your users must be aware of the fact that your app uses the Telegram API and is part of the Telegram ecosystem. This fact must be featured prominently in the app's description in the app stores and in the in-app intro if your app has it.
+2.3. To avoid confusion, the title of your app must not include the word “Telegram”. An exception can be made if the word “Telegram” is preceded with the word “Unofficial” in the title.
+2.4. You must not use the official Telegram logo for your app. Both the Telegram brand and its logo are registered trademarks protected by law in almost every country.

+

3. Advertising & Monetization

+

3.1. Developers are allowed to monetize their coding efforts through advertising or other legitimate means.
+3.2. If you decide to monetize your app, you must clearly mention all the methods of monetization that are used in your app in all its app store descriptions.

+

4. Breach of terms

+

4.1. If your app violates these terms, we will notify the Telegram account responsible for the app about the breach of terms.
+4.2. If you do not update the app to fix the highlighted issues within 10 days, we will have to discontinue your access to Telegram API and contact the app stores about the removal of your apps that are using the Telegram API in violation of these terms.

+

We reserve the right to expand these terms and guidelines as the need arises. We will inform client developers of such changes via an in-app notification to their accounts connected to the app in question.

+
+

Back to Creating Your Telegram Application »

+
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/threads.html b/data/core.telegram.org/api/threads.html new file mode 100644 index 0000000000..49791d653f --- /dev/null +++ b/data/core.telegram.org/api/threads.html @@ -0,0 +1,182 @@ + + + + + Threads + + + + + + + + + + + + + +
+ +
+
+
+ +

Threads

+ +
+ +

Telegram allows commenting on a channel post or on a generic supergroup message, thanks to message threads.

+

Message threads

+

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;
+
+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;
+
+---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;
+

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;
+

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;
+
+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;
+
+updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
+updateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;
+
+---functions---
+
+contacts.blockFromReplies#29a8962c flags:# delete_message:flags.0?true delete_history:flags.1?true report_spam:flags.2?true msg_id:int = Updates;
+
+contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;
+

Since a user can comment in channel posts without joining the actual discussion supergroup, there must be a way for them to receive notifications about replies in comment sections.
+For this reason, a special @replies username is provided. +Its ID for main and testing endpoints can be seen in the tdlib sources.

+

When someone replies to one of our messages in the comment section of a channel post, and the user is not subscribed to the discussion group, the client will receive two updates:

+
    +
  • An updateNewChannelMessage from the discussion group itself, structured just like any other update coming from a subscribed group, with:
      +
    • id set to the ID of the reply
    • +
    • from_id set to the peer that replied to us
    • +
    • peer_id set to the peer of the discussion group
    • +
    • reply_to.reply_to_msg_id set to the ID of our message
    • +
    • reply_to.reply_to_top_id set to the thread ID.
    • +
    +
  • +
  • An updateNewMessage
      +
    • id set to the common ID sequence for users
    • +
    • from_id set to the peer of @replies
    • +
    • peer_id set to our own peer
    • +
    • fwd_from.saved_from_msg_id set to the ID of the reply
    • +
    • fwd_from.from_id set to the the peer that replied to us
    • +
    • reply_to.reply_to_peer_id set to the peer of the discussion group
    • +
    • reply_to.reply_to_msg_id set to the ID of our message
    • +
    • reply_to.reply_to_top_id set to the thread ID
    • +
    +
  • +
+

Clients should display messages coming from @replies as a read-only supergroup, with each reply displayed as a separate message from the author of the reply, with a "View in chat" button like for channel comments.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/top-rating.html b/data/core.telegram.org/api/top-rating.html new file mode 100644 index 0000000000..a4860d908e --- /dev/null +++ b/data/core.telegram.org/api/top-rating.html @@ -0,0 +1,145 @@ + + + + + Top peer rating + + + + + + + + + + + + + +
+ +
+
+
+ +

Top peer rating

+ +

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).

+

Schema:

+
topPeer#edcdc05b peer:Peer rating:double = TopPeer;
+
+topPeerCategoryBotsPM#ab661b5b = TopPeerCategory;
+topPeerCategoryBotsInline#148677e2 = TopPeerCategory;
+topPeerCategoryCorrespondents#637b7ed = TopPeerCategory;
+topPeerCategoryGroups#bd17a14a = TopPeerCategory;
+topPeerCategoryChannels#161d9628 = TopPeerCategory;
+topPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory;
+topPeerCategoryForwardUsers#a8406ca9 = TopPeerCategory;
+topPeerCategoryForwardChats#fbeec0f0 = TopPeerCategory;
+
+topPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector<TopPeer> = TopPeerCategoryPeers;
+
+contacts.topPeersNotModified#de266ef5 = contacts.TopPeers;
+contacts.topPeers#70b772a8 categories:Vector<TopPeerCategoryPeers> chats:Vector<Chat> users:Vector<User> = contacts.TopPeers;
+contacts.topPeersDisabled#b52c939d = contacts.TopPeers;
+
+---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;
+

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.
  • +
+
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 new file mode 100644 index 0000000000..5bcca1471a --- /dev/null +++ b/data/core.telegram.org/api/updates.html @@ -0,0 +1,226 @@ + + + + + Working with Updates + + + + + + + + + + + + + +
+ +
+
+
+ +

Working with Updates

+ +
+ +

When a client is being actively used, events will occur that affect the current user and that they must learn about as soon as possible, e.g. when a new message is received. To eliminate the need for the client itself to periodically download these events, there is an update delivery mechanism in which the server sends the user notifications over one of its available connections with the client.

+

Subscribing to Updates

+

Update events are sent to an authorized user into the last active connection (except for connections needed for downloading / uploading files).

+

So to start receiving updates the client needs to init connection and call API method, e.g. to fetch current state.

+

Event sequences

+

All events are received from the socket as a sequence of TL-serialized Updates objects, which might be optionally gzip-compressed in the same way as responses to queries.

+

Each Updates object may contain single or multiple Update objects, representing different events happening.

+

In order to apply all updates in precise order and to guarantee that no update is missed or applied twice there is seq attribute in Updates constructors, and pts (with pts_count) or qts attributes in Update constructors. The client must use those attributes values in combination with locally stored state to correctly apply incoming updates.

+

When a gap in updates sequence occurs, it must be filled via calling one of the API methods. More below »

+

Updates sequence

+

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;
+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.

+

Events inside updateShort constructors, normally, have lower priority and are broadcast to a large number of users, i.e. one of the chat participants started entering text in a big conversation (updateChatUserTyping).

+

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 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.

+

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)
    • +
    • Channel message box sequence 1 (pts)
    • +
    • Channel message box sequence 2 (pts)
    • +
    • Channel message box sequence 3 (pts)
    • +
    • and so on...
    • +
    +
  • +
+

Fetching state

+

The common update state is represented by the updates.State constructor. +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 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.

+

When the client receives payload with serialized updates, first of all, it needs to walk through all of the nested Update objects and check if they belong to any of message box sequences (have pts or qts parameters). Those updates need to be handled separately according to corresponding local state and new pts/qts values. Details below »

+

After message box updates are handled, if there are any other updates remaining the client needs to handle them with respect to seq. Details below »

+

pts: checking and applying

+

Here, local_pts will be the local state, pts will be the remote state, pts_count will be the number of events in the update.

+

If local_pts + pts_count === pts, the update can be applied. +If local_pts + pts_count > pts, the update was already applied, and must be ignored. +If local_pts + pts_count < pts, there's an update gap that must be filled.

+

For example, let's assume the client has the following local state for the channel 123456789:

+
local_pts = 131
+

Now let's assume an updateNewChannelMessage from channel 123456789 is received with pts = 132 and pts_count=1. +Since local_pts + pts_count === pts, the total number of events since the last stored state is, in fact, equal to pts_count: this means the update can be safely accepted and the remote pts applied:

+
local_pts = 132
+

Since:

+
    +
  • pts indicates the server state after the new channel message events are generated
  • +
  • pts_count indicates the number of events in the new channel update
  • +
  • The server state before the new channel message event was generated has to be: pts_before = pts - pts_count = 131, which is, in fact, equal to our local state.
  • +
+

Now let's assume an updateNewChannelMessage from channel 123456789 is received with pts = 132 and pts_count=1. +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.

+

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. +If local_seq + 1 > seq_start, the updates were already applied, and must be ignored. +If local_seq + 1 < seq_start, there's an updates gap that must be filled (updates.getDifference must be used as with common and secret event sequences).

+

If the updates were applied, local Updates state must be updated with seq and date from the constructor.

+

For all the other Updates type constructors there is no need to check seq or change a local state.

+

Recovering gaps

+

To do this, updates.getDifference (common/secret state) or updates.getChannelDifference (channel state) with the respective local states must be called. +These methods should also be called on startup, to fetch new updates (preferably with some flags to reduce server load, see the method's docs). +Manually obtaining updates is also required in the following situations:

+
    +
  • Loss of sync: a gap was found in seq / pts / qts (as described above). It may be useful to wait up to 0.5 seconds in this situation and abort the sync in case a new update arrives, that fills the gap.
  • +
  • Session loss on the server: the client receives a new session created notification. This can be caused by garbage collection on the MTProto server or a server reboot.
  • +
  • Incorrect update: the client cannot deserialize the received data.
  • +
  • Incomplete update: the client is missing data about a chat/user from one of the shortened constructors, such as updateShortChatMessage, etc.
  • +
  • Long period without updates: no updates for 15 minutes or longer.
  • +
  • The server requests the client to fetch the difference using updateChannelTooLong or updatesTooLong.
  • +
+

When calling updates.getDifference if the updates.differenceSlice constructor is returned in response, the full difference was too large to be received in one request. The intermediate status, intermediate_state, must be saved on the client and the query must be repeated, using the intermediate status as the current status.

+

To fetch the updates difference of a channel, updates.getChannelDifference is used. +If the difference is too large to be received in one request, the final flag of the result is not set (see docs). +The intermediate status, represented by the pts, must be saved on the client and the query must be repeated, using the intermediate status as the current status.

+

For perfomance reasons and for better user experience, client can set maximum gap size to be filled: pts_total_limit parameter of updates.getDifference and limit parameter for updates.getChannelDifference can be used.

+

If the gap is too large and there are too many updates to fetch, a *TooLong constructor will be returned. In this case, the client must re-fetch the state, re-start fetching updates from that state and follow the instructions that can be found here.

+

It is recommended to use limit 10-100 for channels and 1000-10000 otherwise.

+

Example implementations

+

Implementations also have to take care to postpone updates received via the socket while filling gaps in the event and Update sequences, as well as avoid filling gaps in the same sequence.

+

Example implementations: tdlib, MadelineProto.

+

An interesting and easy way this can be implemented, instead of using various locks, is by running background loops, like in MadelineProto ».

+

PUSH Notifications about Updates

+

If a client does not have an active connection at the time of an event, PUSH Notifications will also be useful.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/api/url-authorization.html b/data/core.telegram.org/api/url-authorization.html new file mode 100644 index 0000000000..144dd648fa --- /dev/null +++ b/data/core.telegram.org/api/url-authorization.html @@ -0,0 +1,130 @@ + + + + + Seamless Telegram Login + + + + + + + + + + + + + +
+ +
+
+
+ +

Seamless Telegram Login

+ +

Bots may ask users to login to a certain website via Telegram when clicking on certain URL buttons in inline keyboards.

+

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:

+
    +
  • The domain parameter will contain the domain name of the website on which the user will log in (example: comments.app).
  • +
  • The bot parameter will contain info about the bot which will be used for user authorization (example: DiscussBot).
  • +
  • The request_write_access will be set if the bot would like to send messages to the user.
  • +
+

The info should be shown in a prompt:

+
+ TITLE +
+

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, 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.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/web-events.html b/data/core.telegram.org/api/web-events.html new file mode 100644 index 0000000000..b82ec4ec1a --- /dev/null +++ b/data/core.telegram.org/api/web-events.html @@ -0,0 +1,177 @@ + + + + + Web events + + + + + + + + + + + + + +
+ +
+
+
+ +

Web events

+ +
+ +

When interacting with HTML5 games and the websites of payment gateways, Telegram apps should expose APIs to allow receiving data and events from the websites.

+

Event APIs

+

Games and payment gateways can generate events that are meant to be received by the Telegram apps. +Typically events are generated by using the postEvent method of the GamingCommunication library. +The postEvent function will try sending the event to the Telegram app in a number of different ways.

+

WebviewProxy

+

In mobile apps, the event receiver API should be typically exposed as a window.TelegramWebviewProxy object with a postEvent method.

+
window.TelegramWebviewProxy.postEvent(eventType, eventData)
+

window.external

+

Alternatively, a window.external.notify method can be exposed, accepting a string JSON payload with the event type and payload:

+
window.external.notify(JSON.stringify({eventType: eventType, eventData: eventData}));
+

postMessage API

+

Finally, web MTProto clients that need to open a game or process a payment in an iframe can use the postMessage API to receive events from iframes. +The GamingCommunication library by defaultwill use '*' as targetOrigin, sending messages to parent pages regardless of the origin of the embedder.

+
window.parent.postMessage(JSON.stringify({eventType: eventType, eventData: eventData}), targetOrigin);
+

Event types

+

eventType is a simple string indicating the event type, and eventData is a payload with an object that will be parsed by the Telegram app.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
eventTypeeventDataDescription
payment_form_submitJSON object with data and title fieldstitle is the censored credit card title.
data is a service-specific JSON payload with information about the payment credentials provided by the user to the payment system.
Neither Telegram, nor bots will have access to your credit card information.
Credit card details will be handled only by the payment system.
share_scorenullWill be called by games when the user explicitly clicks on the share score button to share the game, along with his score.
Typically done by using messages.forwardMessages on the game message with the with_my_score flag.
share_gamenullWill be called by games when the user explicitly clicks on the share game button to share the game, without sharing his score.
Typically done by using messages.forwardMessages on the game message without the with_my_score flag, or by sharing the game's short URL.
game_overnullCan be called by games when the user loses a game
game_loadednullCan be called by games once the game fully loads
resize_frameJSON object with height fieldCalled by supported pages inside of IV iframe embeds, indicates the new size of the embed frame.
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/bots.html b/data/core.telegram.org/bots.html new file mode 100644 index 0000000000..96e0a5d1fb --- /dev/null +++ b/data/core.telegram.org/bots.html @@ -0,0 +1,434 @@ + + + + + Bots: An introduction for developers + + + + + + + + + + + + + +
+ +
+
+
+
+

Bots: An introduction for developers

+ +
+ +

Bots are third-party applications that run inside Telegram. Users can interact with bots by sending them messages, commands and inline requests. You control your bots using HTTPS requests to our Bot API.

+

1. What can I do with bots?

+
+ +
+ +

To name just a few things, you could use bots to:

+
    +
  • Get customized notifications and news. A bot can act as a smart newspaper, sending you relevant content as soon as it's published.

    +
  • +
  • Integrate with other services. A bot can enrich Telegram chats with content from external services.
    Gmail Bot, GIF bot, IMDB bot, Wiki bot, Music bot, Youtube bot, GitHubBot

    +
  • +
  • Accept payments from Telegram users. A bot can offer paid services or work as a virtual storefront. Read more »
    Demo Shop Bot, Demo Store

    +
  • +
  • Create custom tools. A bot may provide you with alerts, weather forecasts, translations, formatting or other services.
    Markdown bot, Sticker bot, Vote bot, Like bot

    +
  • +
  • Build single- and multiplayer games. A bot can offer rich HTML5 experiences, from simple arcades and puzzles to 3D-shooters and real-time strategy games.
    GameBot, Gamee

    +
  • +
  • Build social services. A bot could connect people looking for conversation partners based on common interests or proximity.

    +
  • +
  • Do virtually anything else. Except for dishes — bots are terrible at doing the dishes.

    +
  • +
+

2. How do bots work?

+

At the core, Telegram Bots are special accounts that do not require an additional phone number to set up. Users can interact with bots in two ways:

+
    +
  • Send messages and commands to bots by opening a chat with them or by adding them to groups.
  • +
  • Send requests directly from the input field by typing the bot's @username and a query. This allows sending content from inline bots directly into any chat, group or channel.
  • +
+

Messages, commands and requests sent by users are passed to the software running on your servers. Our intermediary server handles 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. We call that interface our Bot API.

+
+

A detailed description of the Bot API is available on this page »

+
+

3. How do I create a bot?

+
+ +
+ +

There's a… bot for that. Just talk to BotFather (described below) and follow a few simple steps. Once you've created a bot and received your authorization token, head down to the Bot API manual to see what you can teach your bot to do.

+
+

You may also like to check out some code examples here »

+
+

4. How are bots different from humans?

+
    +
  • Bots have no online status and no last seen timestamps, the interface shows the label 'bot' instead.
  • +
  • Bots have limited cloud storage — older messages may be removed by the server shortly after they have been processed.
  • +
  • Bots can't initiate conversations with users. A user must either add them to a group or send them a message first. People can use t.me/<bot_username> links or username search to find your bot.
  • +
  • Bot usernames always end in 'bot' (e.g. @TriviaBot, @GitHub_bot).
  • +
  • When added to a group, bots do not receive all messages by default (see Privacy mode).
  • +
  • Bots never eat, sleep or complain (unless expressly programmed otherwise).
  • +
+
+

5. Bot perks

+

Telegram bots are unique in many ways — we offer two kinds of keyboards, additional interfaces for default commands and deep linking as well as text formatting, integrated payments and more.

+

Inline mode

+ + +

Users can interact with your bot via inline queries straight from the text input field in any chat. All they need to do is start a message with your bot's username and then type a query.

+

Having received the query, your bot can return some results. As soon as the user taps one of them, it is sent to the user's currently opened chat. This way, people can request content from your bot in any of their chats, groups or channels.

+

Check out this blog to see a sample inline bot in action. You can also try the @sticker and @music bots to see for yourself.

+
+
+ +
+ +

We've also implemented an easy way for your bot to switch between inline and PM modes.

+
+

Read more about the Inline Mode »

+
+

Payment platform

+ + +

You can use bots to accept payments from Telegram users around the world.

+
    +
  • Send invoices to any chat, including to groups and channels.
  • +
  • Create invoices that can be forwarded and used by multiple buyers to order things.
  • +
  • Use inline mode to help users show your goods and services to their friends and communities.
  • +
  • Allow tips from users with preset and custom amounts.
  • +
  • Accept payments from users on mobile or desktop apps.
  • +
  • Try @ShopBot to create a test invoice – or start a message with @ShopBot ... in any chat for an inline invoice.
  • +
  • Check out Demo Shop for an example of a Telegram Channel used as virtual storefront.
  • +
+
+ +
+ +
+

Read more about the Payments Platform »

+
+

Gaming platform

+

Bots can offer their users HTML5 games to play solo or to compete against each other in groups and one-on-one chats. The platform allows your bot to keep track of high scores for every game played in every chat. Whenever there’s a new leader in the game, other playing members in the chat are notified that they need to step it up.

+
+ + +
+
+ +

Since the underlying technology is HTML5, the games can be anything from simple arcades and puzzles to multiplayer 3D-shooters and real-time strategy games. Our team has created a couple of simple demos for you to try out:

+ +

You can also check out the @gamee bot that has more than 20 games.

+
+

Read more about the Gaming Platform »

+
+

Keyboards

+

Traditional chat bots can of course be taught to understand human language. But sometimes you want some more formal input from the user — and this is where custom keyboards can become extremely useful.

+

Whenever your bot sends a message, it can pass along a special keyboard with predefined reply options (see ReplyKeyboardMarkup). Telegram apps that receive the message will display your keyboard to the user. Tapping any of the buttons will immediately send the respective command. This way you can drastically simplify user interaction with your bot.

+

We currently support text and emoji for your buttons. Here are some custom keyboard examples:

+
+
+ + + + + + + +
+ +
+

For more technical information on custom keyboards, please consult the Bot API manual (see sendMessage).

+
+

Inline keyboards and on-the-fly updating

+

There are times when you'd prefer to do things without sending any messages to the chat. For example, when your user is changing settings or flipping through search results. In such cases you can use Inline Keyboards that are integrated directly into the messages they belong to.

+

Unlike with custom reply keyboards, pressing buttons on inline keyboards doesn't result in messages sent to the chat. Instead, inline keyboards support buttons that work behind the scenes: callback buttons, URL buttons and switch to inline buttons.

+
+ + + + +
+ +
+ +

When callback buttons are used, your bot can update its existing messages (or just their keyboards) so that the chat remains tidy. Check out these sample bots to see inline keyboards in action: @music, @vote, @like.

+
+

Read more about inline keyboards and on-the-fly editing »

+
+

Commands

+

Commands present a more flexible way to communicate with your bot. The following syntax may be used:

+
/command
+

A command must always start with the '/' symbol and may not be longer than 32 characters. Commands can use latin letters, numbers and underscores. Here are a few examples:

+
/get_messages_stats
+/set_timer 10min Alarm!
+/get_timezone London, UK
+

Messages that start with a slash are always passed to the bot (along with replies to its messages and messages that @mention the bot by username). Telegram apps will:

+
    +
  • Suggest a list of supported commands with descriptions when the user enters a '/' (for this to work, you need to have provided a list of commands to the BotFather). Tapping on a command in the list immediately sends the command.
  • +
  • Show an additional (/) button in the input field in all chats with bots. Tapping it types a '/' and shows the list of commands.
  • +
  • Highlight /commands in messages. When the user taps a highlighted command, the command is sent at once.
  • +
+
+ + + + + + + +
+ + +

If multiple bots are in a group, it is possible to add bot usernames to commands in order to avoid confusion:

+
/start@TriviaBot
+/start@ApocalypseBot
+

This is done automatically when commands are selected via the list of suggestions. Please remember that your bot needs to be able to process commands that are followed by its username.

+
Global commands
+

In order to make it easier for users to navigate the bot multiverse, we ask all developers to support a few basic commands. Telegram apps will have interface shortcuts for these commands.

+
    +
  • /start - begins interaction with the user, e.g., by sending a greeting message. This command can also be used to pass additional parameters to the bot (see Deep linking)
  • +
  • /help - returns a help message. It can be a short text about what your bot can do and a list of commands.
  • +
  • /settings - (if applicable) returns the bot's settings for this user and suggests commands to edit these settings.
  • +
+

Users will see a Start button when they first open a conversation with your bot. Help and Settings links will be available in the menu on the bot's profile page.

+
+ + + + +
+ +

Formatting: bold, italic, fixed-width text and inline links

+

You can use bold, italic or fixed-width text, as well as inline links in your bots' messages. Telegram clients will render them accordingly.

+
+

Read more in the Bot API manual »

+
+

Privacy mode

+

Bots are frequently added to groups in order to augment communication between human users, e.g. by providing news, notifications from external services or additional search functionality. This is especially true for work-related groups. Now, when you share a group with a bot, you tend to ask yourself “How can I be sure that the little rascal isn't selling my chat history to my competitors?” The answer is — privacy mode.

+

A bot running in privacy mode will not receive all messages that people send to the group. Instead, it will only receive:

+
    +
  • Messages that start with a slash '/' (see Commands above)
  • +
  • Replies to the bot's own messages
  • +
  • Service messages (people added or removed from the group, etc.)
  • +
  • Messages from channels where it's a member
  • +
+

On one hand, this helps some of us sleep better at night (in our tinfoil nightcaps), on the other — it allows the bot developer to save a lot of resources, since they won't need to process tens of thousands irrelevant messages each day.

+

Privacy mode is enabled by default for all bots, except bots that were added to the group as admins (bot admins always receive all messages). It can be disabled, so that the bot receives all messages like an ordinary user (the bot will need to be re-added to the group for this change to take effect). We only recommend doing this in cases where it is absolutely necessary for your bot to work — users can always see a bot's current privacy setting in the group members list. In most cases, using the force reply option for the bot's messages should be more than enough.

+

So what messages exactly will my bot get? »

+

Deep linking

+

Telegram bots have a deep linking mechanism, that allows for passing additional parameters to the bot on startup. It could be a command that launches the bot — or an auth token to connect the user's Telegram account to their account on some external service.

+

Each bot has a link that opens a conversation with it in Telegram — https://t.me/<bot username>. You can add the parameters start or startgroup to this link, with values up to 64 characters long. For example:

+
https://t.me/triviabot?startgroup=test
+

A-Z, a-z, 0-9, _ and - are allowed. We recommend using base64url to encode parameters with binary and other types of content.

+

Following a link with the start parameter will open a one-on-one conversation with the bot, showing a START button in the place of the input field. If the startgroup parameter is used, the user is prompted to select a group to add the bot to. As soon as a user confirms the action (presses the START button in their app or selects a group to add the bot to), your bot will receive a message from that user in this format:

+
/start PAYLOAD
+

PAYLOAD stands for the value of the start or startgroup parameter that was passed in the link.

+
Deep linking Example
+

Suppose the website example.com would like to send notifications to its users via a Telegram bot. Here's what they could do to enable notifications for a user with the ID 123.

+
    +
  1. Create a bot with a suitable username, e.g. @ExampleComBot
  2. +
  3. Set up a webhook for incoming messages
  4. +
  5. Generate a random string of a sufficient length, e.g. $memcache_key = "vCH1vGWJxfSeofSAs0K5PA"
  6. +
  7. Put the value 123 with the key $memcache_key into Memcache for 3600 seconds (one hour)
  8. +
  9. Show our user the button https://t.me/ExampleComBot?start=vCH1vGWJxfSeofSAs0K5PA
  10. +
  11. Configure the webhook processor to query Memcached with the parameter that is passed in incoming messages beginning with /start. If the key exists, record the chat_id passed to the webhook as telegram_chat_id for the user 123. Remove the key from Memcache.
  12. +
  13. Now when we want to send a notification to the user 123, check if they have the field telegram_chat_id. If yes, use the sendMessage method in the Bot API to send them a message in Telegram.
  14. +
+

Location and Number

+

Some bots need extra data from the user to work properly. For example, knowing the user's location helps provide more relevant geo-specific results. The user's phone number can be very useful for integrations with other services, like banks, etc.

+

Bots can ask a user for their location and phone number using special buttons. Note that both phone number and location request buttons will only work in private chats.

+
+
+ +
+ +

When these buttons are pressed, Telegram clients will display a confirmation alert that tells the user what's about to happen.

+
+

Manual: Number and location buttons »

+
+
+

6. BotFather

+
+

Jump to top to learn everything about Telegram bots »

+
+

BotFather is the one bot to rule them all. It will help you create new bots and change settings for existing ones.

+

Creating a new bot

+

Use the /newbot command to create a new bot. The BotFather will ask you for a name and username, then generate an authorization token for your new bot.

+

The name of your bot is displayed in contact details and elsewhere.

+

The Username is a short name, to be used in mentions and t.me links. Usernames are 5-32 characters long and are case insensitive, but may only include Latin characters, numbers, and underscores. Your bot's username must end in 'bot', e.g. 'tetris_bot' or 'TetrisBot'.

+

The token is a string along the lines of 110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw that is required to authorize the bot and send requests to the Bot API. Keep your token secure and store it safely, it can be used by anyone to control your bot.

+

Generating an authorization token

+

If your existing token is compromised or you lost it for some reason, use the /token command to generate a new one.

+

Botfather commands

+

The remaining commands are pretty self-explanatory:

+
    +
  • /mybots — returns a list of your bots with handy controls to edit their settings
  • +
  • /mygames — does the same for your games
  • +
+

Edit bots

+
    +
  • /setname – change your bot's name.
  • +
  • /setdescription — change the bot's description, a short text of up to 512 characters, describing your bot. Users will see this text at the beginning of the conversation with the bot, titled 'What can this bot do?'.
  • +
  • /setabouttext — change the bot's about info, an even shorter text of up to 120 characters. Users will see this text on the bot's profile page. When they share your bot with someone, this text is sent together with the link.
  • +
  • /setuserpic — change the bot's profile pictures. It's always nice to put a face to a name.
  • +
  • /setcommands — change the list of commands supported by your bot. Users will see these commands as suggestions when they type / in the chat with your bot. Each command has a name (must start with a slash ‘/’, alphanumeric plus underscores, no more than 32 characters, case-insensitive), parameters, and a text description. Users will see the list of commands whenever they type '/' in a conversation with your bot.
  • +
  • /deletebot — delete your bot and free its username.
  • +
+

Edit settings

+
    +
  • /setinline — toggle inline mode for your bot.
  • +
  • /setinlinegeo - request location data to provide location-based inline results.
  • +
  • /setjoingroups — toggle whether your bot can be added to groups or not. Any bot must be able to process private messages, but if your bot was not designed to work in groups, you can disable this.
  • +
  • /setprivacy — set which messages your bot will receive when added to a group. With privacy mode disabled, the bot will receive all messages. We recommend leaving privacy mode enabled. You will need to re-add the bot to existing groups for this change to take effect.
  • +
+

Manage games

+
    +
  • /newgame — create a new game.
  • +
  • /listgames — get a list of your games.
  • +
  • /editgame — edit a game.
  • +
  • /deletegame — delete an existing game.
  • +
+
+

Please note, that it may take a few minutes for changes to take effect.

+
+

Status alerts

+

Millions choose Telegram for its speed. To stay competitive in this environment, your bot also needs to be responsive. In order to help developers keep their bots in shape, Botfather will send status alerts if it sees something is wrong.

+

We will be checking the number of replies and the request/response conversion rate for popular bots (~300 requests per minute: but don't write this down as the value may change in the future). If we get abnormally low readings, you will receive a notification from Botfather.

+
Responding to alerts
+

By default, you will only get one alert per bot per hour. Each alert has the following buttons:

+
    +
  • Fixed. Use this if you found an issue with your bot and fixed it. If you press the fix button, we will resume sending alerts in the regular way so that you can see if your fix worked within 5-10 minutes instead of having to wait for an hour.
  • +
  • Support. Use this to open a chat with @BotSupport if you don't see any issues with your bot or if you think the problem is on our side.
  • +
  • Mute for 8h/1w. Use this if you can't fix your bot at the moment. This will disable all alerts for the bot in question for the specified period of time. We do not recommend using this option since your users may migrate to a more stable bot. You can unmute alerts in your bot's settings via Botfather.
  • +
+
Monitored issues
+

We will currently notify you about the following issues:

+

1.

+
Too few **private messages** are sent compared to previous weeks: **{value}**
+

Your bot is sending much fewer messages than it did in the previous weeks. This is useful for newsletter-style bots that send out messages without prompts from the users. The larger the value, the more significant the difference.

+

2.

+
Too few replies to incoming **private messages**. Conversion rate: **{value}**
+

Your bot is not replying to all messages that are being sent to it (the request/response conversion rate for your bot was too low for at least two of the last three 5-minute periods). To provide a good user experience, please respond to all messages that are sent to your bot. Respond to message updates by calling send… methods (e.g. sendMessage).

+

3.

+
Too few answers to **inline queries**. Conversion rate: **{value}**
+

Your bot is not replying to all inline queries that are being sent to it, calculated in the same way as above. Respond to inline_query updates by calling answerInlineQuery.

+

4.

+
Too few answers to **callback queries**. Conversion rate: **{value}**
+Too few answers to **callback game queries**. Conversion rate: **{value}**
+

Your bot is not replying to all callback queries that are being sent to it (with or without games), calculated in the same way as above. Respond to callback_query updates by calling answerCallbackQuery.

+
+

Please note that the status alerts feature is still being tested and will be improved in the future.

+
+
+

That's it for the introduction. You are now definitely ready to proceed to the BOT API MANUAL.

+

If you've got any questions, please check out our Bot FAQ »

+
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/bots/2-0-intro.html b/data/core.telegram.org/bots/2-0-intro.html new file mode 100644 index 0000000000..eaf0513a80 --- /dev/null +++ b/data/core.telegram.org/bots/2-0-intro.html @@ -0,0 +1,230 @@ + + + + + Introducing Bot API 2.0 + + + + + + + + + + + + + +
+ +
+
+
+
+

Introducing Bot API 2.0

+ +
+ +
+

Howdy! This text assumes that you‘re familiar with Telegram’s bot platform.
If this is not the case, kindly check out our Introduction to Bots.

+
+

Today we‘re introducing the biggest change to Telegram’s Bot Platform since June 2015. These new tools will help you create fluid and intuitive interfaces for your bots. And bots are becoming a lot more capable. They can now send any type of content supported on Telegram, provide location-based services and integrate with other services deeply based on users' phone numbers.

+

If you'd like a more concise changelog, you can find one in the Bot API Manual.

+

New Inline Keyboards

+

To begin with, we're adding a new type of keyboard that is integrated directly into the message it belongs to. Inline keyboards are available for messages sent both in chat mode and inline mode.

+
+ + + +

+ + + +
+ +

Unlike with custom reply keyboards, pressing buttons on inline keyboards doesn't result in messages sent to the chat. Instead, inline keyboards support buttons that work behind the scenes: callback buttons, URL buttons and switch to inline buttons.

+
+

Manual: Inline keyboards »

+
+

Callback buttons

+

When a user presses a callback button, no messages are sent to the chat. Instead, your bot simply receives the relevant query. Upon receiving the query, your bot can display some result in a notification at the top of the chat screen or in an alert.

+
+

+
+ +

Sample bot
@music – This sample music bot uses inline callback buttons to flip pages and reload random results.

+

Read on to updating messages to find out how callback buttons can get even cooler.

+

URL buttons

+

Buttons of this type have a small arrow icon to help the user understand that tapping on a URL button will open an external link. Naturally, we'll show them a confirmation alert before opening the link in the browser.

+
+
+
+ +

Switch to Inline buttons

+

Pressing a switch to inline button prompts the user to select a chat, opens it and inserts the bot's username into the input field. You can also pass a query that will be inserted along with the username – this way your users will immediately get some inline results they can share.

+
+

+
+ +

Sample bot
@sticker – This sticker search bot offers a ‘switch to inline’ button to teach users how to use it in inline mode.

+

Updating Messages

+

Since inline keyboards don‘t send additional messages to the chat, it made sense to give bots a way of manipulating their existing messages, so that they don’t have to send a new message each time they need to update something. This helps reduce clutter and build more fluid interfaces.

+
+
+ +
+
+ +

Sample bot
@music – Watch how the music bot updates its messages with search results when you press the navigation buttons.

+
+

Manual: Updating messages »

+
+

Locations and Numbers

+

Some bots need extra data from the user to work properly. For example, knowing the user‘s location helps provide more relevant geo-specific results. The user’s phone number can be very useful for integrations with other services, like banks, etc.

+

We've added an easy way for bots to ask the user for their location and phone number using special buttons. Note that both phone number and location request buttons will only work in private chats.

+
+

+
+ +

When these buttons are pressed, Telegram clients will display a confirmation alert that tells the user what's about to happen.

+
+

Manual: Number and location buttons »

+
+

Inline bots can also request location data from their users. Use the /setinlinegeo command with @BotFather to enable this. Your bot will ask the user for permission to access their location whenever they send an inline request.

+

Sample bot
@foursquare – This bot will ask for permission to access the user's location, then provide geo-targeted results.

+

Inline Bots 2.0

+

Speaking of inline bots, they are also getting a major upgrade today.

+

New types of content

+

Inline bots now support all types of content available in Telegram (19 in all), they are now capable of sending stickers, videos, music, locations, documents and more.

+
+

+
+ +

Sample bots
@sticker – This sticker bot will accept one or more emoji and search for relevant stickers.
@music – The music bot allows users to send mp3 tracks from a database of public domain classical music.

+
+

Manual: Types of inline content »

+
+

Switching between inline mode and private chat

+

Some inline bots can benefit from an initial setup process, like connecting them to an account on an external service (e.g., YouTube). We've added an easy way of switching between the private chat with a bot and whatever chat the user wants to share inline results in.

+
+

+
+ +

You can now display a special ‘Switch to PM’ button above the inline results (or instead of them). This button will open a private chat with the bot and pass a parameter of your choosing, so that you can prompt the user for the relevant setup actions. Once done, you can use an inline keyboard with a switch_inline_query button to send the user back to the original chat.

+

Sample bots
@youtube – Shows a ‘Sign in to YouTube’ button, then suggests personalized results.

+
+

Manual: Switch to PM

+
+

Better inline UI

+

Since sending content via inline bots works differently from sending ordinary messages, we‘ve changed the interface a little. There’s hardly a more effective way of explaining that there‘s no need to hit ’Send':

+
+

+
+ +

Tapping on the cross icon once will clear the query, tapping twice will give the ‘Send’ button back to the user.

+

Group Admins

+

As a dessert, we‘re beginning to roll out tools that will allow you to create bot solutions for group admins. As the first step, we’ve added methods to remove members from groups and supergroups.

+
+

Manual: Group management »

+
+

And that's about it for now. Stay tuned for more updates and subscribe to our official @Botnews channel on Telegram.

+
+

Read the full changelog for this update »

+
+
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/bots/api-changelog.html b/data/core.telegram.org/bots/api-changelog.html new file mode 100644 index 0000000000..cb61488146 --- /dev/null +++ b/data/core.telegram.org/bots/api-changelog.html @@ -0,0 +1,599 @@ + + + + + Bot API changelog + + + + + + + + + + + + + +
+ +
+
+
+
+

Bot API changelog

+ +
+ +
+

The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.
To learn how to create and set up a bot, please consult our Introduction to Bots »

+
+

You will find all changes to our Bot API on this page.

+

Recent changes

+
+

Subscribe to @BotNews to be the first to know about the latest updates and join the discussion in @BotTalk

+
+

April 26, 2021

+

Bot API 5.2

+
    +
  • Support for Payments 2.0, see this manual for more details about the Bot Payments API.
  • +
  • Added the type InputInvoiceMessageContent to support sending invoices as inline query results.
  • +
  • Allowed sending invoices to group, supergroup and channel chats.
  • +
  • Added the fields max_tip_amount and suggested_tip_amounts to the method sendInvoice to allow adding optional tips to the payment.
  • +
  • The parameter start_parameter of the method sendInvoice became optional. If the parameter isn't specified, the invoice can be paid directly from forwarded messages.
  • +
  • Added the field chat_type to the class InlineQuery, containing the type of the chat, from which the inline request was sent.
  • +
  • Added the type VoiceChatScheduled and the field voice_chat_scheduled to the class Message.
  • +
  • Fixed an error in sendChatAction documentation to correctly mention “record_voice” and “upload_voice” instead of “record_audio” and “upload_audio” for related to voice note actions. Old action names will still work for backward compatibility.
  • +
+
+
+

⚠️ WARNING! ⚠️
After the next Bot API update (Bot API 5.3) there will be a one-time change of the value of the field file_unique_id in objects of the type PhotoSize and of the fields small_file_unique_id and big_file_unique_id in objects of the type ChatPhoto.

+
+
+
+

⚠️ WARNING! ⚠️
Service messages about non-bot users joining the chat will be soon removed from large groups. We recommend using the “chat_member” update as a replacement.

+
+
+
+

⚠️ WARNING! ⚠️
After one of the upcoming Bot API updates, user identifiers will become bigger than 2^31 - 1 and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

+
+
+

March 9, 2021

+

Bot API 5.1

+

Added two new update types

+
    +
  • Added updates about member status changes in chats, represented by the class ChatMemberUpdated and the fields my_chat_member and chat_member in the Update class. The bot must be an administrator in the chat to receive chat_member updates about other chat members. By default, only my_chat_member updates about the bot itself are received.
  • +
+

Improved Invite Links

+
    +
  • Added the class ChatInviteLink, representing an invite link to a chat.
  • +
  • Added the method createChatInviteLink, which can be used to create new invite links in addition to the primary invite link.
  • +
  • Added the method editChatInviteLink, which can be used to edit non-primary invite links created by the bot.
  • +
  • Added the method revokeChatInviteLink, which can be used to revoke invite links created by the bot.
  • +
+

Voice Chat Info

+ +

And More

+
    +
  • Added the type MessageAutoDeleteTimerChanged and the field message_auto_delete_timer_changed to the class Message.
  • +
  • Added the parameter revoke_messages to the method kickChatMember, allowing to delete all messages from a group for the user who is being removed.
  • +
  • Added the new administrator privilege can_manage_chat to the class ChatMember and parameter can_manage_chat to the method promoteChatMember. This administrator right is implied by any other administrator privilege.
  • +
  • Supported the new bowling animation for the random dice. Choose between different animations (dice, darts, basketball, football, bowling, slot machine) by specifying the emoji parameter in the method sendDice.
  • +
+
+
+

⚠️ WARNING! ⚠️
After one of the upcoming Bot API updates, some user identifiers will become bigger than 2^31 - 1 and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

+
+
+

November 4, 2020

+

Introducing Bot API 5.0

+

Run Your Own Bot API Server

+
    +
  • Bot API source code is now available at telegram-bot-api. You can now run your own Bot API server locally, boosting your bots' performance.
  • +
  • Added the method logOut, which can be used to log out from the cloud Bot API server before launching your bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive all updates.
  • +
  • Added the method close, which can be used to close the bot instance before moving it from one local server to another.
  • +
+

Transfer Bot Ownership

+
    +
  • You can now use @BotFather to transfer your existing bots to another Telegram account.
  • +
+

Webhooks

+
    +
  • Added the parameter ip_address to the method setWebhook, allowing to bypass DNS resolving and use the specified fixed IP address to send webhook requests.
  • +
  • Added the field ip_address to the class WebhookInfo, containing the current IP address used for webhook connections creation.
  • +
  • Added the ability to drop all pending updates when changing webhook URL using the parameter drop_pending_updates in the methods setWebhook and deleteWebhook.
  • +
+

Working with Groups

+
    +
  • The getChat request now returns the user's bio for private chats if available.
  • +
  • The getChat request now returns the identifier of the linked chat for supergroups and channels, i.e. the discussion group identifier for a channel and vice versa.
  • +
  • The getChat request now returns the location to which the supergroup is connected (see Local Groups). Added the class ChatLocation to represent the location.
  • +
  • Added the parameter only_if_banned to the method unbanChatMember to allow safe unban.
  • +
+

Working with Files

+
    +
  • Added the field file_name to the classes Audio and Video, containing the name of the original file.
  • +
  • Added the ability to disable server-side file content type detection using the parameter disable_content_type_detection in the method sendDocument and the class inputMediaDocument.
  • +
+

Multiple Pinned Messages

+
    +
  • Added the ability to pin messages in private chats.
  • +
  • Added the parameter message_id to the method unpinChatMessage to allow unpinning of the specific pinned message.
  • +
  • Added the method unpinAllChatMessages, which can be used to unpin all pinned messages in a chat.
  • +
+

File Albums

+
    +
  • Added support for sending and receiving audio and document albums in the method sendMediaGroup.
  • +
+

Live Locations

+ +

Anonymous Admins

+
    +
  • Added the field sender_chat to the class Message, containing the sender of a message which is a chat (group or channel). For backward compatibility in non-channel chats, the field from in such messages will contain the user 777000 for messages automatically forwarded to the discussion group and the user 1087968824 (@GroupAnonymousBot) for messages from anonymous group administrators.
  • +
  • Added the field is_anonymous to the class chatMember, which can be used to distinguish anonymous chat administrators.
  • +
  • Added the parameter is_anonymous to the method promoteChatMember, which allows to promote anonymous chat administrators. The bot itself should have the is_anonymous right to do this. Despite the fact that bots can have the is_anonymous right, they will never appear as anonymous in the chat. Bots can use the right only for passing to other administrators.
  • +
  • Added the custom title of an anonymous message sender to the class Message as author_signature.
  • +
+

And More

+ +

And Last but not Least

+
    +
  • Supported the new football and slot machine animations for the random dice. Choose between different animations (dice, darts, basketball, football, slot machine) by specifying the emoji parameter in the method sendDice.
  • +
+

June 4, 2020

+

Bot API 4.9

+
    +
  • Added the new field via_bot to the Message object. You can now know which bot was used to send a message.
  • +
  • Supported video thumbnails for inline GIF and MPEG4 animations.
  • +
  • Supported the new basketball animation for the random dice. Choose between different animations (dice, darts, basketball) by specifying the emoji parameter in the method sendDice.
  • +
+

April 24, 2020

+

Bot API 4.8

+
    +
  • Supported explanations for Quizzes 2.0. Add explanations by specifying the parameters explanation and explanation_parse_mode in the method sendPoll.
  • +
  • Added the fields explanation and explanation_entities to the Poll object.
  • +
  • Supported timed polls that automatically close at a certain date and time. Set up by specifying the parameter open_period or close_date in the method sendPoll.
  • +
  • Added the fields open_period and close_date to the Poll object.
  • +
  • Supported the new darts animation for the dice mini-game. Choose between the default dice animation and darts animation by specifying the parameter emoji in the method sendDice.
  • +
  • Added the field emoji to the Dice object.
  • +
+

March 30, 2020

+

Bot API 4.7

+
    +
  • Added the method sendDice for sending a dice message, which will have a random value from 1 to 6. (Yes, we're aware of the “proper” singular of die. But it's awkward, and we decided to help it change. One dice at a time!)
  • +
  • Added the field dice to the Message object.
  • +
  • Added the method getMyCommands for getting the current list of the bot's commands.
  • +
  • Added the method setMyCommands for changing the list of the bot's commands through the Bot API instead of @BotFather.
  • +
  • Added the ability to create animated sticker sets by specifying the parameter tgs_sticker instead of png_sticker in the method createNewStickerSet.
  • +
  • Added the ability to add animated stickers to sets created by the bot by specifying the parameter tgs_sticker instead of png_sticker in the method addStickerToSet.
  • +
  • Added the field thumb to the StickerSet object.
  • +
  • Added the ability to change thumbnails of sticker sets created by the bot using the method setStickerSetThumb.
  • +
+

January 23, 2020

+

Bot API 4.6

+
    +
  • Supported Polls 2.0.
  • +
  • Added the ability to send non-anonymous, multiple answer, and quiz-style polls: added the parameters is_anonymous, type, allows_multiple_answers, correct_option_id, is_closed options to the method sendPoll.
  • +
  • Added the object KeyboardButtonPollType and the field request_poll to the object KeyboardButton.
  • +
  • Added updates about changes of user answers in non-anonymous polls, represented by the object PollAnswer and the field poll_answer in the Update object.
  • +
  • Added the fields total_voter_count, is_anonymous, type, allows_multiple_answers, correct_option_id to the Poll object.
  • +
  • Bots can now send polls to private chats.
  • +
  • Added more information about the bot in response to the getMe request: added the fields can_join_groups, can_read_all_group_messages and supports_inline_queries to the User object.
  • +
  • Added the optional field language to the MessageEntity object.
  • +
+

December 31, 2019

+

Bot API 4.5

+
    +
  • Added support for two new MessageEntity types, underline and strikethrough.
  • +
  • Added support for nested MessageEntity objects. Entities can now contain other entities. If two entities have common characters then one of them is fully contained inside the other.
  • +
  • Added support for nested entities and the new tags <u>/<ins> (for underlined text) and <s>/<strike>/<del> (for strikethrough text) in parse mode HTML.
  • +
  • Added a new parse mode, MarkdownV2, which supports nested entities and two new entities __ (for underlined text) and ~ (for strikethrough text). Parse mode Markdown remains unchanged for backward compatibility.
  • +
  • Added the field file_unique_id to the objects Animation, Audio, Document, PassportFile, PhotoSize, Sticker, Video, VideoNote, Voice, File and the fields small_file_unique_id and big_file_unique_id to the object ChatPhoto. The new fields contain a unique file identifier, which is supposed to be the same over time and for different bots, but can't be used to download or reuse the file.
  • +
  • Added the field custom_title to the ChatMember object.
  • +
  • Added the new method setChatAdministratorCustomTitle to manage the custom titles of administrators promoted by the bot.
  • +
  • Added the field slow_mode_delay to the Chat object.
  • +
+

July 29, 2019

+

Bot API 4.4

+
    +
  • Added support for animated stickers. New field is_animated in Sticker and StickerSet objects, animated stickers can now be used in sendSticker and InlineQueryResultCachedSticker.
  • +
  • Added support for default permissions in groups. New object ChatPermissions, containing actions which a member can take in a chat. New field permissions in the Chat object; new method setChatPermissions.
  • +
  • The field all_members_are_administrators has been removed from the documentation for the Chat object. The field is still returned in the object for backward compatibility, but new bots should use the permissions field instead.
  • +
  • Added support for more permissions for group and supergroup members: added the new field can_send_polls to ChatMember object, added can_change_info, can_invite_users, can_pin_messages in ChatMember object for restricted users (previously available only for administrators).
  • +
  • The method restrictChatMember now takes the new user permissions in a single argument of the type ChatPermissions. The old way of passing parameters will keep working for a while for backward compatibility.
  • +
  • Added description support for basic groups (previously available in supergroups and channel chats). You can pass a group's chat_id to setChatDescription and receive the group's description in the Chat object in the response to getChat method.
  • +
  • Added invite_link support for basic groups (previously available in supergroups and channel chats). You can pass a group's chat_id to exportChatInviteLink and receive the group's invite link in the Chat object in the response to getChat method.
  • +
  • File identifiers from the ChatPhoto object are now invalidated and can no longer be used whenever the photo is changed.
  • +
  • All webhook requests from the Bot API are now coming from the subnets 149.154.160.0/20 and 91.108.4.0/22. Most users won't need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: https://core.telegram.org/bots/webhooks.
  • +
  • As of the next Bot API update (version 4.5), nested MessageEntity objects will be allowed in message texts and captions. Please make sure that your code can correctly handle such entities.
  • +
+

May 31, 2019

+

Bot API 4.3

+
    +
  • Added support for Seamless Telegram Login on external websites.
  • +
  • Added the new object LoginUrl and the new field login_url to the InlineKeyboardButton object which allows to automatically authorize users before they go to a URL specified by the bot. Users will be asked to confirm authorization in their Telegram app (needs version 5.7 or higher) when they press the button:
  • +
+
+ TITLE +
+ +

Also in this update:

+
    +
  • Added the field reply_markup to the Message object, containing the inline keyboard attached to the message.
  • +
  • If a message with an inline keyboard is forwarded, the forwarded message will now have an inline keyboard if the keyboard contained only url and login_url buttons or if the message was sent via a bot and the keyboard contained only url, login_url, switch_inline_query or switch_inline_query_current_chat buttons. In the latter case, switch_inline_query_current_chat buttons are replaced with switch_inline_query buttons.
  • +
  • Bots now receive the edited_message Update even if only Message.reply_markup has changed.
  • +
  • Bots that have the can_edit_messages right in a channel can now use the method editMessageReplyMarkup for messages written by other administrators forever without the 48 hours limit.
  • +
  • Don't forget that starting in July 2019, webhook requests from Bot API will be coming from the subnets 149.154.160.0/20 and 91.108.4.0/22. Most users won't need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: https://core.telegram.org/bots/webhooks.
  • +
+

April 14, 2019

+

Bot API 4.2

+
    +
  • Added support for native polls: added the object Poll, the methods sendPoll and stopPoll and the field poll in the Message and Update objects.
  • +
  • The method deleteMessage can now be used to delete messages sent by a user to the bot in private chats within 48 hours.
  • +
  • Added support for pinned messages in basic groups in addition to supergroups and channel chats: you can pass group's chat_id to pinChatMessage and unpinChatMessage, and receive the pinned group message in Chat object.
  • +
  • Added the field is_member to the ChatMember object, which can be used to find whether a restricted user is a member of the chat.
  • +
  • Added the field forward_sender_name to the Message object, containing name of the sender who has opted to hide their account.
  • +
  • Starting in July 2019, webhook requests from Bot API will be coming from the subnets 149.154.160.0/20 and 91.108.4.0/22. Most users won't need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: https://core.telegram.org/bots/webhooks.
  • +
  • Document thumbnails now should be inscribed in a 320x320 square instead of 90x90.
  • +
+

August 27, 2018

+

Bot API 4.1

+ +

July 26, 2018

+

Bot API 4.0.

+
    +
  • Added support for Telegram Passport. See the official announcement on the blog and the manual for details.
  • +
  • Added support for editing the media content of messages: added the method editMessageMedia and new types InputMediaAnimation, InputMediaAudio, and InputMediaDocument.
  • +
  • Added the field thumb to the Audio object to contain the thumbnail of the album cover to which the music file belongs.
  • +
  • Added support for attaching custom thumbnails to uploaded files. For animations, audios, videos and video notes, which are less than 10 MB in size, thumbnails are generated automatically.
  • +
  • tg:// URLs now can be used in inline keyboard url buttons and text_link message entities.
  • +
  • Added the method sendAnimation, which can be used instead of sendDocument to send animations, specifying their duration, width and height.
  • +
  • Added the field animation to the Message object. For backward compatibility, when this field is set, the document field will be also set.
  • +
  • Added two new MessageEntity types: cashtag and phone_number.
  • +
  • Added support for Foursquare venues: added the new field foursquare_type to the objects Venue, InlineQueryResultVenue and InputVenueMessageContent, and the parameter foursquare_type to the sendVenue method.
  • +
  • You can now create inline mentions of users, who have pressed your bot's callback buttons.
  • +
  • You can now use the Retry-After response header to configure the delay after which the Bot API will retry the request after an unsuccessful response from a webhook.
  • +
  • If a webhook returns the HTTP error 410 Gone for all requests for more than 23 hours successively, it can be automatically removed.
  • +
  • Added vCard support when sharing contacts: added the field vcard to the objects Contact, InlineQueryResultContact, InputContactMessageContent and the method sendContact.
  • +
+

February 13, 2018

+

Bot API 3.6.

+
    +
  • Supported text formatting in media captions. Specify the desired parse_mode (Markdown or HTML) when you provide a caption.
  • +
  • In supergroups, if the bot receives a message that is a reply, it will also receive the message to which that message is replying – even if the original message is inaccessible due to the bot's privacy settings. (In other words, replying to any message in a supergroup with a message that mentions the bot or features a command for it acts as forwarding the original message to the bot).
  • +
  • Added the new field connected_website to Message. The bot will receive a message with this field in a private chat when a user logs in on the bot's connected website using the Login Widget and allows sending messages from your bot.
  • +
  • Added the new parameter supports_streaming to the sendVideo method and a field with the same name to the InputMediaVideo object.
  • +
+

November 17, 2017

+

Bot API 3.5.

+ +

October 11, 2017

+

Bot API 3.4.

+ +

August 23, 2017

+

Bot API 3.3.

+
    +
  • Bots can now mention users via inline mentions, without using usernames.
  • +
  • getChat now also returns pinned messages in supergroups, if present. Added the new field pinned_message to the Chat object.
  • +
  • Added the new fields author_signature and forward_signature to the Message object.
  • +
  • Added the new field is_bot to the User object.
  • +
+

July 21, 2017

+

Bot API 3.2. Teach your bot to handle stickers and sticker sets.

+ +

June 30, 2017

+

Bot API 3.1. Build your own robotic police force for supergoups with these new methods for admin bots:

+ +

May 18, 2017

+

Introducing Bot API 3.0.

+

NEW Payment Platform

+

See Introduction to Bot Payments for a brief overview. If you're not a developer, you may like this user-friendly blog post better.

+ +

NEW Video Messages

+
    +
  • As of Telegram v.4.0, users can send short rounded video messages, using an interface similar to that of voice notes.
  • +
  • Added the sendVideoNote method, the new field video_note to Message, the fields record_video_note or upload_video_note to sendChatAction.
  • +
+

NEW Multilingual Bots

+
    +
  • The User object now may have a language_code field that contains the IETF language tag of the user's language.
  • +
  • Thanks to this, your bot can now offer localized responses to users that speak different languages.
  • +
+

More power to admin bots

+
    +
  • unbanChatMemeber now also works in channels!
  • +
  • New method deleteMessage that allows the bot to delete its own messages, as well as messages posted by other in groups and channels where the bot is an administrator.
  • +
+

Minor Changes

+
    +
  • Replaced the field new_chat_member in Message with new_chat_members (the old field will still be available for a while for compatibility purposes).
  • +
  • Inline keyboards with switch_inline_query and switch_inline_query_current_chat can no longer be sent to channels because they are useless there.
  • +
  • New fields gif_duration in InlineQueryResultGif and mpeg4_duration in InlineQueryResultMpeg4Gif.
  • +
+

December 4, 2016

+

Introducing Bot API 2.3.1, a nifty little update that will give you more control over how your bot gets its updates.

+
    +
  • Use the new field max_connections in setWebhook to optimize your bot's server load
  • +
  • Use allowed_updates in setWebhook and getUpdates to selectively subscribe to updates of a certain type. Among other things, this allows you to stop getting updates about new posts in channels where your bot is an admin.
  • +
  • deleteWebhook moved out of setWebhook to get a whole separate method for itself.
  • +
+

November 21, 2016

+

Bot API 2.3

+
    +
  • Modified bot privacy mode for the sake of consistency.
  • +
  • Your bot can now get updates about posts in channels. Added new fields channel_post and edited_channel_post to Update.

    +
  • +
  • You can now update high scores to a lower value by using the new force parameter in setGameScore. Handy for punishing cheaters or fixing errors in your game's High Score table.

    +
  • +
  • Starting today, messages with high scores will be updated with new high scores by default. Use disable_edit_message in setGameScore if you don't want this.
  • +
  • The edit_message parameter from setGameScore is no longer in use. For backward compatibility, it will be taken into account for a while, unless disable_edit_message is passed explicitly.
  • +
  • Added the new field forward_from_message_id to Message.
  • +
  • Added the new parameter cache_time to answerCallbackQuery. Will eventually work in Telegram apps — somewhere after version 3.14, maybe 3.15.
  • +
  • Renamed hide_keyboard to remove_keyboard in ReplyKeyboardRemove for clarity. hide_keyboard will still work for a while for backward compatibility.
  • +
+

October 3, 2016

+

Bot API 2.2. Introducing a new Gaming Platform! See this introduction for a brief overview.
If you're not a developer, you may like this user-friendly blog post better.

+ +

Other changes

+ +
    +
  • New field all_members_are_administrators in the Chat object.
  • +
  • Certain server responses may now contain the new parameters field with expanded info on errors that occurred while processing your requests.
  • +
+

May 25, 2016

+ +

May 22, 2016

+ +

May 12, 2016

+ +

May 6, 2016

+
    +
  • Added the field emoji to the Sticker object. Your bot can now know the emoji a sticker corresponds to.
  • +
  • Added the field forward_from_chat to the Message object for messages forwarded from channels.
  • +
+

April 9, 2016

+

Introducing Bot API 2.0. Check out this page for a review of this major update.

+ +

Inline bots

+
    +
  • Added support for all content types available on Telegram. 19 types of InlineQueryResult objects are now supported.
  • +
  • Inline bots can now substitute all kinds of content with text. Added 4 types of InputMessageContent objects.
  • +
  • Your inline bot can also ask users for permission to use their location. Added the new Botfather command /setinlinegeo, added field location to the InlineQuery object, added fields location and inline_message_id to the ChosenInlineResult object.
  • +
  • Added an easy way to switch between inline mode and a private chat with the bot – useful for settings, establishing external connections and teaching users how to use your bot in inline mode. Added parameters switch_pm_text and switch_pm_parameter to the method answerInlineQuery.
  • +
+

Miscellaneous

+ +

February 20, 2016

+
    +
  • Added the disable_notification parameter to all methods that send messages or any kind.
  • +
  • Removed backward compatibility from the method sendAudio. Voice messages now must be sent using the method sendVoice. There is no more need to specify a non-empty title or performer while sending the audio by file_id.
  • +
+

January 20, 2016

+
    +
  • By the way, you can use both HTML-style and markdown-style formatting in your bot's messages to send bold, italic or fixed-width text and inline links. All official Telegram clients support this. See Formatting options for details.
  • +
+

January 14, 2016

+
    +
  • You can now collect feedback on which results provided by your inline bot get chosen by the users. Added the setinlinefeedback command for Botfather, new type ChosenInlineResult, new field chosen_inline_result to the Update object.
  • +
+

January 4, 2016

+ +

November, 2015

+
    +
  • Added support for supergroups. The Type field in the Chat object can now contain 'supergroup'.
  • +
  • New optional fields added to the Message object: supergroup_chat_created, migrate_to_chat_id, migrate_from_chat_id and channel_chat_created.
  • +
+

October 8, 2015

+
    +
  • Added initial channel support for bots (no Telegram clients support this at the moment, please wait for updates):
  • +
  • The Chat field in the Message is now of the new type Chat.
  • +
  • You can now pass a channel username (in the format @channelusername) in the place of chat_id in all methods (and instead of from_chat_id in forwardMessage). For this to work, the bot must be an administrator in the channel (and that's exactly what Telegram clients don't support yet — adding bots as administrators coming soon).
  • +
+

September 18, 2015

+
    +
  • Bots can now download files and media sent by users.
  • +
  • Added getFile and File.
  • +
+

September 7, 2015

+
    +
  • You can now pass parameters using application/json (please note that this doesn't work for file uploads: use multipart/form-data to upload files).
  • +
  • Added very basic markdown support. New field parse_mode added to sendMessage. For the moment messages with markdown will be displayed correctly only in Telegram for Android. Other official apps will catch up soon.
  • +
+

August 29, 2015

+
    +
  • Added support for self-signed certificates: upload your certificate using the certificate parameter in the setWebhook method.
  • +
  • You can now make new requests when responding to webhook updates.
  • +
+

August 15, 2015

+
    +
  • Added new type Voice and new method sendVoice for sending voice messages.
  • +
  • Earlier Audio and sendAudio should now be used for sending music files. Telegram clients will show such files in the in-app music player. If you were using sendAudio for your bot to send voice messages, please use sendVoice instead.
  • +
  • Added optional fields performer, title to the Audio object and sendAudio method.
  • +
  • Added optional field voice to the Message object.
  • +
+

July 2015

+
    +
  • The thumb field is now optional for Video, Sticker and Document objects
  • +
  • The API now supports both video and photo captions. The caption field has been removed from the Video object and added to the Message object instead.
  • +
  • caption and duration optional fields have been added to the sendVideo method.
  • +
  • Fixed typo: user_id in the Contact object is now correctly labeled as Integer, not String
  • +
+

June 24, 2015

+

The bot platform was officially launched.

+
+

Back to the Bot API Manual »

+
+
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/bots/api.html b/data/core.telegram.org/bots/api.html new file mode 100644 index 0000000000..7b868beb0e --- /dev/null +++ b/data/core.telegram.org/bots/api.html @@ -0,0 +1,8819 @@ + + + + + Telegram Bot API + + + + + + + + + + + + + +
+ +
+
+
+ +

Telegram Bot API

+ +
+ +
+

The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.
To learn how to create and set up a bot, please consult our Introduction to Bots and Bot FAQ.

+
+

Recent changes

+
+

Subscribe to @BotNews to be the first to know about the latest updates and join the discussion in @BotTalk

+
+

April 26, 2021

+

Bot API 5.2

+
    +
  • Support for Payments 2.0, see this manual for more details about the Bot Payments API.
  • +
  • Added the type InputInvoiceMessageContent to support sending invoices as inline query results.
  • +
  • Allowed sending invoices to group, supergroup and channel chats.
  • +
  • Added the fields max_tip_amount and suggested_tip_amounts to the method sendInvoice to allow adding optional tips to the payment.
  • +
  • The parameter start_parameter of the method sendInvoice became optional. If the parameter isn't specified, the invoice can be paid directly from forwarded messages.
  • +
  • Added the field chat_type to the class InlineQuery, containing the type of the chat, from which the inline request was sent.
  • +
  • Added the type VoiceChatScheduled and the field voice_chat_scheduled to the class Message.
  • +
  • Fixed an error in sendChatAction documentation to correctly mention “record_voice” and “upload_voice” instead of “record_audio” and “upload_audio” for related to voice note actions. Old action names will still work for backward compatibility.
  • +
+
+
+

⚠️ WARNING! ⚠️
After the next Bot API update (Bot API 5.3) there will be a one-time change of the value of the field file_unique_id in objects of the type PhotoSize and of the fields small_file_unique_id and big_file_unique_id in objects of the type ChatPhoto.

+
+
+
+

⚠️ WARNING! ⚠️
Service messages about non-bot users joining the chat will be soon removed from large groups. We recommend using the “chat_member” update as a replacement.

+
+
+
+

⚠️ WARNING! ⚠️
After one of the upcoming Bot API updates, user identifiers will become bigger than 2^31 - 1 and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

+
+
+

March 9, 2021

+

Bot API 5.1

+

Added two new update types

+
    +
  • Added updates about member status changes in chats, represented by the class ChatMemberUpdated and the fields my_chat_member and chat_member in the Update class. The bot must be an administrator in the chat to receive chat_member updates about other chat members. By default, only my_chat_member updates about the bot itself are received.
  • +
+

Improved Invite Links

+
    +
  • Added the class ChatInviteLink, representing an invite link to a chat.
  • +
  • Added the method createChatInviteLink, which can be used to create new invite links in addition to the primary invite link.
  • +
  • Added the method editChatInviteLink, which can be used to edit non-primary invite links created by the bot.
  • +
  • Added the method revokeChatInviteLink, which can be used to revoke invite links created by the bot.
  • +
+

Voice Chat Info

+ +

And More

+
    +
  • Added the type MessageAutoDeleteTimerChanged and the field message_auto_delete_timer_changed to the class Message.
  • +
  • Added the parameter revoke_messages to the method kickChatMember, allowing to delete all messages from a group for the user who is being removed.
  • +
  • Added the new administrator privilege can_manage_chat to the class ChatMember and parameter can_manage_chat to the method promoteChatMember. This administrator right is implied by any other administrator privilege.
  • +
  • Supported the new bowling animation for the random dice. Choose between different animations (dice, darts, basketball, football, bowling, slot machine) by specifying the emoji parameter in the method sendDice.
  • +
+
+
+

⚠️ WARNING! ⚠️
After one of the upcoming Bot API updates, some user identifiers will become bigger than 2^31 - 1 and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

+
+
+

November 4, 2020

+

Introducing Bot API 5.0

+

Run Your Own Bot API Server

+
    +
  • Bot API source code is now available at telegram-bot-api. You can now run your own Bot API server locally, boosting your bots' performance (check this out to see if this will benefit your project).
  • +
  • Added the method logOut, which can be used to log out from the cloud Bot API server before launching your bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive all updates.
  • +
  • Added the method close, which can be used to close the bot instance before moving it from one local server to another.
  • +
+

Transfer Bot Ownership

+
    +
  • You can now use @BotFather to transfer your existing bots to another Telegram account.
  • +
+

Webhooks

+
    +
  • Added the parameter ip_address to the method setWebhook, allowing to bypass DNS resolving and use the specified fixed IP address to send webhook requests.
  • +
  • Added the field ip_address to the class WebhookInfo, containing the current IP address used for webhook connections creation.
  • +
  • Added the ability to drop all pending updates when changing webhook URL using the parameter drop_pending_updates in the methods setWebhook and deleteWebhook.
  • +
+

Working with Groups

+
    +
  • The getChat request now returns the user's bio for private chats if available.
  • +
  • The getChat request now returns the identifier of the linked chat for supergroups and channels, i.e. the discussion group identifier for a channel and vice versa.
  • +
  • The getChat request now returns the location to which the supergroup is connected (see Local Groups). Added the class ChatLocation to represent the location.
  • +
  • Added the parameter only_if_banned to the method unbanChatMember to allow safe unban.
  • +
+

Working with Files

+
    +
  • Added the field file_name to the classes Audio and Video, containing the name of the original file.
  • +
  • Added the ability to disable server-side file content type detection using the parameter disable_content_type_detection in the method sendDocument and the class inputMediaDocument.
  • +
+

Multiple Pinned Messages

+
    +
  • Added the ability to pin messages in private chats.
  • +
  • Added the parameter message_id to the method unpinChatMessage to allow unpinning of the specific pinned message.
  • +
  • Added the method unpinAllChatMessages, which can be used to unpin all pinned messages in a chat.
  • +
+

File Albums

+
    +
  • Added support for sending and receiving audio and document albums in the method sendMediaGroup.
  • +
+

Live Locations

+ +

Anonymous Admins

+
    +
  • Added the field sender_chat to the class Message, containing the sender of a message which is a chat (group or channel). For backward compatibility in non-channel chats, the field from in such messages will contain the user 777000 for messages automatically forwarded to the discussion group and the user 1087968824 (@GroupAnonymousBot) for messages from anonymous group administrators.
  • +
  • Added the field is_anonymous to the class chatMember, which can be used to distinguish anonymous chat administrators.
  • +
  • Added the parameter is_anonymous to the method promoteChatMember, which allows to promote anonymous chat administrators. The bot itself should have the is_anonymous right to do this. Despite the fact that bots can have the is_anonymous right, they will never appear as anonymous in the chat. Bots can use the right only for passing to other administrators.
  • +
  • Added the custom title of an anonymous message sender to the class Message as author_signature.
  • +
+

And More

+ +

And Last but bot Least

+
    +
  • Supported the new football and slot machine animations for the random dice. Choose between different animations (dice, darts, basketball, football, slot machine) by specifying the emoji parameter in the method sendDice.
  • +
+

See earlier changes »

+

Authorizing your bot

+

Each bot is given a unique authentication token when it is created. The token looks something like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11, but we'll use simply <token> in this document instead. You can learn about obtaining tokens and generating new ones in this document.

+

Making requests

+

All queries to the Telegram Bot API must be served over HTTPS and need to be presented in this form: https://api.telegram.org/bot<token>/METHOD_NAME. Like this for example:

+
https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getMe
+

We support GET and POST HTTP methods. We support four ways of passing parameters in Bot API requests:

+
    +
  • URL query string
  • +
  • application/x-www-form-urlencoded
  • +
  • application/json (except for uploading files)
  • +
  • multipart/form-data (use to upload files)
  • +
+

The response contains a JSON object, which always has a Boolean field 'ok' and may have an optional String field 'description' with a human-readable description of the result. If 'ok' equals true, the request was successful and the result of the query can be found in the 'result' field. In case of an unsuccessful request, 'ok' equals false and the error is explained in the 'description'. An Integer 'error_code' field is also returned, but its contents are subject to change in the future. Some errors may also have an optional field 'parameters' of the type ResponseParameters, which can help to automatically handle the error.

+
    +
  • All methods in the Bot API are case-insensitive.
  • +
  • All queries must be made using UTF-8.
  • +
+

Making requests when getting updates

+

If you're using webhooks, you can perform a request to the Bot API while sending an answer to the webhook. Use either application/json or application/x-www-form-urlencoded or multipart/form-data response content type for passing parameters. Specify the method to be invoked in the method parameter of the request. It's not possible to know that such a request was successful or get its result.

+
+

Please see our FAQ for examples.

+
+

Using a Local Bot API Server

+

The Bot API server source code is available at telegram-bot-api. You can run it locally and send the requests to your own server instead of https://api.telegram.org. If you switch to a local Bot API server, your bot will be able to:

+
    +
  • Download files without a size limit.
  • +
  • Upload files up to 2000 MB.
  • +
  • Upload files using their local path and the file URI scheme.
  • +
  • Use an HTTP URL for the webhook.
  • +
  • Use any local IP address for the webhook.
  • +
  • Use any port for the webhook.
  • +
  • Set max_webhook_connections up to 100000.
  • +
  • Receive the absolute local path as a value of the file_path field without the need to download the file after a getFile request.
  • +
+

Do I need a Local Bot API Server

+

The majority of bots will be OK with the default configuration, running on our servers. But if you feel that you need one of these features, you're welcome to switch to your own at any time.

+

Getting updates

+

There are two mutually exclusive ways of receiving updates for your bot — the getUpdates method on one hand and Webhooks on the other. Incoming updates are stored on the server until the bot receives them either way, but they will not be kept longer than 24 hours.

+

Regardless of which option you choose, you will receive JSON-serialized Update objects as a result.

+

Update

+

This object represents an incoming update.
At most one of the optional parameters can be present in any given update.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
update_idIntegerThe update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using Webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.
messageMessageOptional. New incoming message of any kind — text, photo, sticker, etc.
edited_messageMessageOptional. New version of a message that is known to the bot and was edited
channel_postMessageOptional. New incoming channel post of any kind — text, photo, sticker, etc.
edited_channel_postMessageOptional. New version of a channel post that is known to the bot and was edited
inline_queryInlineQueryOptional. New incoming inline query
chosen_inline_resultChosenInlineResultOptional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.
callback_queryCallbackQueryOptional. New incoming callback query
shipping_queryShippingQueryOptional. New incoming shipping query. Only for invoices with flexible price
pre_checkout_queryPreCheckoutQueryOptional. New incoming pre-checkout query. Contains full information about checkout
pollPollOptional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot
poll_answerPollAnswerOptional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
my_chat_memberChatMemberUpdatedOptional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.
chat_memberChatMemberUpdatedOptional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates.
+

getUpdates

+

Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
offsetIntegerOptionalIdentifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will forgotten.
limitIntegerOptionalLimits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.
timeoutIntegerOptionalTimeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.
allowed_updatesArray of StringOptionalA JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.

Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.
+
+

Notes
1. This method will not work if an outgoing webhook is set up.
2. In order to avoid getting duplicate updates, recalculate offset after each server response.

+
+

setWebhook

+

Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success.

+

If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. https://www.example.com/<token>. Since nobody else knows your bot's token, you can be pretty sure it's us.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
urlStringYesHTTPS url to send updates to. Use an empty string to remove webhook integration
certificateInputFileOptionalUpload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details.
ip_addressStringOptionalThe fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
max_connectionsIntegerOptionalMaximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.
allowed_updatesArray of StringOptionalA JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.
drop_pending_updatesBooleanOptionalPass True to drop all pending updates
+
+

Notes
1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.
2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.
3. Ports currently supported for Webhooks: 443, 80, 88, 8443.

+

NEW! If you're having any trouble setting up webhooks, please check out this amazing guide to Webhooks.

+
+

deleteWebhook

+

Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
drop_pending_updatesBooleanOptionalPass True to drop all pending updates
+

getWebhookInfo

+

Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.

+

WebhookInfo

+

Contains information about the current status of a webhook.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
urlStringWebhook URL, may be empty if webhook is not set up
has_custom_certificateBooleanTrue, if a custom certificate was provided for webhook certificate checks
pending_update_countIntegerNumber of updates awaiting delivery
ip_addressStringOptional. Currently used webhook IP address
last_error_dateIntegerOptional. Unix time for the most recent error that happened when trying to deliver an update via webhook
last_error_messageStringOptional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
max_connectionsIntegerOptional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
allowed_updatesArray of StringOptional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member
+

Available types

+

All types used in the Bot API responses are represented as JSON-objects.

+

It is safe to use 32-bit signed integers for storing all Integer fields unless otherwise noted.

+
+

Optional fields may be not returned when irrelevant.

+
+

User

+

This object represents a Telegram user or bot.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idIntegerUnique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
is_botBooleanTrue, if this user is a bot
first_nameStringUser's or bot's first name
last_nameStringOptional. User's or bot's last name
usernameStringOptional. User's or bot's username
language_codeStringOptional. IETF language tag of the user's language
can_join_groupsBooleanOptional. True, if the bot can be invited to groups. Returned only in getMe.
can_read_all_group_messagesBooleanOptional. True, if privacy mode is disabled for the bot. Returned only in getMe.
supports_inline_queriesBooleanOptional. True, if the bot supports inline queries. Returned only in getMe.
+

Chat

+

This object represents a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idIntegerUnique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
typeStringType of chat, can be either “private”, “group”, “supergroup” or “channel”
titleStringOptional. Title, for supergroups, channels and group chats
usernameStringOptional. Username, for private chats, supergroups and channels if available
first_nameStringOptional. First name of the other party in a private chat
last_nameStringOptional. Last name of the other party in a private chat
photoChatPhotoOptional. Chat photo. Returned only in getChat.
bioStringOptional. Bio of the other party in a private chat. Returned only in getChat.
descriptionStringOptional. Description, for groups, supergroups and channel chats. Returned only in getChat.
invite_linkStringOptional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.
pinned_messageMessageOptional. The most recent pinned message (by sending date). Returned only in getChat.
permissionsChatPermissionsOptional. Default chat member permissions, for groups and supergroups. Returned only in getChat.
slow_mode_delayIntegerOptional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user. Returned only in getChat.
message_auto_delete_timeIntegerOptional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.
sticker_set_nameStringOptional. For supergroups, name of group sticker set. Returned only in getChat.
can_set_sticker_setBooleanOptional. True, if the bot can change the group sticker set. Returned only in getChat.
linked_chat_idIntegerOptional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat.
locationChatLocationOptional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.
+

Message

+

This object represents a message.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
message_idIntegerUnique message identifier inside this chat
fromUserOptional. Sender, empty for messages sent to channels
sender_chatChatOptional. Sender of the message, sent on behalf of a chat. The channel itself for channel messages. The supergroup itself for messages from anonymous group administrators. The linked channel for messages automatically forwarded to the discussion group
dateIntegerDate the message was sent in Unix time
chatChatConversation the message belongs to
forward_fromUserOptional. For forwarded messages, sender of the original message
forward_from_chatChatOptional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat
forward_from_message_idIntegerOptional. For messages forwarded from channels, identifier of the original message in the channel
forward_signatureStringOptional. For messages forwarded from channels, signature of the post author if present
forward_sender_nameStringOptional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages
forward_dateIntegerOptional. For forwarded messages, date the original message was sent in Unix time
reply_to_messageMessageOptional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
via_botUserOptional. Bot through which the message was sent
edit_dateIntegerOptional. Date the message was last edited in Unix time
media_group_idStringOptional. The unique identifier of a media message group this message belongs to
author_signatureStringOptional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
textStringOptional. For text messages, the actual UTF-8 text of the message, 0-4096 characters
entitiesArray of MessageEntityOptional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
animationAnimationOptional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
audioAudioOptional. Message is an audio file, information about the file
documentDocumentOptional. Message is a general file, information about the file
photoArray of PhotoSizeOptional. Message is a photo, available sizes of the photo
stickerStickerOptional. Message is a sticker, information about the sticker
videoVideoOptional. Message is a video, information about the video
video_noteVideoNoteOptional. Message is a video note, information about the video message
voiceVoiceOptional. Message is a voice message, information about the file
captionStringOptional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters
caption_entitiesArray of MessageEntityOptional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
contactContactOptional. Message is a shared contact, information about the contact
diceDiceOptional. Message is a dice with random value
gameGameOptional. Message is a game, information about the game. More about games »
pollPollOptional. Message is a native poll, information about the poll
venueVenueOptional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
locationLocationOptional. Message is a shared location, information about the location
new_chat_membersArray of UserOptional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
left_chat_memberUserOptional. A member was removed from the group, information about them (this member may be the bot itself)
new_chat_titleStringOptional. A chat title was changed to this value
new_chat_photoArray of PhotoSizeOptional. A chat photo was change to this value
delete_chat_photoTrueOptional. Service message: the chat photo was deleted
group_chat_createdTrueOptional. Service message: the group has been created
supergroup_chat_createdTrueOptional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
channel_chat_createdTrueOptional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
message_auto_delete_timer_changedMessageAutoDeleteTimerChangedOptional. Service message: auto-delete timer settings changed in the chat
migrate_to_chat_idIntegerOptional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
migrate_from_chat_idIntegerOptional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
pinned_messageMessageOptional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
invoiceInvoiceOptional. Message is an invoice for a payment, information about the invoice. More about payments »
successful_paymentSuccessfulPaymentOptional. Message is a service message about a successful payment, information about the payment. More about payments »
connected_websiteStringOptional. The domain name of the website on which the user has logged in. More about Telegram Login »
passport_dataPassportDataOptional. Telegram Passport data
proximity_alert_triggeredProximityAlertTriggeredOptional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
voice_chat_scheduledVoiceChatScheduledOptional. Service message: voice chat scheduled
voice_chat_startedVoiceChatStartedOptional. Service message: voice chat started
voice_chat_endedVoiceChatEndedOptional. Service message: voice chat ended
voice_chat_participants_invitedVoiceChatParticipantsInvitedOptional. Service message: new participants invited to a voice chat
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
+

MessageId

+

This object represents a unique message identifier.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
message_idIntegerUnique message identifier
+

MessageEntity

+

This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the entity. Can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames)
offsetIntegerOffset in UTF-16 code units to the start of the entity
lengthIntegerLength of the entity in UTF-16 code units
urlStringOptional. For “text_link” only, url that will be opened after user taps on the text
userUserOptional. For “text_mention” only, the mentioned user
languageStringOptional. For “pre” only, the programming language of the entity text
+

PhotoSize

+

This object represents one size of a photo or a file / sticker thumbnail.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
widthIntegerPhoto width
heightIntegerPhoto height
file_sizeIntegerOptional. File size
+

Animation

+

This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
widthIntegerVideo width as defined by sender
heightIntegerVideo height as defined by sender
durationIntegerDuration of the video in seconds as defined by sender
thumbPhotoSizeOptional. Animation thumbnail as defined by sender
file_nameStringOptional. Original animation filename as defined by sender
mime_typeStringOptional. MIME type of the file as defined by sender
file_sizeIntegerOptional. File size
+

Audio

+

This object represents an audio file to be treated as music by the Telegram clients.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
durationIntegerDuration of the audio in seconds as defined by sender
performerStringOptional. Performer of the audio as defined by sender or by audio tags
titleStringOptional. Title of the audio as defined by sender or by audio tags
file_nameStringOptional. Original filename as defined by sender
mime_typeStringOptional. MIME type of the file as defined by sender
file_sizeIntegerOptional. File size
thumbPhotoSizeOptional. Thumbnail of the album cover to which the music file belongs
+

Document

+

This object represents a general file (as opposed to photos, voice messages and audio files).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
thumbPhotoSizeOptional. Document thumbnail as defined by sender
file_nameStringOptional. Original filename as defined by sender
mime_typeStringOptional. MIME type of the file as defined by sender
file_sizeIntegerOptional. File size
+

Video

+

This object represents a video file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
widthIntegerVideo width as defined by sender
heightIntegerVideo height as defined by sender
durationIntegerDuration of the video in seconds as defined by sender
thumbPhotoSizeOptional. Video thumbnail
file_nameStringOptional. Original filename as defined by sender
mime_typeStringOptional. Mime type of a file as defined by sender
file_sizeIntegerOptional. File size
+

VideoNote

+

This object represents a video message (available in Telegram apps as of v.4.0).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
lengthIntegerVideo width and height (diameter of the video message) as defined by sender
durationIntegerDuration of the video in seconds as defined by sender
thumbPhotoSizeOptional. Video thumbnail
file_sizeIntegerOptional. File size
+

Voice

+

This object represents a voice note.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
durationIntegerDuration of the audio in seconds as defined by sender
mime_typeStringOptional. MIME type of the file as defined by sender
file_sizeIntegerOptional. File size
+

Contact

+

This object represents a phone contact.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
phone_numberStringContact's phone number
first_nameStringContact's first name
last_nameStringOptional. Contact's last name
user_idIntegerOptional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
vcardStringOptional. Additional data about the contact in the form of a vCard
+

Dice

+

This object represents an animated emoji that displays a random value.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
emojiStringEmoji on which the dice throw animation is based
valueIntegerValue of the dice, 1-6 for “🎲”, “🎯” and “🎳” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji
+

PollOption

+

This object contains information about one answer option in a poll.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
textStringOption text, 1-100 characters
voter_countIntegerNumber of users that voted for this option
+

PollAnswer

+

This object represents an answer of a user in a non-anonymous poll.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
poll_idStringUnique poll identifier
userUserThe user, who changed the answer to the poll
option_idsArray of Integer0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
+

Poll

+

This object contains information about a poll.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique poll identifier
questionStringPoll question, 1-300 characters
optionsArray of PollOptionList of poll options
total_voter_countIntegerTotal number of users that voted in the poll
is_closedBooleanTrue, if the poll is closed
is_anonymousBooleanTrue, if the poll is anonymous
typeStringPoll type, currently can be “regular” or “quiz”
allows_multiple_answersBooleanTrue, if the poll allows multiple answers
correct_option_idIntegerOptional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
explanationStringOptional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters
explanation_entitiesArray of MessageEntityOptional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
open_periodIntegerOptional. Amount of time in seconds the poll will be active after creation
close_dateIntegerOptional. Point in time (Unix timestamp) when the poll will be automatically closed
+

Location

+

This object represents a point on the map.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
longitudeFloatLongitude as defined by sender
latitudeFloatLatitude as defined by sender
horizontal_accuracyFloat numberOptional. The radius of uncertainty for the location, measured in meters; 0-1500
live_periodIntegerOptional. Time relative to the message sending date, during which the location can be updated, in seconds. For active live locations only.
headingIntegerOptional. The direction in which user is moving, in degrees; 1-360. For active live locations only.
proximity_alert_radiusIntegerOptional. Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.
+

Venue

+

This object represents a venue.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
locationLocationVenue location. Can't be a live location
titleStringName of the venue
addressStringAddress of the venue
foursquare_idStringOptional. Foursquare identifier of the venue
foursquare_typeStringOptional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
google_place_idStringOptional. Google Places identifier of the venue
google_place_typeStringOptional. Google Places type of the venue. (See supported types.)
+

ProximityAlertTriggered

+

This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
travelerUserUser that triggered the alert
watcherUserUser that set the alert
distanceIntegerThe distance between the users
+

MessageAutoDeleteTimerChanged

+

This object represents a service message about a change in auto-delete timer settings.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
message_auto_delete_timeIntegerNew auto-delete time for messages in the chat
+

VoiceChatScheduled

+

This object represents a service message about a voice chat scheduled in the chat.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
start_dateIntegerPoint in time (Unix timestamp) when the voice chat is supposed to be started by a chat administrator
+

VoiceChatStarted

+

This object represents a service message about a voice chat started in the chat. Currently holds no information.

+

VoiceChatEnded

+

This object represents a service message about a voice chat ended in the chat.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
durationIntegerVoice chat duration; in seconds
+

VoiceChatParticipantsInvited

+

This object represents a service message about new members invited to a voice chat.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
usersArray of UserOptional. New members that were invited to the voice chat
+

UserProfilePhotos

+

This object represent a user's profile pictures.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
total_countIntegerTotal number of profile pictures the target user has
photosArray of Array of PhotoSizeRequested profile pictures (in up to 4 sizes each)
+

File

+

This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.

+
+

Maximum file size to download is 20 MB

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
file_sizeIntegerOptional. File size, if known
file_pathStringOptional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
+

ReplyKeyboardMarkup

+

This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
keyboardArray of Array of KeyboardButtonArray of button rows, each represented by an Array of KeyboardButton objects
resize_keyboardBooleanOptional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.
one_time_keyboardBooleanOptional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to false.
selectiveBooleanOptional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.

Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard.
+

KeyboardButton

+

This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields request_contact, request_location, and request_poll are mutually exclusive.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
textStringText of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed
request_contactBooleanOptional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only
request_locationBooleanOptional. If True, the user's current location will be sent when the button is pressed. Available in private chats only
request_pollKeyboardButtonPollTypeOptional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only
+

Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.
Note: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.

+

KeyboardButtonPollType

+

This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringOptional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type.
+

ReplyKeyboardRemove

+

Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup).

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
remove_keyboardTrueRequests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)
selectiveBooleanOptional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.

Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet.
+

InlineKeyboardMarkup

+

This object represents an inline keyboard that appears right next to the message it belongs to.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
inline_keyboardArray of Array of InlineKeyboardButtonArray of button rows, each represented by an Array of InlineKeyboardButton objects
+

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.

+

InlineKeyboardButton

+

This object represents one button of an inline keyboard. You must use exactly one of the optional fields.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
textStringLabel text on the button
urlStringOptional. HTTP or tg:// url to be opened when button is pressed
login_urlLoginUrlOptional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
callback_dataStringOptional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
switch_inline_queryStringOptional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted.

Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm… actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.
switch_inline_query_current_chatStringOptional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted.

This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options.
callback_gameCallbackGameOptional. Description of the game that will be launched when the user presses the button.

NOTE: This type of button must always be the first button in the first row.
payBooleanOptional. Specify True, to send a Pay button.

NOTE: This type of button must always be the first button in the first row.
+

LoginUrl

+

This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:

+
+ TITLE +
+ +

Telegram apps support these buttons as of version 5.7.

+
+

Sample bot: @discussbot

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
urlStringAn HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.

NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.
forward_textStringOptional. New text of the button in forwarded messages.
bot_usernameStringOptional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details.
request_write_accessBooleanOptional. Pass True to request the permission for your bot to send messages to the user.
+

CallbackQuery

+

This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique identifier for this query
fromUserSender
messageMessageOptional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old
inline_message_idStringOptional. Identifier of the message sent via the bot in inline mode, that originated the query.
chat_instanceStringGlobal identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
dataStringOptional. Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field.
game_short_nameStringOptional. Short name of a Game to be returned, serves as the unique identifier for the game
+
+

NOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed (e.g., without specifying any of the optional parameters).

+
+

ForceReply

+

Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
force_replyTrueShows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply'
selectiveBooleanOptional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
+
+

Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:

+
    +
  • Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.
  • +
  • Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.
  • +
+

The last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions — without any extra work for the user.

+
+

ChatPhoto

+

This object represents a chat photo.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
small_file_idStringFile identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
small_file_unique_idStringUnique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
big_file_idStringFile identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
big_file_unique_idStringUnique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
+

ChatInviteLink

+

Represents an invite link for a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
invite_linkStringThe invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”.
creatorUserCreator of the link
is_primaryBooleanTrue, if the link is primary
is_revokedBooleanTrue, if the link is revoked
expire_dateIntegerOptional. Point in time (Unix timestamp) when the link will expire or has been expired
member_limitIntegerOptional. Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
+

ChatMember

+

This object contains information about one member of a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
userUserInformation about the user
statusStringThe member's status in the chat. Can be “creator”, “administrator”, “member”, “restricted”, “left” or “kicked”
custom_titleStringOptional. Owner and administrators only. Custom title for this user
is_anonymousBooleanOptional. Owner and administrators only. True, if the user's presence in the chat is hidden
can_be_editedBooleanOptional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user
can_manage_chatBooleanOptional. Administrators only. True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
can_post_messagesBooleanOptional. Administrators only. True, if the administrator can post in the channel; channels only
can_edit_messagesBooleanOptional. Administrators only. True, if the administrator can edit messages of other users and can pin messages; channels only
can_delete_messagesBooleanOptional. Administrators only. True, if the administrator can delete messages of other users
can_manage_voice_chatsBooleanOptional. Administrators only. True, if the administrator can manage voice chats
can_restrict_membersBooleanOptional. Administrators only. True, if the administrator can restrict, ban or unban chat members
can_promote_membersBooleanOptional. Administrators only. True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)
can_change_infoBooleanOptional. Administrators and restricted only. True, if the user is allowed to change the chat title, photo and other settings
can_invite_usersBooleanOptional. Administrators and restricted only. True, if the user is allowed to invite new users to the chat
can_pin_messagesBooleanOptional. Administrators and restricted only. True, if the user is allowed to pin messages; groups and supergroups only
is_memberBooleanOptional. Restricted only. True, if the user is a member of the chat at the moment of the request
can_send_messagesBooleanOptional. Restricted only. True, if the user is allowed to send text messages, contacts, locations and venues
can_send_media_messagesBooleanOptional. Restricted only. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes
can_send_pollsBooleanOptional. Restricted only. True, if the user is allowed to send polls
can_send_other_messagesBooleanOptional. Restricted only. True, if the user is allowed to send animations, games, stickers and use inline bots
can_add_web_page_previewsBooleanOptional. Restricted only. True, if the user is allowed to add web page previews to their messages
until_dateIntegerOptional. Restricted and kicked only. Date when restrictions will be lifted for this user; unix time
+

ChatMemberUpdated

+

This object represents changes in the status of a chat member.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
chatChatChat the user belongs to
fromUserPerformer of the action, which resulted in the change
dateIntegerDate the change was done in Unix time
old_chat_memberChatMemberPrevious information about the chat member
new_chat_memberChatMemberNew information about the chat member
invite_linkChatInviteLinkOptional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
+

ChatPermissions

+

Describes actions that a non-administrator user is allowed to take in a chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
can_send_messagesBooleanOptional. True, if the user is allowed to send text messages, contacts, locations and venues
can_send_media_messagesBooleanOptional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
can_send_pollsBooleanOptional. True, if the user is allowed to send polls, implies can_send_messages
can_send_other_messagesBooleanOptional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages
can_add_web_page_previewsBooleanOptional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages
can_change_infoBooleanOptional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
can_invite_usersBooleanOptional. True, if the user is allowed to invite new users to the chat
can_pin_messagesBooleanOptional. True, if the user is allowed to pin messages. Ignored in public supergroups
+

ChatLocation

+

Represents a location to which a chat is connected.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
locationLocationThe location to which the supergroup is connected. Can't be a live location.
addressStringLocation address; 1-64 characters, as defined by the chat owner
+

BotCommand

+

This object represents a bot command.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
commandStringText of the command, 1-32 characters. Can contain only lowercase English letters, digits and underscores.
descriptionStringDescription of the command, 3-256 characters.
+

ResponseParameters

+

Contains information about why a request was unsuccessful.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
migrate_to_chat_idIntegerOptional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
retry_afterIntegerOptional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated
+

InputMedia

+

This object represents the content of a media message to be sent. It should be one of

+ +

InputMediaPhoto

+

Represents a photo to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be photo
mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files »
captionStringOptional. Caption of the photo to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the photo caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
+

InputMediaVideo

+

Represents a video to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be video
mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files »
thumbInputFile or StringOptional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
captionStringOptional. Caption of the video to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the video caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
widthIntegerOptional. Video width
heightIntegerOptional. Video height
durationIntegerOptional. Video duration
supports_streamingBooleanOptional. Pass True, if the uploaded video is suitable for streaming
+

InputMediaAnimation

+

Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be animation
mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files »
thumbInputFile or StringOptional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
captionStringOptional. Caption of the animation to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the animation caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
widthIntegerOptional. Animation width
heightIntegerOptional. Animation height
durationIntegerOptional. Animation duration
+

InputMediaAudio

+

Represents an audio file to be treated as music to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be audio
mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files »
thumbInputFile or StringOptional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
captionStringOptional. Caption of the audio to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the audio caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
durationIntegerOptional. Duration of the audio in seconds
performerStringOptional. Performer of the audio
titleStringOptional. Title of the audio
+

InputMediaDocument

+

Represents a general file to be sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be document
mediaStringFile to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files »
thumbInputFile or StringOptional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
captionStringOptional. Caption of the document to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the document caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
disable_content_type_detectionBooleanOptional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always true, if the document is sent as part of an album.
+

InputFile

+

This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.

+

Sending files

+

There are three ways to send files (photos, stickers, audio, media, etc.):

+
    +
  1. If the file is already stored somewhere on the Telegram servers, you don't need to reupload it: each file object has a file_id field, simply pass this file_id as a parameter instead of uploading. There are no limits for files sent this way.
  2. +
  3. Provide Telegram with an HTTP URL for the file to be sent. Telegram will download and send the file. 5 MB max size for photos and 20 MB max for other types of content.
  4. +
  5. Post the file using multipart/form-data in the usual way that files are uploaded via the browser. 10 MB max size for photos, 50 MB for other files.
  6. +
+

Sending by file_id

+
    +
  • It is not possible to change the file type when resending by file_id. I.e. a video can't be sent as a photo, a photo can't be sent as a document, etc.
  • +
  • It is not possible to resend thumbnails.
  • +
  • Resending a photo by file_id will send all of its sizes.
  • +
  • file_id is unique for each individual bot and can't be transferred from one bot to another.
  • +
  • file_id uniquely identifies a file, but a file can have different valid file_ids even for the same bot.
  • +
+

Sending by URL

+
    +
  • When sending by URL the target file must have the correct MIME type (e.g., audio/mpeg for sendAudio, etc.).
  • +
  • In sendDocument, sending by URL will currently only work for gif, pdf and zip files.
  • +
  • To use sendVoice, the file must have the type audio/ogg and be no more than 1MB in size. 1-20MB voice notes will be sent as files.
  • +
  • Other configurations may work but we can't guarantee that they will.
  • +
+

Inline mode objects

+

Objects and methods used in the inline mode are described in the Inline mode section.

+

Available methods

+
+

All methods in the Bot API are case-insensitive. We support GET and POST HTTP methods. Use either URL query string or application/json or application/x-www-form-urlencoded or multipart/form-data for passing parameters in Bot API requests.
On successful call, a JSON-object containing the result will be returned.

+
+

getMe

+

A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in form of a User object.

+

logOut

+

Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters.

+

close

+

Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters.

+

sendMessage

+

Use this method to send text messages. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
textStringYesText of the message to be sent, 1-4096 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the message text. See formatting options for more details.
entitiesArray of MessageEntityOptionalList of special entities that appear in message text, which can be specified instead of parse_mode
disable_web_page_previewBooleanOptionalDisables link previews for links in this message
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+

Formatting options

+

The Bot API supports basic formatting for messages. You can use bold, italic, underlined and strikethrough text, as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can use either markdown-style or HTML-style formatting.

+

Note that Telegram clients will display an alert to the user before opening an inline link ('Open this link?' together with the full URL).

+

Message entities can be nested, providing following restrictions are met:
- If two entities has common characters then one of them is fully contained inside another.
- bold, italic, underline and strikethrough entities can contain and to be contained in any other entities, except pre and code.
- All other entities can't contain each other.

+

Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username. Please note:

+
    +
  • These links will work only if they are used inside an inline link. For example, they will not work, when used in an inline keyboard button or in a message text.
  • +
  • These mentions are only guaranteed to work if the user has contacted the bot in the past, has sent a callback query to the bot via inline button or is a member in the group where he was mentioned.
  • +
+
MarkdownV2 style
+

To use this mode, pass MarkdownV2 in the parse_mode field. Use the following syntax in your message:

+
*bold \*text*
+_italic \*text_
+__underline__
+~strikethrough~
+*bold _italic bold ~italic bold strikethrough~ __underline italic bold___ bold*
+[inline URL](http://www.example.com/)
+[inline mention of a user](tg://user?id=123456789)
+`inline fixed-width code`
+```
+pre-formatted fixed-width code block
+```
+```python
+pre-formatted fixed-width code block written in the Python programming language
+```
+

Please note:

+
    +
  • Any character with code between 1 and 126 inclusively can be escaped anywhere with a preceding '\' character, in which case it is treated as an ordinary character and not a part of the markup.
  • +
  • Inside pre and code entities, all '`' and '\' characters must be escaped with a preceding '\' character.
  • +
  • Inside (...) part of inline link definition, all ')' and '\' must be escaped with a preceding '\' character.
  • +
  • In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.
  • +
  • In case of ambiguity between italic and underline entities __ is always greadily treated from left to right as beginning or end of underline entity, so instead of ___italic underline___ use ___italic underline_\r__, where \r is a character with code 13, which will be ignored.
  • +
+
HTML style
+

To use this mode, pass HTML in the parse_mode field. The following tags are currently supported:

+
<b>bold</b>, <strong>bold</strong>
+<i>italic</i>, <em>italic</em>
+<u>underline</u>, <ins>underline</ins>
+<s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>
+<b>bold <i>italic bold <s>italic bold strikethrough</s> <u>underline italic bold</u></i> bold</b>
+<a href="http://www.example.com/">inline URL</a>
+<a href="tg://user?id=123456789">inline mention of a user</a>
+<code>inline fixed-width code</code>
+<pre>pre-formatted fixed-width code block</pre>
+<pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>
+

Please note:

+
    +
  • Only the tags mentioned above are currently supported.
  • +
  • All <, > and & symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (< with &lt;, > with &gt; and & with &amp;).
  • +
  • All numerical HTML entities are supported.
  • +
  • The API currently supports only the following named HTML entities: &lt;, &gt;, &amp; and &quot;.
  • +
  • Use nested pre and code tags, to define programming language for pre entity.
  • +
  • Programming language can't be specified for standalone code tags.
  • +
+
Markdown style
+

This is a legacy mode, retained for backward compatibility. To use this mode, pass Markdown in the parse_mode field. Use the following syntax in your message:

+
*bold text*
+_italic text_
+[inline URL](http://www.example.com/)
+[inline mention of a user](tg://user?id=123456789)
+`inline fixed-width code`
+```
+pre-formatted fixed-width code block
+```
+```python
+pre-formatted fixed-width code block written in the Python programming language
+```
+

Please note:

+
    +
  • Entities must not be nested, use parse mode MarkdownV2 instead.
  • +
  • There is no way to specify underline and strikethrough entities, use parse mode MarkdownV2 instead.
  • +
  • To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.
  • +
  • Escaping inside entities is not allowed, so entity must be closed first and reopened again: use _snake_\__case_ for italic snake_case and *2*\**2=4* for bold 2*2=4.
  • +
+

forwardMessage

+

Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
from_chat_idInteger or StringYesUnique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
message_idIntegerYesMessage identifier in the chat specified in from_chat_id
+

copyMessage

+

Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
from_chat_idInteger or StringYesUnique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
message_idIntegerYesMessage identifier in the chat specified in from_chat_id
captionStringOptionalNew caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
parse_modeStringOptionalMode for parsing entities in the new caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalList of special entities that appear in the new caption, which can be specified instead of parse_mode
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+

sendPhoto

+

Use this method to send photos. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
photoInputFile or StringYesPhoto to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More info on Sending Files »
captionStringOptionalPhoto caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the photo caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalList of special entities that appear in the caption, which can be specified instead of parse_mode
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+

sendAudio

+

Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.

+

For sending voice messages, use the sendVoice method instead.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
audioInputFile or StringYesAudio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
captionStringOptionalAudio caption, 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the audio caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalList of special entities that appear in the caption, which can be specified instead of parse_mode
durationIntegerOptionalDuration of the audio in seconds
performerStringOptionalPerformer
titleStringOptionalTrack name
thumbInputFile or StringOptionalThumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+

sendDocument

+

Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
documentInputFile or StringYesFile to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
thumbInputFile or StringOptionalThumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
captionStringOptionalDocument caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the document caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalList of special entities that appear in the caption, which can be specified instead of parse_mode
disable_content_type_detectionBooleanOptionalDisables automatic server-side content type detection for files uploaded using multipart/form-data
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+

sendVideo

+

Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
videoInputFile or StringYesVideo to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More info on Sending Files »
durationIntegerOptionalDuration of sent video in seconds
widthIntegerOptionalVideo width
heightIntegerOptionalVideo height
thumbInputFile or StringOptionalThumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
captionStringOptionalVideo caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the video caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalList of special entities that appear in the caption, which can be specified instead of parse_mode
supports_streamingBooleanOptionalPass True, if the uploaded video is suitable for streaming
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+

sendAnimation

+

Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
animationInputFile or StringYesAnimation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More info on Sending Files »
durationIntegerOptionalDuration of sent animation in seconds
widthIntegerOptionalAnimation width
heightIntegerOptionalAnimation height
thumbInputFile or StringOptionalThumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
captionStringOptionalAnimation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the animation caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalList of special entities that appear in the caption, which can be specified instead of parse_mode
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+

sendVoice

+

Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
voiceInputFile or StringYesAudio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
captionStringOptionalVoice message caption, 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the voice message caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalList of special entities that appear in the caption, which can be specified instead of parse_mode
durationIntegerOptionalDuration of the voice message in seconds
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+

sendVideoNote

+

As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
video_noteInputFile or StringYesVideo note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More info on Sending Files ». Sending video notes by a URL is currently unsupported
durationIntegerOptionalDuration of sent video in seconds
lengthIntegerOptionalVideo width and height, i.e. diameter of the video message
thumbInputFile or StringOptionalThumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+

sendMediaGroup

+

Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
mediaArray of InputMediaAudio, InputMediaDocument, InputMediaPhoto and InputMediaVideoYesA JSON-serialized array describing messages to be sent, must include 2-10 items
disable_notificationBooleanOptionalSends messages silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the messages are a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
+

sendLocation

+

Use this method to send point on the map. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
latitudeFloat numberYesLatitude of the location
longitudeFloat numberYesLongitude of the location
horizontal_accuracyFloat numberOptionalThe radius of uncertainty for the location, measured in meters; 0-1500
live_periodIntegerOptionalPeriod in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400.
headingIntegerOptionalFor live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
proximity_alert_radiusIntegerOptionalFor live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+

editMessageLiveLocation

+

Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
latitudeFloat numberYesLatitude of new location
longitudeFloat numberYesLongitude of new location
horizontal_accuracyFloat numberOptionalThe radius of uncertainty for the location, measured in meters; 0-1500
headingIntegerOptionalDirection in which the user is moving, in degrees. Must be between 1 and 360 if specified.
proximity_alert_radiusIntegerOptionalMaximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new inline keyboard.
+

stopMessageLiveLocation

+

Use this method to stop updating a live location message before live_period expires. On success, if the message was sent by the bot, the sent Message is returned, otherwise True is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message with live location to stop
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new inline keyboard.
+

sendVenue

+

Use this method to send information about a venue. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
latitudeFloat numberYesLatitude of the venue
longitudeFloat numberYesLongitude of the venue
titleStringYesName of the venue
addressStringYesAddress of the venue
foursquare_idStringOptionalFoursquare identifier of the venue
foursquare_typeStringOptionalFoursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
google_place_idStringOptionalGoogle Places identifier of the venue
google_place_typeStringOptionalGoogle Places type of the venue. (See supported types.)
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+

sendContact

+

Use this method to send phone contacts. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
phone_numberStringYesContact's phone number
first_nameStringYesContact's first name
last_nameStringOptionalContact's last name
vcardStringOptionalAdditional data about the contact in the form of a vCard, 0-2048 bytes
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove keyboard or to force a reply from the user.
+

sendPoll

+

Use this method to send a native poll. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
questionStringYesPoll question, 1-300 characters
optionsArray of StringYesA JSON-serialized list of answer options, 2-10 strings 1-100 characters each
is_anonymousBooleanOptionalTrue, if the poll needs to be anonymous, defaults to True
typeStringOptionalPoll type, “quiz” or “regular”, defaults to “regular”
allows_multiple_answersBooleanOptionalTrue, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False
correct_option_idIntegerOptional0-based identifier of the correct answer option, required for polls in quiz mode
explanationStringOptionalText that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing
explanation_parse_modeStringOptionalMode for parsing entities in the explanation. See formatting options for more details.
explanation_entitiesArray of MessageEntityOptionalList of special entities that appear in the poll explanation, which can be specified instead of parse_mode
open_periodIntegerOptionalAmount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.
close_dateIntegerOptionalPoint in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with open_period.
is_closedBooleanOptionalPass True, if the poll needs to be immediately closed. This can be useful for poll preview.
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+

sendDice

+

Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
emojiStringOptionalEmoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”. Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+

sendChatAction

+

Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.

+
+

Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo. The user will see a “sending photo” status for the bot.

+
+

We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
actionStringYesType of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, find_location for location data, record_video_note or upload_video_note for video notes.
+

getUserProfilePhotos

+

Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUnique identifier of the target user
offsetIntegerOptionalSequential number of the first photo to be returned. By default, all photos are returned.
limitIntegerOptionalLimits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100.
+

getFile

+

Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
file_idStringYesFile identifier to get info about
+

Note: This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received.

+

kickChatMember

+

Use this method to kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)
user_idIntegerYesUnique identifier of the target user
until_dateIntegerOptionalDate when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.
revoke_messagesBooleanOptionalPass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels.
+

unbanChatMember

+

Use this method to unban a previously kicked user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target group or username of the target supergroup or channel (in the format @username)
user_idIntegerYesUnique identifier of the target user
only_if_bannedBooleanOptionalDo nothing if the user is not banned
+

restrictChatMember

+

Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
user_idIntegerYesUnique identifier of the target user
permissionsChatPermissionsYesA JSON-serialized object for new user permissions
until_dateIntegerOptionalDate when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever
+

promoteChatMember

+

Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
user_idIntegerYesUnique identifier of the target user
is_anonymousBooleanOptionalPass True, if the administrator's presence in the chat is hidden
can_manage_chatBooleanOptionalPass True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
can_post_messagesBooleanOptionalPass True, if the administrator can create channel posts, channels only
can_edit_messagesBooleanOptionalPass True, if the administrator can edit messages of other users and can pin messages, channels only
can_delete_messagesBooleanOptionalPass True, if the administrator can delete messages of other users
can_manage_voice_chatsBooleanOptionalPass True, if the administrator can manage voice chats
can_restrict_membersBooleanOptionalPass True, if the administrator can restrict, ban or unban chat members
can_promote_membersBooleanOptionalPass True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)
can_change_infoBooleanOptionalPass True, if the administrator can change chat title, photo and other settings
can_invite_usersBooleanOptionalPass True, if the administrator can invite new users to the chat
can_pin_messagesBooleanOptionalPass True, if the administrator can pin messages, supergroups only
+

setChatAdministratorCustomTitle

+

Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
user_idIntegerYesUnique identifier of the target user
custom_titleStringYesNew custom title for the administrator; 0-16 characters, emoji are not allowed
+

setChatPermissions

+

Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members admin rights. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
permissionsChatPermissionsYesNew default chat permissions
+

exportChatInviteLink

+

Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns the new invite link as String on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
+
+

Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using exportChatInviteLink or by calling the getChat method. If your bot needs to generate a new primary invite link replacing its previous one, use exportChatInviteLink again.

+
+

createChatInviteLink

+

Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as ChatInviteLink object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
expire_dateIntegerOptionalPoint in time (Unix timestamp) when the link will expire
member_limitIntegerOptionalMaximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
+

editChatInviteLink

+

Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns the edited invite link as a ChatInviteLink object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
invite_linkStringYesThe invite link to edit
expire_dateIntegerOptionalPoint in time (Unix timestamp) when the link will expire
member_limitIntegerOptionalMaximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
+

revokeChatInviteLink

+

Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns the revoked invite link as ChatInviteLink object.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier of the target chat or username of the target channel (in the format @channelusername)
invite_linkStringYesThe invite link to revoke
+

setChatPhoto

+

Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
photoInputFileYesNew chat photo, uploaded using multipart/form-data
+

deleteChatPhoto

+

Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
+

setChatTitle

+

Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
titleStringYesNew chat title, 1-255 characters
+

setChatDescription

+

Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
descriptionStringOptionalNew chat description, 0-255 characters
+

pinChatMessage

+

Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerYesIdentifier of a message to pin
disable_notificationBooleanOptionalPass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats.
+

unpinChatMessage

+

Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerOptionalIdentifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.
+

unpinAllChatMessages

+

Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
+

leaveChat

+

Use this method for your bot to leave a group, supergroup or channel. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
+

getChat

+

Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
+

getChatAdministrators

+

Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
+

getChatMembersCount

+

Use this method to get the number of members in a chat. Returns Int on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
+

getChatMember

+

Use this method to get information about a member of a chat. Returns a ChatMember object on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
user_idIntegerYesUnique identifier of the target user
+

setChatStickerSet

+

Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
sticker_set_nameStringYesName of the sticker set to be set as the group sticker set
+

deleteChatStickerSet

+

Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+

answerCallbackQuery

+

Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.

+
+

Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @Botfather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
callback_query_idStringYesUnique identifier for the query to be answered
textStringOptionalText of the notification. If not specified, nothing will be shown to the user, 0-200 characters
show_alertBooleanOptionalIf true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.
urlStringOptionalURL that will be opened by the user's client. If you have created a Game and accepted the conditions via @Botfather, specify the URL that opens your game — note that this will only work if the query comes from a callback_game button.

Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
cache_timeIntegerOptionalThe maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0.
+

setMyCommands

+

Use this method to change the list of the bot's commands. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
commandsArray of BotCommandYesA JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
+

getMyCommands

+

Use this method to get the current list of the bot's commands. Requires no parameters. Returns Array of BotCommand on success.

+

Inline mode methods

+

Methods and objects used in the inline mode are described in the Inline mode section.

+

Updating messages

+

The following methods allow you to change an existing message in the message history instead of sending a new one with a result of an action. This is most useful for messages with inline keyboards using callback queries, but can also help reduce clutter in conversations with regular chat bots.

+

Please note, that it is currently only possible to edit messages without reply_markup or with inline keyboards.

+

editMessageText

+

Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
textStringYesNew text of the message, 1-4096 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the message text. See formatting options for more details.
entitiesArray of MessageEntityOptionalList of special entities that appear in message text, which can be specified instead of parse_mode
disable_web_page_previewBooleanOptionalDisables link previews for links in this message
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard.
+

editMessageCaption

+

Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
captionStringOptionalNew caption of the message, 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the message caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalList of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard.
+

editMessageMedia

+

Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded. Use a previously uploaded file via its file_id or specify a URL. On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
mediaInputMediaYesA JSON-serialized object for a new media content of the message
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new inline keyboard.
+

editMessageReplyMarkup

+

Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard.
+

stopPoll

+

Use this method to stop a poll which was sent by the bot. On success, the stopped Poll with the final results is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerYesIdentifier of the original message with the poll
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new message inline keyboard.
+

deleteMessage

+

Use this method to delete a message, including service messages, with the following limitations:
- A message can only be deleted if it was sent less than 48 hours ago.
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
- Bots can delete outgoing messages in private chats, groups, and supergroups.
- Bots can delete incoming messages in private chats.
- Bots granted can_post_messages permissions can delete outgoing messages in channels.
- If the bot is an administrator of a group, it can delete any message there.
- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerYesIdentifier of the message to delete
+

Stickers

+

The following methods and objects allow your bot to handle stickers and sticker sets.

+

Sticker

+

This object represents a sticker.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
widthIntegerSticker width
heightIntegerSticker height
is_animatedBooleanTrue, if the sticker is animated
thumbPhotoSizeOptional. Sticker thumbnail in the .WEBP or .JPG format
emojiStringOptional. Emoji associated with the sticker
set_nameStringOptional. Name of the sticker set to which the sticker belongs
mask_positionMaskPositionOptional. For mask stickers, the position where the mask should be placed
file_sizeIntegerOptional. File size
+

StickerSet

+

This object represents a sticker set.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
nameStringSticker set name
titleStringSticker set title
is_animatedBooleanTrue, if the sticker set contains animated stickers
contains_masksBooleanTrue, if the sticker set contains masks
stickersArray of StickerList of all set stickers
thumbPhotoSizeOptional. Sticker set thumbnail in the .WEBP or .TGS format
+

MaskPosition

+

This object describes the position on faces where a mask should be placed by default.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
pointStringThe part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.
x_shiftFloat numberShift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position.
y_shiftFloat numberShift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position.
scaleFloat numberMask scaling coefficient. For example, 2.0 means double size.
+

sendSticker

+

Use this method to send static .WEBP or animated .TGS stickers. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
stickerInputFile or StringYesSticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+

getStickerSet

+

Use this method to get a sticker set. On success, a StickerSet object is returned.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
nameStringYesName of the sticker set
+

uploadStickerFile

+

Use this method to upload a .PNG file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier of sticker file owner
png_stickerInputFileYesPNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. More info on Sending Files »
+

createNewStickerSet

+

Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You must use exactly one of the fields png_sticker or tgs_sticker. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier of created sticker set owner
nameStringYesShort name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in “_by_<bot username>”. <bot_username> is case insensitive. 1-64 characters.
titleStringYesSticker set title, 1-64 characters
png_stickerInputFile or StringOptionalPNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
tgs_stickerInputFileOptionalTGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
emojisStringYesOne or more emoji corresponding to the sticker
contains_masksBooleanOptionalPass True, if a set of mask stickers should be created
mask_positionMaskPositionOptionalA JSON-serialized object for position where the mask should be placed on faces
+

addStickerToSet

+

Use this method to add a new sticker to a set created by the bot. You must use exactly one of the fields png_sticker or tgs_sticker. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier of sticker set owner
nameStringYesSticker set name
png_stickerInputFile or StringOptionalPNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
tgs_stickerInputFileOptionalTGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
emojisStringYesOne or more emoji corresponding to the sticker
mask_positionMaskPositionOptionalA JSON-serialized object for position where the mask should be placed on faces
+

setStickerPositionInSet

+

Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
stickerStringYesFile identifier of the sticker
positionIntegerYesNew sticker position in the set, zero-based
+

deleteStickerFromSet

+

Use this method to delete a sticker from a set created by the bot. Returns True on success.

+ + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
stickerStringYesFile identifier of the sticker
+

setStickerSetThumb

+

Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Returns True on success.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
nameStringYesSticker set name
user_idIntegerYesUser identifier of the sticker set owner
thumbInputFile or StringOptionalA PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a TGS animation with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/animated_stickers#technical-requirements for animated sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files ». Animated sticker set thumbnail can't be uploaded via HTTP URL.
+

Inline mode

+

The following methods and objects allow your bot to work in inline mode.
Please see our Introduction to Inline bots for more details.

+

To enable this option, send the /setinline command to @BotFather and provide the placeholder text that the user will see in the input field after typing your bot's name.

+

InlineQuery

+

This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique identifier for this query
fromUserSender
queryStringText of the query (up to 256 characters)
offsetStringOffset of the results to be returned, can be controlled by the bot
chat_typeStringOptional. Type of the chat, from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat
locationLocationOptional. Sender location, only for bots that request user location
+

answerInlineQuery

+

Use this method to send answers to an inline query. On success, True is returned.
No more than 50 results per query are allowed.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
inline_query_idStringYesUnique identifier for the answered query
resultsArray of InlineQueryResultYesA JSON-serialized array of results for the inline query
cache_timeIntegerOptionalThe maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.
is_personalBooleanOptionalPass True, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query
next_offsetStringOptionalPass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.
switch_pm_textStringOptionalIf passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter switch_pm_parameter
switch_pm_parameterStringOptionalDeep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.

Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an oauth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.
+

InlineQueryResult

+

This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:

+ +

Note: All URLs passed in inline query results will be available to end users and therefore must be assumed to be public.

+

InlineQueryResultArticle

+

Represents a link to an article or web page.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be article
idStringUnique identifier for this result, 1-64 Bytes
titleStringTitle of the result
input_message_contentInputMessageContentContent of the message to be sent
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
urlStringOptional. URL of the result
hide_urlBooleanOptional. Pass True, if you don't want the URL to be shown in the message
descriptionStringOptional. Short description of the result
thumb_urlStringOptional. Url of the thumbnail for the result
thumb_widthIntegerOptional. Thumbnail width
thumb_heightIntegerOptional. Thumbnail height
+

InlineQueryResultPhoto

+

Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be photo
idStringUnique identifier for this result, 1-64 bytes
photo_urlStringA valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB
thumb_urlStringURL of the thumbnail for the photo
photo_widthIntegerOptional. Width of the photo
photo_heightIntegerOptional. Height of the photo
titleStringOptional. Title for the result
descriptionStringOptional. Short description of the result
captionStringOptional. Caption of the photo to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the photo caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the photo
+

InlineQueryResultGif

+

Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be gif
idStringUnique identifier for this result, 1-64 bytes
gif_urlStringA valid URL for the GIF file. File size must not exceed 1MB
gif_widthIntegerOptional. Width of the GIF
gif_heightIntegerOptional. Height of the GIF
gif_durationIntegerOptional. Duration of the GIF
thumb_urlStringURL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
thumb_mime_typeStringOptional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
titleStringOptional. Title for the result
captionStringOptional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the GIF animation
+

InlineQueryResultMpeg4Gif

+

Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be mpeg4_gif
idStringUnique identifier for this result, 1-64 bytes
mpeg4_urlStringA valid URL for the MP4 file. File size must not exceed 1MB
mpeg4_widthIntegerOptional. Video width
mpeg4_heightIntegerOptional. Video height
mpeg4_durationIntegerOptional. Video duration
thumb_urlStringURL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
thumb_mime_typeStringOptional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
titleStringOptional. Title for the result
captionStringOptional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the video animation
+

InlineQueryResultVideo

+

Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

+
+

If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you must replace its content using input_message_content.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be video
idStringUnique identifier for this result, 1-64 bytes
video_urlStringA valid URL for the embedded video player or video file
mime_typeStringMime type of the content of video url, “text/html” or “video/mp4”
thumb_urlStringURL of the thumbnail (jpeg only) for the video
titleStringTitle for the result
captionStringOptional. Caption of the video to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the video caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
video_widthIntegerOptional. Video width
video_heightIntegerOptional. Video height
video_durationIntegerOptional. Video duration in seconds
descriptionStringOptional. Short description of the result
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video).
+

InlineQueryResultAudio

+

Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be audio
idStringUnique identifier for this result, 1-64 bytes
audio_urlStringA valid URL for the audio file
titleStringTitle
captionStringOptional. Caption, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the audio caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
performerStringOptional. Performer
audio_durationIntegerOptional. Audio duration in seconds
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the audio
+

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

+

InlineQueryResultVoice

+

Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be voice
idStringUnique identifier for this result, 1-64 bytes
voice_urlStringA valid URL for the voice recording
titleStringRecording title
captionStringOptional. Caption, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the voice message caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
voice_durationIntegerOptional. Recording duration in seconds
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the voice recording
+

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

+

InlineQueryResultDocument

+

Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be document
idStringUnique identifier for this result, 1-64 bytes
titleStringTitle for the result
captionStringOptional. Caption of the document to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the document caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
document_urlStringA valid URL for the file
mime_typeStringMime type of the content of the file, either “application/pdf” or “application/zip”
descriptionStringOptional. Short description of the result
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the file
thumb_urlStringOptional. URL of the thumbnail (jpeg only) for the file
thumb_widthIntegerOptional. Thumbnail width
thumb_heightIntegerOptional. Thumbnail height
+

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

+

InlineQueryResultLocation

+

Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be location
idStringUnique identifier for this result, 1-64 Bytes
latitudeFloat numberLocation latitude in degrees
longitudeFloat numberLocation longitude in degrees
titleStringLocation title
horizontal_accuracyFloat numberOptional. The radius of uncertainty for the location, measured in meters; 0-1500
live_periodIntegerOptional. Period in seconds for which the location can be updated, should be between 60 and 86400.
headingIntegerOptional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
proximity_alert_radiusIntegerOptional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the location
thumb_urlStringOptional. Url of the thumbnail for the result
thumb_widthIntegerOptional. Thumbnail width
thumb_heightIntegerOptional. Thumbnail height
+

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

+

InlineQueryResultVenue

+

Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be venue
idStringUnique identifier for this result, 1-64 Bytes
latitudeFloatLatitude of the venue location in degrees
longitudeFloatLongitude of the venue location in degrees
titleStringTitle of the venue
addressStringAddress of the venue
foursquare_idStringOptional. Foursquare identifier of the venue if known
foursquare_typeStringOptional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
google_place_idStringOptional. Google Places identifier of the venue
google_place_typeStringOptional. Google Places type of the venue. (See supported types.)
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the venue
thumb_urlStringOptional. Url of the thumbnail for the result
thumb_widthIntegerOptional. Thumbnail width
thumb_heightIntegerOptional. Thumbnail height
+

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

+

InlineQueryResultContact

+

Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be contact
idStringUnique identifier for this result, 1-64 Bytes
phone_numberStringContact's phone number
first_nameStringContact's first name
last_nameStringOptional. Contact's last name
vcardStringOptional. Additional data about the contact in the form of a vCard, 0-2048 bytes
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the contact
thumb_urlStringOptional. Url of the thumbnail for the result
thumb_widthIntegerOptional. Thumbnail width
thumb_heightIntegerOptional. Thumbnail height
+

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

+

InlineQueryResultGame

+

Represents a Game.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be game
idStringUnique identifier for this result, 1-64 bytes
game_short_nameStringShort name of the game
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
+

Note: This will only work in Telegram versions released after October 1, 2016. Older clients will not display any inline results if a game result is among them.

+

InlineQueryResultCachedPhoto

+

Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be photo
idStringUnique identifier for this result, 1-64 bytes
photo_file_idStringA valid file identifier of the photo
titleStringOptional. Title for the result
descriptionStringOptional. Short description of the result
captionStringOptional. Caption of the photo to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the photo caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the photo
+

InlineQueryResultCachedGif

+

Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be gif
idStringUnique identifier for this result, 1-64 bytes
gif_file_idStringA valid file identifier for the GIF file
titleStringOptional. Title for the result
captionStringOptional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the GIF animation
+

InlineQueryResultCachedMpeg4Gif

+

Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be mpeg4_gif
idStringUnique identifier for this result, 1-64 bytes
mpeg4_file_idStringA valid file identifier for the MP4 file
titleStringOptional. Title for the result
captionStringOptional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the video animation
+

InlineQueryResultCachedSticker

+

Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be sticker
idStringUnique identifier for this result, 1-64 bytes
sticker_file_idStringA valid file identifier of the sticker
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the sticker
+

Note: This will only work in Telegram versions released after 9 April, 2016 for static stickers and after 06 July, 2019 for animated stickers. Older clients will ignore them.

+

InlineQueryResultCachedDocument

+

Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be document
idStringUnique identifier for this result, 1-64 bytes
titleStringTitle for the result
document_file_idStringA valid file identifier for the file
descriptionStringOptional. Short description of the result
captionStringOptional. Caption of the document to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the document caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the file
+

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

+

InlineQueryResultCachedVideo

+

Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be video
idStringUnique identifier for this result, 1-64 bytes
video_file_idStringA valid file identifier for the video file
titleStringTitle for the result
descriptionStringOptional. Short description of the result
captionStringOptional. Caption of the video to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the video caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the video
+

InlineQueryResultCachedVoice

+

Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be voice
idStringUnique identifier for this result, 1-64 bytes
voice_file_idStringA valid file identifier for the voice message
titleStringVoice message title
captionStringOptional. Caption, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the voice message caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the voice message
+

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

+

InlineQueryResultCachedAudio

+

Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the result, must be audio
idStringUnique identifier for this result, 1-64 bytes
audio_file_idStringA valid file identifier for the audio file
captionStringOptional. Caption, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the audio caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the audio
+

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

+

InputMessageContent

+

This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 5 types:

+ +

InputTextMessageContent

+

Represents the content of a text message to be sent as the result of an inline query.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
message_textStringText of the message to be sent, 1-4096 characters
parse_modeStringOptional. Mode for parsing entities in the message text. See formatting options for more details.
entitiesArray of MessageEntityOptional. List of special entities that appear in message text, which can be specified instead of parse_mode
disable_web_page_previewBooleanOptional. Disables link previews for links in the sent message
+

InputLocationMessageContent

+

Represents the content of a location message to be sent as the result of an inline query.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
latitudeFloatLatitude of the location in degrees
longitudeFloatLongitude of the location in degrees
horizontal_accuracyFloat numberOptional. The radius of uncertainty for the location, measured in meters; 0-1500
live_periodIntegerOptional. Period in seconds for which the location can be updated, should be between 60 and 86400.
headingIntegerOptional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
proximity_alert_radiusIntegerOptional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
+

InputVenueMessageContent

+

Represents the content of a venue message to be sent as the result of an inline query.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
latitudeFloatLatitude of the venue in degrees
longitudeFloatLongitude of the venue in degrees
titleStringName of the venue
addressStringAddress of the venue
foursquare_idStringOptional. Foursquare identifier of the venue, if known
foursquare_typeStringOptional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
google_place_idStringOptional. Google Places identifier of the venue
google_place_typeStringOptional. Google Places type of the venue. (See supported types.)
+

InputContactMessageContent

+

Represents the content of a contact message to be sent as the result of an inline query.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
phone_numberStringContact's phone number
first_nameStringContact's first name
last_nameStringOptional. Contact's last name
vcardStringOptional. Additional data about the contact in the form of a vCard, 0-2048 bytes
+

InputInvoiceMessageContent

+

Represents the content of an invoice message to be sent as the result of an inline query.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
titleStringProduct name, 1-32 characters
descriptionStringProduct description, 1-255 characters
payloadStringBot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
provider_tokenStringPayment provider token, obtained via Botfather
currencyStringThree-letter ISO 4217 currency code, see more on currencies
pricesArray of LabeledPricePrice breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
max_tip_amountIntegerOptional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0
suggested_tip_amountsArray of IntegerOptional. A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
provider_dataStringOptional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider.
photo_urlStringOptional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.
photo_sizeIntegerOptional. Photo size
photo_widthIntegerOptional. Photo width
photo_heightIntegerOptional. Photo height
need_nameBooleanOptional. Pass True, if you require the user's full name to complete the order
need_phone_numberBooleanOptional. Pass True, if you require the user's phone number to complete the order
need_emailBooleanOptional. Pass True, if you require the user's email address to complete the order
need_shipping_addressBooleanOptional. Pass True, if you require the user's shipping address to complete the order
send_phone_number_to_providerBooleanOptional. Pass True, if user's phone number should be sent to provider
send_email_to_providerBooleanOptional. Pass True, if user's email address should be sent to provider
is_flexibleBooleanOptional. Pass True, if the final price depends on the shipping method
+

ChosenInlineResult

+

Represents a result of an inline query that was chosen by the user and sent to their chat partner.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
result_idStringThe unique identifier for the result that was chosen
fromUserThe user that chose the result
locationLocationOptional. Sender location, only for bots that require user location
inline_message_idStringOptional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message.
queryStringThe query that was used to obtain the result
+

Note: It is necessary to enable inline feedback via @Botfather in order to receive these objects in updates.

+

Payments

+

Your bot can accept payments from Telegram users. Please see the introduction to payments for more details on the process and how to set up payments for your bot. Please note that users will need Telegram v.4.0 or higher to use payments (released on May 18, 2017).

+

sendInvoice

+

Use this method to send invoices. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
titleStringYesProduct name, 1-32 characters
descriptionStringYesProduct description, 1-255 characters
payloadStringYesBot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
provider_tokenStringYesPayments provider token, obtained via Botfather
currencyStringYesThree-letter ISO 4217 currency code, see more on currencies
pricesArray of LabeledPriceYesPrice breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
max_tip_amountIntegerOptionalThe maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0
suggested_tip_amountsArray of IntegerOptionalA JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
start_parameterStringOptionalUnique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter
provider_dataStringOptionalA JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
photo_urlStringOptionalURL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.
photo_sizeIntegerOptionalPhoto size
photo_widthIntegerOptionalPhoto width
photo_heightIntegerOptionalPhoto height
need_nameBooleanOptionalPass True, if you require the user's full name to complete the order
need_phone_numberBooleanOptionalPass True, if you require the user's phone number to complete the order
need_emailBooleanOptionalPass True, if you require the user's email address to complete the order
need_shipping_addressBooleanOptionalPass True, if you require the user's shipping address to complete the order
send_phone_number_to_providerBooleanOptionalPass True, if user's phone number should be sent to provider
send_email_to_providerBooleanOptionalPass True, if user's email address should be sent to provider
is_flexibleBooleanOptionalPass True, if the final price depends on the shipping method
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.
+

answerShippingQuery

+

If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
shipping_query_idStringYesUnique identifier for the query to be answered
okBooleanYesSpecify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)
shipping_optionsArray of ShippingOptionOptionalRequired if ok is True. A JSON-serialized array of available shipping options.
error_messageStringOptionalRequired if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.
+

answerPreCheckoutQuery

+

Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
pre_checkout_query_idStringYesUnique identifier for the query to be answered
okBooleanYesSpecify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.
error_messageStringOptionalRequired if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.
+

LabeledPrice

+

This object represents a portion of the price for goods or services.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
labelStringPortion label
amountIntegerPrice of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
+

Invoice

+

This object contains basic information about an invoice.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
titleStringProduct name
descriptionStringProduct description
start_parameterStringUnique bot deep-linking parameter that can be used to generate this invoice
currencyStringThree-letter ISO 4217 currency code
total_amountIntegerTotal price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
+

ShippingAddress

+

This object represents a shipping address.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
country_codeStringISO 3166-1 alpha-2 country code
stateStringState, if applicable
cityStringCity
street_line1StringFirst line for the address
street_line2StringSecond line for the address
post_codeStringAddress post code
+

OrderInfo

+

This object represents information about an order.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
nameStringOptional. User name
phone_numberStringOptional. User's phone number
emailStringOptional. User email
shipping_addressShippingAddressOptional. User shipping address
+

ShippingOption

+

This object represents one shipping option.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringShipping option identifier
titleStringOption title
pricesArray of LabeledPriceList of price portions
+

SuccessfulPayment

+

This object contains basic information about a successful payment.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
currencyStringThree-letter ISO 4217 currency code
total_amountIntegerTotal price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
invoice_payloadStringBot specified invoice payload
shipping_option_idStringOptional. Identifier of the shipping option chosen by the user
order_infoOrderInfoOptional. Order info provided by the user
telegram_payment_charge_idStringTelegram payment identifier
provider_payment_charge_idStringProvider payment identifier
+

ShippingQuery

+

This object contains information about an incoming shipping query.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique query identifier
fromUserUser who sent the query
invoice_payloadStringBot specified invoice payload
shipping_addressShippingAddressUser specified shipping address
+

PreCheckoutQuery

+

This object contains information about an incoming pre-checkout query.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
idStringUnique query identifier
fromUserUser who sent the query
currencyStringThree-letter ISO 4217 currency code
total_amountIntegerTotal price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
invoice_payloadStringBot specified invoice payload
shipping_option_idStringOptional. Identifier of the shipping option chosen by the user
order_infoOrderInfoOptional. Order info provided by the user
+

Telegram Passport

+

Telegram Passport is a unified authorization method for services that require personal identification. Users can upload their documents once, then instantly share their data with services that require real-world ID (finance, ICOs, etc.). Please see the manual for details.

+

PassportData

+

Contains information about Telegram Passport data shared with the bot by the user.

+ + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
dataArray of EncryptedPassportElementArray with information about documents and other Telegram Passport elements that was shared with the bot
credentialsEncryptedCredentialsEncrypted credentials required to decrypt the data
+

PassportFile

+

This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
file_sizeIntegerFile size
file_dateIntegerUnix time when the file was uploaded
+

EncryptedPassportElement

+

Contains information about documents or other Telegram Passport elements shared with the bot by the user.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringElement type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.
dataStringOptional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.
phone_numberStringOptional. User's verified phone number, available only for “phone_number” type
emailStringOptional. User's verified email address, available only for “email” type
filesArray of PassportFileOptional. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
front_sidePassportFileOptional. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
reverse_sidePassportFileOptional. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
selfiePassportFileOptional. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
translationArray of PassportFileOptional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
hashStringBase64-encoded element hash for using in PassportElementErrorUnspecified
+

EncryptedCredentials

+

Contains data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
dataStringBase64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication
hashStringBase64-encoded data hash for data authentication
secretStringBase64-encoded secret, encrypted with the bot's public RSA key, required for data decryption
+

setPassportDataErrors

+

Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.

+

Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier
errorsArray of PassportElementErrorYesA JSON-serialized array describing the errors
+

PassportElementError

+

This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of:

+ +

PassportElementErrorDataField

+

Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be data
typeStringThe section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”
field_nameStringName of the data field which has the error
data_hashStringBase64-encoded data hash
messageStringError message
+

PassportElementErrorFrontSide

+

Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be front_side
typeStringThe section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
file_hashStringBase64-encoded hash of the file with the front side of the document
messageStringError message
+

PassportElementErrorReverseSide

+

Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be reverse_side
typeStringThe section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card”
file_hashStringBase64-encoded hash of the file with the reverse side of the document
messageStringError message
+

PassportElementErrorSelfie

+

Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be selfie
typeStringThe section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
file_hashStringBase64-encoded hash of the file with the selfie
messageStringError message
+

PassportElementErrorFile

+

Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be file
typeStringThe section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
file_hashStringBase64-encoded file hash
messageStringError message
+

PassportElementErrorFiles

+

Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be files
typeStringThe section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
file_hashesArray of StringList of base64-encoded file hashes
messageStringError message
+

PassportElementErrorTranslationFile

+

Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be translation_file
typeStringType of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
file_hashStringBase64-encoded file hash
messageStringError message
+

PassportElementErrorTranslationFiles

+

Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be translation_files
typeStringType of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
file_hashesArray of StringList of base64-encoded file hashes
messageStringError message
+

PassportElementErrorUnspecified

+

Represents an issue in an unspecified place. The error is considered resolved when new data is added.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
sourceStringError source, must be unspecified
typeStringType of element of the user's Telegram Passport which has the issue
element_hashStringBase64-encoded element hash
messageStringError message
+

Games

+

Your bot can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats. Create games via @BotFather using the /newgame command. Please note that this kind of power requires responsibility: you will need to accept the terms for each game that your bots will be offering.

+
    +
  • Games are a new type of content on Telegram, represented by the Game and InlineQueryResultGame objects.
  • +
  • Once you've created a game via BotFather, you can send games to chats as regular messages using the sendGame method, or use inline mode with InlineQueryResultGame.
  • +
  • If you send the game message without any buttons, it will automatically have a 'Play GameName' button. When this button is pressed, your bot gets a CallbackQuery with the game_short_name of the requested game. You provide the correct URL for this particular user and the app opens the game in the in-app browser.
  • +
  • You can manually add multiple buttons to your game message. Please note that the first button in the first row must always launch the game, using the field callback_game in InlineKeyboardButton. You can add extra buttons according to taste: e.g., for a description of the rules, or to open the game's official community.
  • +
  • To make your game more attractive, you can upload a GIF animation that demostrates the game to the users via BotFather (see Lumberjack for example).
  • +
  • A game message will also display high scores for the current chat. Use setGameScore to post high scores to the chat with the game, add the edit_message parameter to automatically update the message with the current scoreboard.
  • +
  • Use getGameHighScores to get data for in-game high score tables.
  • +
  • You can also add an extra sharing button for users to share their best score to different chats.
  • +
  • For examples of what can be done using this new stuff, check the @gamebot and @gamee bots.
  • +
+

sendGame

+

Use this method to send a game. On success, the sent Message is returned.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
chat_idIntegerYesUnique identifier for the target chat
game_short_nameStringYesShort name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.
+

Game

+

This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
titleStringTitle of the game
descriptionStringDescription of the game
photoArray of PhotoSizePhoto that will be displayed in the game message in chats.
textStringOptional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.
text_entitiesArray of MessageEntityOptional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
animationAnimationOptional. Animation that will be displayed in the game message in chats. Upload via BotFather
+

CallbackGame

+

A placeholder, currently holds no information. Use BotFather to set up your game.

+

setGameScore

+

Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited Message, otherwise returns True. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier
scoreIntegerYesNew score, must be non-negative
forceBooleanOptionalPass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
disable_edit_messageBooleanOptionalPass True, if the game message should not be automatically edited to include the current scoreboard
chat_idIntegerOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the sent message
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
+

getGameHighScores

+

Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects.

+
+

This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeRequiredDescription
user_idIntegerYesTarget user id
chat_idIntegerOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the sent message
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
+

GameHighScore

+

This object represents one row of the high scores table for a game.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
positionIntegerPosition in high score table for the game
userUserUser
scoreIntegerScore
+
+

And that's about all we've got for now.
If you've got any questions, please check out our Bot FAQ »

+
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/bots/faq.html b/data/core.telegram.org/bots/faq.html new file mode 100644 index 0000000000..c69a177090 --- /dev/null +++ b/data/core.telegram.org/bots/faq.html @@ -0,0 +1,243 @@ + + + + + Bots FAQ + + + + + + + + + + + + + +
+ +
+
+
+ +

Bots FAQ

+ +
+

If you are new to Telegram bots, we recommend checking out our Introduction to Bots first.
You may also find the Bot API Manual useful.

+
+

+ +
+

General Questions

+

How do I create a bot?

+

Creating Telegram bots is super-easy, but you will need at least some skills at computer programming. In order for a bot to work, set up a bot account with @BotFather, then connect it to your backend server via our API.

+

Unfortunately, there are no out-of-the-box ways to create a working bot if you are not a developer. But we're sure you'll soon find plenty of bots created by other people to play with.

+

I'm a developer. Where can I find some examples?

+

Here are two sample bots, both written in PHP:

+
    +
  • Hello Bot demonstrates the basics of the Telegram bot API.
  • +
  • Simple Poll bot is a more complete example, it supports both long-polling and Webhooks for updates.
  • +
+
+

Many members of our community are building bots and publishing sources.
We're collecting them on this page »

+
+

Ping us on @BotSupport if you've built a bot and would like to share it with others.

+

Will you add X to the Bot API?

+

The bot API is still pretty young. There are many potential features to consider and implement. We'll be studying what people do with their bots for a while to see which directions will be most important for the platform.

+

All bot developers are welcome to share ideas for our Bot API with our @BotSupport account.

+

What messages will my bot get?

+

1. All bots, regardless of settings, will receive:

+
    +
  • All service messages.
  • +
  • All messages from private chats with users.
  • +
  • All messages from channels where they are a member.
  • +
+

2. Bot admins and bots with privacy mode disabled will receive all messages except messages sent by other bots.

+

3. Bots with privacy mode enabled will receive:

+
    +
  • Commands explicitly meant for them (e.g., /command@this_bot).
  • +
  • General commands from users (e.g. /start) if the bot was the last bot to send a message to the group.
  • +
  • Messages sent via this bot.
  • +
  • Replies to any messages implicitly or explicitly meant for this bot.
  • +
+

Note that each particular message can only be available to one privacy-enabled bot at a time, i.e., a reply to bot A containing an explicit command for bot B or sent via bot C will only be available to bot A. Replies have the highest priority.

+

Why doesn't my bot see messages from other bots?

+

Bots talking to each other could potentially get stuck in unwelcome loops. To avoid this, we decided that bots will not be able to see messages from other bots regardless of mode.

+

Getting Updates

+

How do I get updates?

+

There are currently two ways of getting updates. You can either use long polling or Webhooks. Please note that it's not possible to get updates via long polling while an outgoing Webhook is set.

+

Long polling gives me the same updates again and again!

+

The getUpdates method returns the earliest 100 unconfirmed updates. To confirm an update, use the offset parameter when calling getUpdates like this:

+
offset = update_id of last processed update + 1
+

All updates with update_id less than or equal to offset will be marked as confirmed on the server and will no longer be returned.

+

I'm having problems with Webhooks.

+

If you've set up your webhook successfully, but are not getting any updates, please remember:

+
    +
  • You need a valid SSL certificate for webhooks to work.
  • +
  • To use a self-signed certificate, you need to upload your public key certificate using the certificate parameter in setWebhook. Please upload as InputFile, sending a String will not work.
  • +
  • Ports currently supported for Webhooks: 443, 80, 88, 8443.
  • +
  • Wildcard certificates may not be supported.
  • +
  • Redirects are not supported.
  • +
  • CN must exactly match your domain.
  • +
+
+

Please check out this new WEBHOOK GUIDE to learn all there is to know about webhooks!

+
+

I'm having trouble with my self-signed certificate!

+

Please take a look at this self-signed certificate guide we made just for you. If you've read it and still have a question, ping us on botsupport.

+

How can I make sure that Webhook requests are coming from Telegram?

+

If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL you give us, e.g. www.example.com/your_token. Since nobody else knows your bot's token, you can be pretty sure it's us.

+

How can I make requests in response to updates?

+

This is possible if you're using webhooks. The upside is that you need less requests, the downside — that in this case it's not possible to know that such a request was successful or get its result.

+

Whenever you receive a webhook update, you have two options:

+

1. Issue POST to https://api.telegram.org/bot<token>/method

+
+ +
+ +

2. Reply directly and give method as JSON payload in the reply

+
+
+ +
+

You may also want to look at our sample HelloBot, it offers a PHP implementation of this.

+
+

Handling Media

+

How do I download files?

+

Use the getFile method. Please note that this will only work with files of up to 20 MB in size.

+

How do I upload a large file?

+

Bots can currently send files of any type of up to 50 MB in size, so yes, very large files won't work for now. Sorry. This limit may be changed in the future.

+

Can I count on file_ids to be persistent?

+

Yes, file_ids can be treated as persistent.

+

Broadcasting to Users

+

My bot is hitting limits, how do I avoid this?

+

When sending messages inside a particular chat, avoid sending more than one message per second. We may allow short bursts that go over this limit, but eventually you'll begin receiving 429 errors.

+

If you're sending bulk notifications to multiple users, the API will not allow more than 30 messages per second or so. Consider spreading out notifications over large intervals of 8—12 hours for best results.

+

Also note that your bot will not be able to send more than 20 messages per minute to the same group.

+

How can I message all of my bot's subscribers at once?

+

Unfortunately, at this moment we don't have methods for sending bulk messages, e.g. notifications. We may add something along these lines in the future.

+

In order to avoid hitting our limits when sending out mass notifications, consider spreading them over longer intervals, e.g. 8-12 hours. The API will not allow bulk notifications to more than ~30 users per second, if you go over that, you'll start getting 429 errors.

+

See also: How to avoid hitting limits?

+
+
+

If you've got questions that are not answered on this page, ping us at @BotSupport in Telegram.
We welcome any suggestions for the Bot Platform and API.

+
+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/bots/games.html b/data/core.telegram.org/bots/games.html new file mode 100644 index 0000000000..aba4ca2be2 --- /dev/null +++ b/data/core.telegram.org/bots/games.html @@ -0,0 +1,185 @@ + + + + + Gaming Platform + + + + + + + + + + + + + +
+ +
+
+
+ +

Gaming Platform

+ +
+ +
+ +
+ +

Bots can offer their users HTML5 games to play solo or to compete against each other in groups and one-on-one chats. Games are a new type of content on Telegram that your bot can send to users.

+
+

+
+ +
+

This introduction is meant for bot developers. Click here, in case you'd like something more user-friendly.
Check out the @gamebot and @gamee bots for examples of what you can do using the new Gaming Platform.

+
+

Creating a Game

+

To get started, send the /newgame command to @BotFather.You will be prompted for a description text and a photo. You can also upload an optional GIF animation that demostrates your game to the users to make messages with the game more attractive (check out Lumberjack or Corsairs for examples).

+

Launching the Game

+

Once the game is created, your bot can send it to chats as regular messages, or offer them via inline mode. The game message will always have an inline Play button.

+

When this button is pressed, your bot gets a callback query that indicates the requested game. You provide the correct URL for this particular user and the app automatically opens the game in the in-app browser.

+

Adding Buttons

+

If you send the game message without any buttons, it will automatically have a 'Play GameName' button. You can manually add multiple buttons to your game message. Please note that the first button in the first row must always be the one that launches the game. You can add more buttons: e.g., for a description of the rules, or a button that links to the game's official community.

+

Tracking High Scores

+

The message with your game will also display high scores for the current chat. When a new high score is set, a service message will be sent to the chat and the message with the current scoreboard will be updated. You can also request the necessary data for building in-game high score tables.

+
+
+ +

+ +

+ +

Sharing Your Game to Telegram Chats

+

There are many way for users to spread your game virally if they like it. The interface will always have the standard system button for sharing the game in the top right corner:

+
+ + +

+ +
+ + + +

You can also create an additional Share button inside your HTML page. Pressing this button will send the game to a desired chat along with the user's best score in the game.

+
+ + + + + +

+ + +

To add the sharing button, include this script at the end of the <body> tag on your page:

+
<script src="https://telegram.org/js/games.js"></script>
+

Then use the method TelegramGameProxy.shareScore() to call the sharing option.

+
+

Warning: Do not call this method without consent and direct action from the user.

+
+

Example:

+
<button onclick="TelegramGameProxy.shareScore()">Share score</button>
+

This library will only work when launched from inside Telegram, so please don't use it on ordinary web pages.

+

Using URL Parameters

+

If your URL is using a fragment identifier, please note that Telegram Apps could add certain service parameters to the fragment id. The names for such parameters will start in tg (you can check the code that adds them here). Use the TelegramGameProxy.initParams object if you need to read your own parameters from the fragment id.

+

Creating a Great HTML5 Experience

+

Please make sure that your HTML5 page is responsive and works well on all Telegram apps and supported platforms. If you find it impossible to support certain conditions or platforms, don't leave your users hanging and at least provide a notification.

+
+

See the Bot API Manual for the relevant methods and objects.

+
+
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/bots/inline.html b/data/core.telegram.org/bots/inline.html new file mode 100644 index 0000000000..7aac930537 --- /dev/null +++ b/data/core.telegram.org/bots/inline.html @@ -0,0 +1,182 @@ + + + + + Inline Bots + + + + + + + + + + + + + +
+ +
+
+
+ +

Inline Bots

+ +
+ +
+ +
+ +

Beyond sending commands in private messages or groups, users can interact with your bot via inline queries. If inline queries are enabled, users can call your bot by typing its username and a query in the text input field in any chat. The query is sent to your bot in an update. This way, people can request content from your bot in any of their chats, groups, or channels without sending any messages at all.

+
+
+
+ + +

To enable this option, send the /setinline command to @BotFather and provide the placeholder text that the user will see in the input field after typing your bot’s name.

+
+

See the Bot API Manual for the relevant methods and objects.

+
+

Inline results

+

Inline bots support all types of content available in Telegram (20 in all). They are capable of sending stickers, videos, music, locations, documents and more.

+
+

+
+ +

Clients can display the results with vertical or horizontal scrolling, depending on the type of content:

+
+ + + + + +
+
+ +

As soon as the user taps on an item, it's immediately sent to the recipient, and the input field is cleared.

+

Switching inline/PM modes

+

Some inline bots can benefit from an initial setup process, like connecting them to an account on an external service (e.g., YouTube). We've added an easy way of switching between the private chat with a bot and whatever chat the user wants to share inline results in.

+
+

+
+ +

You can display a special ‘Switch to PM’ button above the inline results (or instead of them). This button will open a private chat with the bot and pass a parameter of your choosing, so that you can prompt the user for the relevant setup actions. Once done, you can use an inline keyboard with a switch_inline_query button to send the user back to the original chat.

+

Sample bots
@youtube – Shows a ‘Sign in to YouTube’ button, then suggests personalized results.

+
+

Manual: Switch to PM

+
+

Location-based results

+

Inline bots can request location data from their users. Use the /setinlinegeo command with @BotFather to enable this. Your bot will ask the user for permission to access their location whenever they send an inline request.

+

Sample bot
@foursquare – This bot will ask for permission to access the user's location, then provide geo-targeted results.

+

Spreading virally

+

Messages sent with the help of your bot will show its username next to the sender's name.

+
+ + + + + +

+ +

When a user taps on the bot username in the message header, the mention is automatically inserted into the input field. Entering the @ symbol in the input field brings up a list of suggestions, featuring recently used inline bots.

+

Collecting feedback

+

To know which of the provided results your users are sending to their chat partners, send @Botfather the /setinlinefeedback command. With this enabled, you will receive updates on the results chosen by your users.

+

Please note that this can create load issues for popular bots – you may receive more results than actual requests due to caching (see the cache_time parameter in answerInlineQuery). For these cases, we recommend adjusting the probability setting to receive 1/10, 1/100 or 1/1000 of the results.

+

Inline bot samples

+

Here are some sample inline bots, in case you’re curious to see one in action. Try any of these:
@gif – GIF search
@vid – Video search
@pic – Yandex image search
@bing – Bing image search
@wiki – Wikipedia search
@imdb – IMDB search
@bold – Make bold, italic or fixed sys text

+

NEW
@youtube - Connect your account for personalized results
@music - Search and send classical music
@foursquare – Find and send venue addresses
@sticker – Find and send stickers based on emoji

+
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/bots/samples.html b/data/core.telegram.org/bots/samples.html new file mode 100644 index 0000000000..fa0c518df4 --- /dev/null +++ b/data/core.telegram.org/bots/samples.html @@ -0,0 +1,247 @@ + + + + + Bot Code Examples + + + + + + + + + + + + + +
+ +
+
+
+ +

Bot Code Examples

+ +
+

If you want to learn more about Telegram bots, start with our Introduction to Bots »
Check out the FAQ, if you have questions.

+
+

Many members of our community are building bots and libraries and publishing their source code. We collect these examples here. Ping us on BotSupport if you've built a bot and would like to share its code with others.

+

PHP

+ +

Node.js

+ +

Rust

+ +

Python

+ +

Ruby

+ +

Swift

+ +

Kotlin

+ +

Java

+ +

Go

+ +

Other Languages

+ +
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/bots/samples/hellobot.html b/data/core.telegram.org/bots/samples/hellobot.html new file mode 100644 index 0000000000..a60f383356 --- /dev/null +++ b/data/core.telegram.org/bots/samples/hellobot.html @@ -0,0 +1,287 @@ + + + + + Hellobot + + + + + + + + + + + + + +
+ +
+
+
+ +

Hellobot

+ +
+

This sample PHP bot demonstrates the basics of the Telegram Bot API.
If you have questions, try our FAQ or check out this page for more examples.

+
+

+ +
<?php
+
+define('BOT_TOKEN', '12345678:replace-me-with-real-token');
+define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/');
+
+function apiRequestWebhook($method, $parameters) {
+  if (!is_string($method)) {
+    error_log("Method name must be a string\n");
+    return false;
+  }
+
+  if (!$parameters) {
+    $parameters = array();
+  } else if (!is_array($parameters)) {
+    error_log("Parameters must be an array\n");
+    return false;
+  }
+
+  $parameters["method"] = $method;
+
+  $payload = json_encode($parameters);
+  header('Content-Type: application/json');
+  header('Content-Length: '.strlen($payload));
+  echo $payload;
+
+  return true;
+}
+
+function exec_curl_request($handle) {
+  $response = curl_exec($handle);
+
+  if ($response === false) {
+    $errno = curl_errno($handle);
+    $error = curl_error($handle);
+    error_log("Curl returned error $errno: $error\n");
+    curl_close($handle);
+    return false;
+  }
+
+  $http_code = intval(curl_getinfo($handle, CURLINFO_HTTP_CODE));
+  curl_close($handle);
+
+  if ($http_code >= 500) {
+    // do not wat to DDOS server if something goes wrong
+    sleep(10);
+    return false;
+  } else if ($http_code != 200) {
+    $response = json_decode($response, true);
+    error_log("Request has failed with error {$response['error_code']}: {$response['description']}\n");
+    if ($http_code == 401) {
+      throw new Exception('Invalid access token provided');
+    }
+    return false;
+  } else {
+    $response = json_decode($response, true);
+    if (isset($response['description'])) {
+      error_log("Request was successful: {$response['description']}\n");
+    }
+    $response = $response['result'];
+  }
+
+  return $response;
+}
+
+function apiRequest($method, $parameters) {
+  if (!is_string($method)) {
+    error_log("Method name must be a string\n");
+    return false;
+  }
+
+  if (!$parameters) {
+    $parameters = array();
+  } else if (!is_array($parameters)) {
+    error_log("Parameters must be an array\n");
+    return false;
+  }
+
+  foreach ($parameters as $key => &$val) {
+    // encoding to JSON array parameters, for example reply_markup
+    if (!is_numeric($val) && !is_string($val)) {
+      $val = json_encode($val);
+    }
+  }
+  $url = API_URL.$method.'?'.http_build_query($parameters);
+
+  $handle = curl_init($url);
+  curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
+  curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 5);
+  curl_setopt($handle, CURLOPT_TIMEOUT, 60);
+
+  return exec_curl_request($handle);
+}
+
+function apiRequestJson($method, $parameters) {
+  if (!is_string($method)) {
+    error_log("Method name must be a string\n");
+    return false;
+  }
+
+  if (!$parameters) {
+    $parameters = array();
+  } else if (!is_array($parameters)) {
+    error_log("Parameters must be an array\n");
+    return false;
+  }
+
+  $parameters["method"] = $method;
+
+  $handle = curl_init(API_URL);
+  curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
+  curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 5);
+  curl_setopt($handle, CURLOPT_TIMEOUT, 60);
+  curl_setopt($handle, CURLOPT_POST, true);
+  curl_setopt($handle, CURLOPT_POSTFIELDS, json_encode($parameters));
+  curl_setopt($handle, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
+
+  return exec_curl_request($handle);
+}
+
+function processMessage($message) {
+  // process incoming message
+  $message_id = $message['message_id'];
+  $chat_id = $message['chat']['id'];
+  if (isset($message['text'])) {
+    // incoming text message
+    $text = $message['text'];
+
+    if (strpos($text, "/start") === 0) {
+      apiRequestJson("sendMessage", array('chat_id' => $chat_id, "text" => 'Hello', 'reply_markup' => array(
+        'keyboard' => array(array('Hello', 'Hi')),
+        'one_time_keyboard' => true,
+        'resize_keyboard' => true)));
+    } else if ($text === "Hello" || $text === "Hi") {
+      apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => 'Nice to meet you'));
+    } else if (strpos($text, "/stop") === 0) {
+      // stop now
+    } else {
+      apiRequestWebhook("sendMessage", array('chat_id' => $chat_id, "reply_to_message_id" => $message_id, "text" => 'Cool'));
+    }
+  } else {
+    apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => 'I understand only text messages'));
+  }
+}
+
+
+define('WEBHOOK_URL', 'https://my-site.example.com/secret-path-for-webhooks/');
+
+if (php_sapi_name() == 'cli') {
+  // if run from console, set or delete webhook
+  apiRequest('setWebhook', array('url' => isset($argv[1]) && $argv[1] == 'delete' ? '' : WEBHOOK_URL));
+  exit;
+}
+
+
+$content = file_get_contents("php://input");
+$update = json_decode($content, true);
+
+if (!$update) {
+  // receive wrong update, must not happen
+  exit;
+}
+
+if (isset($update["message"])) {
+  processMessage($update["message"]);
+}
+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/bots/self-signed.html b/data/core.telegram.org/bots/self-signed.html new file mode 100644 index 0000000000..efe82919b4 --- /dev/null +++ b/data/core.telegram.org/bots/self-signed.html @@ -0,0 +1,161 @@ + + + + + Using self-signed certificates + + + + + + + + + + + + + +
+ +
+
+
+ +

Using self-signed certificates

+ +

Upload your certificate using the certificate parameter in the setWebhook method. The certificate supplied should be PEM encoded (ASCII BASE64), the pem file should only contain the public key (including BEGIN and END portions). When converting from a bundle format, please split the file to only include the public key.

+

Generating a self-signed certificate pair (PEM):

+

Openssl

+
+

Windows binaries for Openssl are available online

+
+

openssl req -newkey rsa:2048 -sha256 -nodes -keyout YOURPRIVATE.key -x509 -days 365 -out YOURPUBLIC.pem -subj "/C=US/ST=New York/L=Brooklyn/O=Example Brooklyn Company/CN=YOURDOMAIN.EXAMPLE"

+

YOURPUBLIC.pem has to be used as input for setting the self-signed webhook.

+

You can inspect the generated certificate with:
openssl x509 -text -noout -in YOURPUBLIC.pem

+

Converting from a previously generated DER:
openssl x509 -inform der -in YOURDER.der -out YOURPEM.pem

+

Converting from a previously generated PKCS12:
openssl pkcs12 -in YOURPKCS.p12 -out YOURPEM.pem

+
+

More information: https://www.openssl.org/

+
+

Java keystore

+

Generate self-signed JKS:
keytool -genkey -keyalg RSA -alias YOURDOMAIN.EXAMPLE -keystore YOURJKS.jks -storepass YOURPASSWORD -validity 360 -keysize 2048

+

Converting JKS to pkcs12 (intermediate step for conversion to PEM):
keytool -importkeystore -srckeystore YOURJKS.jks -destkeystore YOURPKCS.p12 -srcstoretype jks -deststoretype pkcs12

+

Convert PKCS12 to PEM (requires openssl):
openssl pkcs12 -in YOURPKCS.p12 -out YOURPEM.pem

+
+

More information: https://docs.oracle.com

+
+

Windows

+

Creating a self-signed certificate using Windows native utilities is also possible, although OpenSSL binaries for Windows are available online.

+

On the commandline:
certreq -new TEMPLATE.txt RequestFileOut

+

TEMPLATE.txt example file:

+
[NewRequest]
+
+; At least one value must be set in this section
+Subject = "CN=DOMAIN.EXAMPLE"
+KeyLength = 2048
+KeyAlgorithm = RSA
+HashAlgorithm = sha256
+;MachineKeySet = true
+RequestType = Cert
+UseExistingKeySet=false ;generates a new private key (for export)
+Exportable = true ;makes the private key exportable with the PFX
+

A self-signed certificate will be generated and installed, to view the certificate:
certutil -store -user my

+

To export in DER format (intermediate step for conversion to PEM)
certutil -user -store -split my SERIALNUMBER YOURDER.crt

+

Converting to PEM (used for setting the webhook)
certutil -encode YOURDER.crt YOURPEM.cer

+

To delete a certificate from your store:
certutil -delstore -user my SERIALNUMBER (from view)

+

To export in PFX(PKCS12) format
certutil -exportpfx -user YOURDOMAIN.EXAMPLE YOURPKCS.pfx NoChain

+
+

More information: https://technet.microsoft.com

+
+

Converting YOURPKCS.pfx to PEM including the private key is best done with OpenSSL:
openssl pkcs12 -in YOURPKCS.pfx -out YOURPEM.cer

+

Remember that only the public key is needed as input for the self-signed webhook certificate parameter. certmgr.msc can also be used as a GUI to export the public part of self-signed certificates to PEM.

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/bots/webhooks.html b/data/core.telegram.org/bots/webhooks.html new file mode 100644 index 0000000000..f22400f08f --- /dev/null +++ b/data/core.telegram.org/bots/webhooks.html @@ -0,0 +1,827 @@ + + + + + Marvin's Marvellous Guide to All Things Webhook + + + + + + + + + + + + + +
+ +
+
+
+ +

Marvin's Marvellous Guide to All Things Webhook

+ +
+ +

We currently support two ways of processing bot updates, getUpdates and setWebhook. getUpdates is a pull mechanism, setwebhook is push. Although the concept of a webhook is fairly simple, the setup of the individual components has proven to be tricky for many. This guide provides some extra information for those of you brave enough to venture into the art of the webhook.

+

There are some advantages of using a webhook over getUpdates. As soon as an update arrives, we’ll kindly deliver it to your bot for processing.

+

This:

+
1. Avoids your bot having to ask for updates frequently.
+2. Avoids the need for some kind of polling mechanism in your code.
+

Other advantages may include saving some potential CPU cycles and an increase in response time, these things however depend heavily on the usage pattern of your bot.

+

Setting a webhook means you supplying Telegram with a location in the form of a URL, on which your bot listens for updates. We need to be able to connect and post updates to that URL.

+

To ensure that we can do that, there are some basic requirements:

+

The short version

+

You'll need a server that:

+
    +
  • Supports IPv4, IPv6 is currently not supported for webhooks.
  • +
  • Accepts incoming POSTs from subnets 149.154.160.0/20 and 91.108.4.0/22 on port 443, 80, 88, or 8443.
  • +
  • Is able to handle TLS1.2(+) HTTPS-traffic.
  • +
  • Provides a supported, non-wildcard, verified or self-signed certificate.
  • +
  • Uses a CN or SAN that matches the domain you’ve supplied on setup.
  • +
  • Supplies all intermediate certificates to complete a verification chain.
  • +
+

That’s almost all there’s to it.
If you decide to limit traffic to our specific range of addresses, keep an eye on this document whenever you seem to run into trouble. Our IP-range might change in the future.

+

The longer version

+
    +
  • A domain name

    +

    Setting a webhook needs a URL for us to post to. For that you'll need a server with a domain name. If you don't have one, you'll need to obtain one first. Telegram currently doesn't offer hosting or domain name services. There are quite a few VPS/Web hosting providers around the internet, feel free to pick one to your liking.
    If you're using a self-signed certificate, you may use the IP as a CN, instead of the domain name.
    How do I get a server with a domain name?

    +
  • +
  • An open port

    +

    A webhook needs an open port on your server. We currently support the following ports: 443, 80, 88 and 8443. Other ports are not supported and will not work. Make sure your bot is running on one of those supported ports, and that the bot is reachable via its public address.

    +
    If you want to limit access to Telegram only, please allow traffic from 149.154.167.197-233 (starting July 2019 please use: 149.154.160.0/20 and 91.108.4.0/22). 
    +Whenever something stops working in the future, please check this document again as 
    +the range might expand or change.
    +

    How do I check for open ports or limit access to my bot?

    +
  • +
  • Always SSL/TLS

    +

    A webhook requires SSL/TLS encryption, no matter which port is used. It's not possible to use a plain-text HTTP webhook. You shouldn't want to either, for the sake of your bot and users.
    SSL/TLS, why do I have to handle this for a webhook?

    +
  • +
  • Not all SSL/TLS is equal

    +

    We support any SSL/TLS version TLS1.2 and up for your webhook. This means that SSLV2/3/TLS1.0/TSL1.1 are NOT supported, due to security issues associated with those older versions.
    How do I check that I’m handling the right version?

    +
  • +
  • SSL needs a certificate

    +

    The common name (CN) of your certificate (self-signed or verified) has to match the domain name where your bot is hosted. You may also use a subject alternative name (SAN), that matches the domain for your webhook. Server Name Indication (SNI)-routing is supported. If you're using a self-signed certificate, you may use the IP as a CN, instead of the domain name.
    A certificate, where do I get one, and how?

    +
  • +
  • Verified or self-signed

    +

    A certificate can either be verified or self-signed. Setting a webhook with a self-signed certificate differs a little from setting a webhook with a verified certificate. Ensure you're using the correct setup for the type of certificate you've chosen for your webhook.
    How do I set a webhook for either type?

    +
  • +
  • Supported certificates

    +

    Not all verified certificates are supported. Certificates are based on a network of trust and come in a chain. Trusting your verified certificate means we have to trust the provider of that certificate, the Certificate Authority (and hence its root certificate). Before you pick a certificate provider, Check this list to make sure that we actually trust their root certificate.
    What if my root certificate isn’t on that list?

    +
  • +
  • An Untrusted root

    +

    Ok, so you already had a certificate installed and just discovered it’s not on our list.
    Start by ignoring it, and just try to set it. We occasionally add extra root certificates to keep up with popular demand, so the list isn't always exhaustive. Unlucky after all? We'll allow you to supply an unsupported root certificate when setting the webhook. This method is nearly identical to setting a self-signed certificate webhook. Instead of your self-signed certificate you'll be sending us the root certificate as inputFile.
    Setting a verified webhook with an untrusted root

    +
  • +
  • Intermediate certificates

    +

    Some verified certificates require an intermediate certificate. In this construction the provider of your verified certificate has used their root certificate to sign an intermediate certificate. This intermediate certificate is then used to sign your verified certificate. You'll need to provide the intermediate certificate for us to be able to verify the chain of trust. CA's that use this type of chain supply an intermediate certificate.
    Supplying an intermediate certificate

    +
  • +
  • More information

    +

    Since we know webhooks can be a tad overwhelming, we’re working on a little digital assistant that’ll try and help you with the most common problems, it's not nearly perfect, but you may try using @CanOfWormsBot to check if your chain of certificates is installed correctly before contacting support.

    +
  • +
  • Testing your bot

    +

    We took the liberty of adding a set of example updates. They come in handy when testing your bot, no matter which method of getting updates you might be using.

    +
  • +
  • Don't panic.

    +

    If by now you're looking for your fishing gear because we've mentioned ports and hooks or you're about to Google what kind of bait URL and TLS exactly are, this guide might not be completely for you. You’re quite likely still a brilliant bot programmer, don’t worry. Perhaps this whole webhook thing is just new to you, not all is lost. If you currently have a working getUpdates situation, it's a good idea to pick up this guide again on a rainy Sunday afternoon and take your time to read up on some subjects around the internet. This guide can only contain a finite amount of information after all.

    +
  • +
+

The verbose version

+
How do I get a server with a domain name?
+

If you use a webhook, we have to deliver requests to your bot to a server we can reach. So yes, you need a server we can connect to. It can be anywhere in the galaxy, if you ensure we can reach the server by domain name (or at least via IP for a self-signed certificate), it will work just fine.

+

There are quite a few ways to get this done, as a novice however it's likely that you're not directly jumping at the chance of crafting this from scratch. Actually, as a novice, we recommend you don't. It's likely to be a complex and long ride.

+

If you got stuck here, make a choice:

+
    +
  • You use getUpdates at the moment and it works, keep it that way. Especially if you're running your bot from a nice machine that does well. There is nothing wrong with using getUpdates.

    +
  • +
  • Go with a hosted service and let a bunch of professionals worry about things like registering a domain, setting up DNS, a web server, securing it and so on.

    +
  • +
+
If you're going with a hosted service, make sure to look for a hosting provider that 
+not only supports your code’s needs, for example: support for your PHP version,
+but one that also handles SSL and allows you to create/deploy certificates.
+
    +
  • Go crazy, dive on the internet and start reading. Once you’re confident that you’ve got all the basic theories down, find yourself a nice hosted VPS or roll your own machine at home and get back to us here.
  • +
+
How do I check for open ports or limit access to my bot?
+

So you have the hosting thing down and all is good so far, however, when you enter the address of your bot in your browser it seems unreachable.

+

Explaining every firewall or web server solution in detail isn't possible for us, which we hope you understand. If you’re running a hosted solution, you’re more likely to have a nice UI where you configure these settings. Head to your configuration panel and check all of them. If you’re on a Linux based VPS with shell access, we have some tips for you:

+
    +
  • Make sure your bot process is indeed configured to listen on the port you're using.
    netstat –ln | grep portnumber
    Shows you if your bot is actually listening for incoming requests on the port you expect.
    sudo lsof -i | grep process name
    Is a simple way to check if that’s actually being listened on by the process your bot is using.
  • +
+
    +
  • Make sure it’s listening correctly.
    Your bot has to listen on the address you’ve exposed to the outside (your public IP), it can also listen on all addresses (*: or 0.0.0.0).
    The netstat and lsof-commands mentioned above assist in checking this. If nothing shows up, it is time to check your configuration and fix it. Set the correct IP, make sure it’s listening on a supported port and fire away! Just use a Web Browser to check if you’re reachable. The problem can be in the configuration of your bot, your web server virtual host configuration, or the servers binding configuration.
  • +
+
    +
  • If you still can’t reach your address, check your firewall.
    sudo iptables –L
    OR
    sudo ufw status verbose (Ubuntu)
    Gives you some insight in the current firewall settings.

    +
  • +
  • If it looks like you’re blocking incoming traffic, let’s fix that.
    sudo iptables –A INPUT –p tcp –m tcp –dport portnumber -j ACCEPT
    OR
    sudo ufw allow portnumber/tcp
    Allows incoming traffic on all interfaces to the specified tcp port.
    sudo iptables –A INPUT –i interfacename –p tcp –m tcp –dport portnumber -j ACCEPT
    OR
    sudo ufw allow in on interfacename to any port portnumber proto tcp
    Allows incoming traffic to a specific interface and a specific port from everywhere.
    sudo ifconfig
    Helps you find the interface with the public address you’re going to use.

    +
  • +
+
If you use iptables, make sure to actually SAVE after changing the configuration.
+On a Debian based system the iptables-persistent package is be a good option.
+RHEL/CentOS offers a service iptables save -command.
+A quick online search for "YOUROPERATINGSYSTEM save iptables" also helps.
+
    +
  • If you’re just looking for some hints on how to limit incoming traffic:
    sudo iptables –A INPUT –i interfacename –p tcp –m iprange –src-range 149.154.167.197-149.154.167.233 –dport portnumber -j ACCEPT
    OR
    sudo ufw allow in on interfacename to any port portnumber proto tcp from 149.154.167.192/26
    Allows incoming traffic to a specific interface and a specific port from a specific range of addresses. (ufw is using a subnet mask in the example, ranging from 192-255)
  • +
+

That’s all for our examples. More information on best practices for setting up your firewall, on whichever operating system you prefer for your bot, is best found on the internet.

+
SSL/TLS, what is it and why do I have to handle this for a webhook?
+

You’re already familiar with it in some form or another. Whenever you see that (nicely green) lock in your browser bar, you know it’s reasonably safe to assume that you’ve landed on the site you actually wanted to visit. If you see the green lock, that's SSL/TLS in action. If you want to learn more about how SSL/TLS works in general, it's best to search the internet.

+

The main difference between getUpdates and a webhook is the way the connection takes place. getUpdates means you'll connect to our server, a webhook means we'll be connecting to your server instead. Connecting to your server has to be done secure, we have to know for sure it's you we're talking to after all. This means you'll have to handle all that server side encryption stuff, virtually presenting us with a green lock. If you use a web server for us to post to, you need to support SSL/TLS handling on the port/virtual host of your choice. An online search for “YOURWEBSERVER enable HTTPS” will help you.

+

Not using a regular web server? Have a look at our example page, most examples there include code for handling SSL/TLS in a webhook setup.

+
How do I check that I’m handling the right version?
+

You just read up on the whole SSL/TLS stuff, figured out that it’s not all that bad to setup and we add some more requirements. Here are some tips to check if you’re indeed supporting at least TLS1.2.

+
    +
  • Several online services exist that allow you to check your certificate installation,
    They give you an overview of your supported TLS versions/Cipher suites and other details. Search online for Symantec crypto report or Qualys ssl. Both supply tools to verify your setup.

    +
  • +
  • Checking locally can also be done, in several ways, here are three options,

    +
      +
    • Go simple:
      Using Chrome as a browser? Open up the URL to your bot and inspect the certificate details. If you’re supporting TLS Chrome tells you so in the security overview tab. Other browsers are likely able to give you similar basic information.

      +
    • +
    • Using curl:
      curl --tlsv1.2 -v -k https://yourbotdomain:yourbotport/
      You can add --tlsv1.2 to force curl into using TLS1.2 when trying to connect. -k is optional and used to check against a self-signed certificate. yourbotdomain is the public hostname your webhook is running on. For local testing purposes you can also use the IP. yourbotport is the port you’re using.

      +
    • +
    • Using OpenSSL
      openssl s_client -tls1_2 -connect yourbotdomain:yourbotport -servername yourbotdomain
      You can add -tls1_2 to force OpenSSL into using TLS1.2 when trying to connect. yourbotdomain is the public hostname your webhook is running on. For local testing purposes you can also use the IP. yourbotport is the port you’re using. Note that https:// isn’t used for OpenSSL. -servername is optional, and included here for some shared hosters, which use SNI to route traffic to the correct domain. When SNI is used you’ll notice that your server appears to be returning a certificate for a different domain than your own. Adding -servername yourbotdomain ensures that SNI negotiation is done, and the correct certificate is returned.

      +
    • +
    +
  • +
  • Some additional configuration pointers

    +
      +
    • Forcing TLS in your virtual host on Apache:
      SSLProtocol -all +TLSv1.2
    • +
    • Forcing TLS in your virtual host on Nginx:
      ssl_protocols TLSv1.2;
    • +
    • Force TLS for your Java virtual machine through system properties:
      -Dhttps.protocols=TLSv1.2 -Djdk.tls.client.protocols=TLSv1.2
    • +
    • Enabling ssl debug for your JVM:
      -Djavax.net.debug=ssl,handshake,record
    • +
    +
  • +
  • Other tools that may help in debugging issues:

    +
      +
    • Wireshark: excellent packet capturing
    • +
    • Tcpdump: equally excellent and doesn’t need a GUI
    • +
    • Charles: web debugging proxy
    • +
    • Fiddler: web debugging proxy
    • +
    +
  • +
+
A certificate, where do I get one and how?
+

You need a certificate, pick on of these types;

+
    +
  • A verified, supported certificate
  • +
  • A self-signed certificate

    +
  • +
  • A verified, supported certificate
    +

    Using a verified certificate means you already have, or will obtain, a certificate backed by a trusted certificate authority (CA). There are many ways to acquire a verified certificate, paid or free. Two popular examples of free suppliers are StartSSL and Let’s Encrypt. You’re welcome to pick another. Just make sure first the supplier is likely to be supported.
    Check this list before selecting a CA.
    Once you’ve picked a CA and validated your identity with them, you can craft your certificate. This frequently starts by generating a CSR (Certificate Signing Request). Generating a CSR is done either through your host machine, or online via the tools provided by the CA.

    +
  • +
  • Here is an example (PEM format output).

    +
      +
    • Using OpenSSL:
      openssl req -newkey rsa:2048 -keyout yourprivatekey.key -out yoursigningrequest.csr
    • +
    +
  • +
+
----
+Generating a 2048 bit RSA private keywriting new private key to yourprivatekey.key
+Enter PEM pass phrase: enter a password for your key here 
+Verifying - Enter PEM pass phrase: confirm the entered password
+-----
+You are about to be asked to enter information that will be incorporated
+into your certificate request.
+What you are about to enter is what is called a Distinguished Name or a DN.
+There are quite a few fields but you can leave some blank
+For some fields there will be a default value,If you enter '.',
+the field will be left blank.-----
+Country Name (2 letter code) [AU]:
+State or Province Name (full name) [Some-State]:
+Locality Name (eg, city) []:
+Organization Name (eg, company) [Internet Widgits Pty Ltd]:
+Organizational Unit Name (eg, section) []:
+Common Name (e.g. server FQDN or YOUR name) []: yourbotdomainname
+Email Address []:
+Please enter the following 'extra' attributes
+to be sent with your certificate request
+A challenge password []:
+An optional company name []:
+---
+
    +
  • Another example:

    +
      +
    • Using Java keytool:
      keytool -genkey -alias yourbotdomainname -keyalg RSA -keystore yourkeystore.jks -keysize 2048
    • +
    +
  • +
+
---
+Enter keystore password:  
+Re-enter new password: 
+What is your first and last name?  [Unknown]: yourbotdomainname
+What is the name of your organizational unit?  [Unknown]:  
+What is the name of your organization?  [Unknown]:  
+What is the name of your City or Locality?  [Unknown]:  
+What is the name of your State or Province?  [Unknown]:  
+What is the two-letter country code for this unit?  [Unknown]:  
+Is CN=test.telegram.org, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct?  
+[no]:  yes
+Enter key password for yourbotdomainname   
+(RETURN if same as keystore password): 
+---
+

This generates the initial keystore, from which you can then create a CSR like this:

+

keytool -certreq -alias yourbotdomainname -keystore yourkeystore.jks -file yourbotdomainname.csr

+
---
+Enter keystore password:
+---
+

To validate your certificate the Common Name (CN) has to match your webhook domain. Example, if you’re using https://www.example.com/example.php as a webhook address, the certificate CN has to be www.example.com.
So you need an exact match of the FQDN you’re setting for the webhook

+

There is an exception, if you’re using a SAN (Subject Alternative Name) the webhook address can either match the CN of your certificate, OR one of the SANs provided in the certificate. In most cases you’ll be using the CN.

+

Create your CSR and supply the contents of the file to your CA. Most CA’s are kind enough to give you an example command of the input format they expect.

+

cat yoursigningrequest.csr or cat yourbotdomainname.csr
Lets you have a look at the CSR we just generated:

+
+ +
+ +

That doesn’t seem to informative, but we can deduce that the file is in PEM format (ASCII base64 encoded) and contains a certificate signing request. Luckily it is possible to look at the human readable contents of the CSR. Use the following commands to double check if all fields are set correctly.

+
    +
  • Using OpenSSL
    openssl req -text -noout -verify -in yoursigningrequest.csr

    +
  • +
  • Using Java keytool
    keytool -printcertreq -v -file yourbotdomainname.csr

    +
  • +
+

Verify your CSR and supply it to your CA to get a certificate. We’ll use StartSSL as an example here. StartSSL allows you to set up to 5 names (SAN), Their intermediate certificate is also needed for a webhook to work, which makes for a nice complete example.

+

Go to the certificates wizard, enter the required hostname(s) for your SSL certificate (this is the CN you’ve also set in the CSR and an optional SAN).

+
+ +
+ +

In the example above we’ve chosen to set a CN (test.telegram.org), but also a SAN (sanexample.telegram.org) The CN given has to match the CN used for generating the CSR.
Set your CN (and optional SAN) and copy the contents of the yoursigningrequest.csr file.

+
+ +
+ +

Paste the contents, submit and you’re done.

+
+ +
+ +

Now you can download the created certificate directly. In the example used above you’ll receive a zip file with several PEM certificates. The root, intermediate and yourdomain certificate.
You need the intermediate and yourdomain to set a webhook with a StartSSL certificate.

+

You can inspect the set of certificates you’ve just downloaded.

+
    +
  • Here are some example commands:

    +
      +
    • Using OpenSSL:
      openssl x509 -in yourdomain.crt -text -noout

      +
    • +
    • Using Java keytool:
      keytool -printcert -v -yourdomain.crt

      +
    • +
    • Using Windows:
      StartSSL supplies certificates in PEM format with a .crt extension, on Windows you can view the contents of them with a quick double click. Extract the files or open the “Otherserver.zip” and double click each of the certificates for inspection. The details tab supplies you with extra information.
      Make sure you have a correct CN in the Subject-field of the yourdomain-certificate. If you're using a SAN, make sure that it is listed in the Subject Alternative Name-field.

      +
    • +
    +
  • +
+
+ +
+ +

With your fresh certificates at hand, you can now continue setting your webhook.

+
    +
  • A self-signed certificate
    +

    Using a self-signed certificate means you’ll forfeit on the chain of trust backed by a CA. Instead you are the CA. For this to work, a slight difference in setup is required. Because Telegram will have no chain of trust to verify your certificate, you have to use the generated public certificate as an input file when setting the webhook. Keep in mind that the certificate file has to be uploaded as multipart/form data in PEM encoded (ASCII BASE64) format.

    +
  • +
  • First let’s generate some certificates:

    +
      +
    • Using OpenSSL:
      openssl req -newkey rsa:2048 -sha256 -nodes -keyout YOURPRIVATE.key -x509 -days 365 -out YOURPUBLIC.pem -subj "/C=US/ST=New York/L=Brooklyn/O=Example Brooklyn Company/CN=YOURDOMAIN.EXAMPLE"
      You’ll end up with 2 files, a private key and the public certificate file. Use YOURPUBLIC.PEM as input file for setting the webhook.

      +
    • +
    • Using Java keytool:
      keytool -genkey -keyalg RSA -alias YOURDOMAIN.EXAMPLE -keystore YOURJKS.jks -storepass YOURPASSWORD -validity 360 -keysize 2048

      +
      What is your first and last name?
      +[test.telegram.org]:
      +What is the name of your organizational unit?
      +[Unknown]:  
      +What is the name of your organization?
      +[Unknown]:  
      +What is the name of your City or Locality?
      +[Unknown]:  
      +What is the name of your State or Province?
      +[Unknown]:  
      +What is the two-letter country code for this unit?
      +[Unknown]:  
      +Is CN=test.telegram.org, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct?
      +[no]: yes
      +

      Once done you’ll need 2 more commands to export the public certificate file from the generated store (you’ll be using the store for your JVM and the PEM for setting the webhook)

      +
    • +
    • Convert the JKS to pkcs12 (intermediate step for conversion to PEM):
      keytool -importkeystore -srckeystore YOURJKS.jks -destkeystore YOURPKCS.p12 -srcstoretype jks -deststoretype pkcs12

      +
    • +
    • Convert PKCS12 to PEM (requires OpenSSL)
      openssl pkcs12 -in YOURPKCS.p12 -out YOURPEM.pem -nokeys

      +
    • +
    • Using Windows:
      Creating a self-signed certificate using Windows native utilities is also possible, although OpenSSL binaries for Windows are available online.
      certreq -new TEMPLATE.txt RequestFileOut generates a CSR.

      +
    • +
    • TEMPLATE.txt example file:

      +
      [NewRequest]
      +; At least one value must be set in this section
      +Subject = "CN=DOMAIN.EXAMPLE"
      +KeyLength = 2048
      +KeyAlgorithm = RSA
      +HashAlgorithm = sha256
      +;MachineKeySet = true
      +RequestType = Cert
      +UseExistingKeySet=false ;generates a new private key (for export)
      +Exportable = true ;makes the private key exportable with the PFX
      +
    • +
    +
  • +
+

A self-signed certificate is generated and installed, to use the certificate for a self-signed webhook you'll have to export it in PEM format.

+
    +
  • Windows continued:

    +
      +
    • You can have a look at the certificates in your store with:
      certutil -store -user my

      +
    • +
    • To export the installed certificate in DER format (intermediate step for conversion to PEM):
      certutil -user -store -split my SERIALNUMBER YOURDER.der

      +
    • +
    • Now you can convert the certificate to PEM:
      certutil -encode YOURDER.der YOURPEM.pem
      Remember that only the public certificate is needed as input for the self-signed webhook certificate parameter.
      certmgr.msc can also be used as a GUI to export the public part of self-signed certificate to PEM.

      +
    • +
    +
  • +
+

After following the above you'll end up with a nice self-signed certificate. You’ll still have to set the webhook, and handle SSL correctly.

+
How do I set a webhook for either type?
+

The setWebhook method is needed for both types. For a verified certificate with a trusted root CA, it’s enough to use the setWebhook method with just the URL parameter.

+
    +
  • A curl example for a verified certificate:
    curl -F "url=https://<YOURDOMAIN.EXAMPLE>/<WEBHOOKLOCATION>" https://api.telegram.org/bot<YOURTOKEN>/setWebhook
  • +
+

For a self-signed certificate an extra parameter is needed, certificate, with the public certificate in PEM format as data.

+
    +
  • A curl example for a self-signed certificate:
    curl -F "url=https://<YOURDOMAIN.EXAMPLE>/<WEBHOOKLOCATION>" -F "certificate=@<YOURCERTIFICATE>.pem" https://api.telegram.org/bot<YOURTOKEN>/setWebhook
  • +
+

The -F means we’re using the multipart/form-data-type to supply the certificate, the type of the certificate parameter is inputFile. Make sure that you’re supplying the correct type.

+

Both parameters for the setWebhook method are classed as optional. Calling the method with an empty URL parameter can be used to clear a previously set webhook.

+
    +
  • A curl example to clear a previous webhook :
    curl -F "url=" https://api.telegram.org/bot<YOURTOKEN>/setWebhook
  • +
+

Keep in mind that the URL parameter starts with https:// when setting a webhook. By default that means we’re knocking at your door on port 443. If you want to use another port (80,88 or 8443), you’ll have to specify the port in the URL parameter.

+
    +
  • Example:
    url=https://<YOURDOMAIN.EXAMPLE>:88/<WEBHOOKLOCATION>
  • +
+
Setting a verified webhook with an untrusted root
+

If you already have a verified certificate and our servers don’t trust your root CA, we have an alternative way for you to set a webhook. Instead of using the setWebhook method without the certificate parameter, you can use the self-signed method. Your CA's root certificate has to be used as an inputFile for the certificate parameter.

+
    +
  • A curl example to supply an untrusted root certificate:
    curl -F "url=https://<YOURDOMAIN.EXAMPLE>" -F "certificate=@<YOURCAROOTCERTIFICATE>.pem" https://api.telegram.org/bot<YOURTOKEN>/setWebhook
    Before you can do this, you need the root certificate of your certificate’s CA. Most CA’s supply their root certificates in several different formats (PEM/DER/etc.). Visit your CA’s website, and download the Root certificate indicated for your verified certificate.
  • +
+

You can use these commands to quickly convert a DER formatted root certificate to PEM:

+
    +
  • Using OpenSSL:
    openssl x509 -inform der -in root.cer -out root.pem

    +
  • +
  • Using Java keytool:
    keytool -import -alias Root -keystore YOURKEYSTORE.JKS -trustcacerts -file ROOTCERT.CER
    The root certificate needs to be imported in your keystore first:
    keytool -exportcert -alias Root -file <YOURROOTPEMFILE.PEM> -rfc -keystore YOURKEYSTORE.JKS

    +
  • +
+

Once done, set your webhook with the root-pem-file and you’ll be good to go. If you need more pointers, have a look at the self-signed part of this guide.

+
Supplying an intermediate certificate
+

Once you’ve crafted your certificate, your CA might present you with a nice bundle. Most bundles contain a root certificate, your public certificate and sometimes an intermediate certificate. StartSSL is one of many CA’s that’ll supply such an intermediate beast. This certificate has to be supplied in the chain of certificates you’re presenting to us when we connect to your server. If an intermediate was used to sign your certificate but isn’t supplied to our servers, we won’t be able to verify the chain of trust and your webhook will not work.

+

If your webhook isn’t working and you’re wondering if the chain is complete:

+
    +
  • Check with your certificate provider if you need an intermediate certificate.
  • +
  • Verify your certificate chain.
    Search online for Symantec crypto report or Qualys ssl. 
    +Both supply tools to verify your setup.
    +
  • +
+

Here’s an example of a complete chain, note that in this case 2 intermediate certificates have been supplied.

+
+ +
+ +

Even though your browser might not complain when visiting your page, an incomplete chain will not work for your webhook. If your chain is incomplete we have some tips to add them to your current setup:

+
    +
  • Apache:
    Add the intermediate certificate to the end of the file configured in the SSLCertificateFile directive of your virtual host configuration. If you’re using an older version than Apache 2.4.8, you may use the SSLCertificateChainFile directive instead.

    +
  • +
  • Nginx:
    Add the intermediate certificate to the end of the file configured in the ssl_certificate_key directive of your virtual host configuration.

    +
  • +
  • A quick command for doing this correctly:
    cat your_domain_name.pem intermediate.pem >> bundle.pem
    Make sure the order is correct, expect failure otherwise.

    +
  • +
  • Java keytool:
    keytool -import -trustcacerts -alias intermediate -file intermediate.pem -keystore YOURKEYSTORE.jks

    +
  • +
+

The end result of all this is a complete certificate chain, backed by either a root certificate we trust or, in the case of an untrusted root, a root certificate you're supplying to us. Make sure to verify your setup again after adding the intermediate, once done, you're good to go!

+
Testing your bot with updates
+
    +
  • Update examples
    A set of example updates, which comes in handy for testing your bot.

    +
      +
    • Message with text using curl:

      +
      curl --tlsv1.2 -v -k -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache"  -d '{
      +"update_id":10000,
      +"message":{
      +  "date":1441645532,
      +  "chat":{
      +     "last_name":"Test Lastname",
      +     "id":1111111,
      +     "first_name":"Test",
      +     "username":"Test"
      +  },
      +  "message_id":1365,
      +  "from":{
      +     "last_name":"Test Lastname",
      +     "id":1111111,
      +     "first_name":"Test",
      +     "username":"Test"
      +  },
      +  "text":"/start"
      +}
      +}' "https://YOUR.BOT.URL:YOURPORT/"
      +

      --tlsv1.2 will force using TLS1.2.

      +
    • +
    • Message with text using Postman:

      +
      + +
      +
    • +
    +
  • +
  • More examples in curl:

    +
      +
    • Message with text:
      curl -v -k -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache"  -d '{
      +"update_id":10000,
      +"message":{
      +  "date":1441645532,
      +  "chat":{
      +     "last_name":"Test Lastname",
      +     "id":1111111,
      +     "type": "private",
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "message_id":1365,
      +  "from":{
      +     "last_name":"Test Lastname",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "text":"/start"
      +}
      +}' "https://YOUR.BOT.URL:YOURPORT/"
      +
    • +
    • Forwarded message:
      curl -v -k -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache"  -d '{
      +"update_id":10000,
      +"message":{
      +  "date":1441645532,
      +  "chat":{
      +     "last_name":"Test Lastname",
      +     "id":1111111,
      +     "type": "private",
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "message_id":1365,
      +  "from":{
      +     "last_name":"Test Lastname",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "forward_from": {
      +     "last_name":"Forward Lastname",
      +     "id": 222222,
      +     "first_name":"Forward Firstname"
      +  },
      +  "forward_date":1441645550,
      +  "text":"/start"
      +}
      +}' "https://YOUR.BOT.URL:YOURPORT/"
      +
    • +
    • Forwarded channel message:
      curl -v -k -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache"  -d '{
      +"update_id":10000,
      +"message":{
      +  "date":1441645532,
      +  "chat":{
      +     "last_name":"Test Lastname",
      +     "type": "private",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "message_id":1365,
      +  "from":{
      +     "last_name":"Test Lastname",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "forward_from": {
      +     "id": -10000000000,
      +     "type": "channel",
      +     "title": "Test channel"
      +  },
      +  "forward_date":1441645550,
      +  "text":"/start"
      +}
      +}' "https://YOUR.BOT.URL:YOURPORT/"
      +
    • +
    • Message with a reply:
      curl -v -k -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache"  -d '{
      +"update_id":10000,
      +"message":{
      +  "date":1441645532,
      +  "chat":{
      +     "last_name":"Test Lastname",
      +     "type": "private",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "message_id":1365,
      +  "from":{
      +     "last_name":"Test Lastname",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "text":"/start",
      +  "reply_to_message":{
      +      "date":1441645000,
      +      "chat":{
      +          "last_name":"Reply Lastname",
      +          "type": "private",
      +          "id":1111112,
      +          "first_name":"Reply Firstname",
      +          "username":"Testusername"
      +      },
      +      "message_id":1334,
      +      "text":"Original"
      +  }
      +}
      +}' "https://YOUR.BOT.URL:YOURPORT/"
      +
    • +
    • Edited message:
      curl -v -k -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache"  -d '{
      +"update_id":10000,
      +"edited_message":{
      +  "date":1441645532,
      +  "chat":{
      +     "last_name":"Test Lastname",
      +     "type": "private",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "message_id":1365,
      +  "from":{
      +     "last_name":"Test Lastname",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "text":"Edited text",
      +  "edit_date": 1441646600
      +}
      +}' "https://YOUR.BOT.URL:YOURPORT/"
      +
    • +
    • Message with entities:
      curl -v -k -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache"  -d '{
      +"update_id":10000,
      +"message":{
      +  "date":1441645532,
      +  "chat":{
      +     "last_name":"Test Lastname",
      +     "type": "private",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "message_id":1365,
      +  "from":{
      +     "last_name":"Test Lastname",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "text":"Bold and italics",
      +  "entities": [
      +      {
      +          "type": "italic",
      +          "offset": 9,
      +          "length": 7
      +      },
      +      {
      +          "type": "bold",
      +          "offset": 0,
      +          "length": 4
      +      }
      +      ]
      +}
      +}' "https://YOUR.BOT.URL:YOURPORT/"
      +
    • +
    • Message with audio:
      curl -v -k -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache"  -d '{
      +"update_id":10000,
      +"message":{
      +  "date":1441645532,
      +  "chat":{
      +     "last_name":"Test Lastname",
      +     "type": "private",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "message_id":1365,
      +  "from":{
      +     "last_name":"Test Lastname",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "audio": {
      +      "file_id": "AwADBAADbXXXXXXXXXXXGBdhD2l6_XX",
      +      "duration": 243,
      +      "mime_type": "audio/mpeg",
      +      "file_size": 3897500,
      +      "title": "Test music file"
      +  }
      +}
      +}' "https://YOUR.BOT.URL:YOURPORT/"
      +
    • +
    • Voice message:
      curl -v -k -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache"  -d '{
      +"update_id":10000,
      +"message":{
      +  "date":1441645532,
      +  "chat":{
      +     "last_name":"Test Lastname",
      +     "type": "private",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "message_id":1365,
      +  "from":{
      +     "last_name":"Test Lastname",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "voice": {
      +      "file_id": "AwADBAADbXXXXXXXXXXXGBdhD2l6_XX",
      +      "duration": 5,
      +      "mime_type": "audio/ogg",
      +      "file_size": 23000
      +  }
      +}
      +}' "https://YOUR.BOT.URL:YOURPORT/"
      +
    • +
    • Message with a document:
      curl -v -k -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache"  -d '{
      +"update_id":10000,
      +"message":{
      +  "date":1441645532,
      +  "chat":{
      +     "last_name":"Test Lastname",
      +     "type": "private",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "message_id":1365,
      +  "from":{
      +     "last_name":"Test Lastname",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "document": {
      +      "file_id": "AwADBAADbXXXXXXXXXXXGBdhD2l6_XX",
      +      "file_name": "Testfile.pdf",
      +      "mime_type": "application/pdf",
      +      "file_size": 536392
      +  }
      +}
      +}' "https://YOUR.BOT.URL:YOURPORT/"
      +
    • +
    • Inline query:
      curl -v -k -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache"  -d '{
      +"update_id":10000,
      +"inline_query":{
      +  "id": 134567890097,
      +  "from":{
      +     "last_name":"Test Lastname",
      +     "type": "private",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "query": "inline query",
      +  "offset": ""
      +}
      +}' "https://YOUR.BOT.URL:YOURPORT/"
      +
    • +
    • Chosen inline query:
      curl -v -k -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache"  -d '{
      +"update_id":10000,
      +"chosen_inline_result":{
      +  "result_id": "12",
      +  "from":{
      +     "last_name":"Test Lastname",
      +     "type": "private",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "query": "inline query",
      +  "inline_message_id": "1234csdbsk4839"
      +}
      +}' "https://YOUR.BOT.URL:YOURPORT/"
      +
    • +
    • Callback query:
      curl -v -k -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache"  -d '{
      +"update_id":10000,
      +"callback_query":{
      +  "id": "4382bfdwdsb323b2d9",
      +  "from":{
      +     "last_name":"Test Lastname",
      +     "type": "private",
      +     "id":1111111,
      +     "first_name":"Test Firstname",
      +     "username":"Testusername"
      +  },
      +  "data": "Data from button callback",
      +  "inline_message_id": "1234csdbsk4839"
      +}
      +}' "https://YOUR.BOT.URL:YOURPORT/"
      +That's all we have for now!
    • +
    +
  • +
+
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/cdn.html b/data/core.telegram.org/cdn.html new file mode 100644 index 0000000000..2d0397674b --- /dev/null +++ b/data/core.telegram.org/cdn.html @@ -0,0 +1,210 @@ + + + + + Encrypted CDNs for Speed and Security + + + + + + + + + + + + + +
+ +
+
+
+
+

Encrypted CDNs for Speed and Security

+ +

Following the launch of version 4.2 of the official apps, Telegram client apps may be required to download popular files that were published in public channels with more than 100,000 members from secondary Content Delivery Network data centers. These CDN DCs are located in regions with significant Telegram traffic where we wouldn't want to place Telegram servers for various reasons.

+

The CDN DCs are not a part of the Telegram cloud and should be considered enemy territory. For this reason, each file that is to be sent to these CDN DCs is encrypted with a unique key using AES-256-CTR encryption. The CDN can't access the data it stores because these keys are only accessible to the main MTProto server and to the authorized client.

+
+

See also: More about CDNs and governments in the Advanced FAQ

+
+

How this works

+

When a file from a public channel with ~100,000 members becomes popular in a particular region, the Telegram server may encrypt this file with a unique AES-256-CTR key and send it to a relevant CDN DC for storage.

+

When a file is stored in a CDN DC close to the end user, the download speed will be much higher because the data needs to travel smaller distances and will likely avoid many bottlenecks that exist between regions.

+

This is secure because CDN DCs are treated the same way as internet providers / random third parties:

+
    +
  • CDN DCs don‘t have the keys to decrypt files that are stored there, so they can’t access the data even if a DC becomes compromised.
  • +
  • Encrypted files fragments are protected from tampering by their SHA-256 hash which is checked on the client upon receipt.
  • +
  • No private data is stored in or passed to the CDN DCs.
  • +
  • The server only allows media from public channels with more than 100,000 subscribers to be cached in CDN DCs (this includes media forwarded from those channels and viral media that originated from other large public channels).
  • +
+
+ +
+ +

CDNs are very limited when it comes to communication: the master data center only uploads encrypted files for storage and will accept no data from the CDN. The client apps only download encrypted files and accept no other updates. The client apps obtain the keys necessary to decrypt the file from the main Telegram server and verify the integrity of the file by its hash, which means that the CDN may only supply the correct file – anything different will be immediately discarded by the client.

+

CDN DCs do not store files on hard disks – only in memory. When a CDN server runs out of memory, a simple LRU algorithm is used to replace the least popular files with new ones.

+

How CDN DCs are different from the master DCs

+
    +
  • CDNs may not be trusted.
  • +
  • Client developers can use help.getCdnConfig to obtain a list of public RSA keys for CDN DCs, which are different from public RSA keys of the master DCs.
  • +
  • CDNs support only the following methods: upload.getCdnFile, initConnection, invokeWithLayer.
  • +
  • When working with CDNs, client developers must remember that auth_key may be deleted at any given moment (resulting in a -404 error, in which case a new key must be generated).
  • +
  • Client apps must not accept updates from CDN DCs (apps should only accept updates from their main connection to the master DC).
  • +
  • Clients must not allow the CDN DCs to substitute replies to queries sent to other DCs.
  • +
  • Clients must not send private user info that is passed in initConnection to the CDNs.
  • +
+

Getting files from a CDN

+

The API may return the upload.fileCdnRedirect constructor after an upload.getFile query. In this case, the client must request the required file from a CDN DC. The dc_id in the response is the id of the new CDN. The IP address for the connection will be available in help.getConfig, same as with the master DCs. The corresponding dcOption will have the flag cdn:flags.3?true.

+

Once a successful connection to the CDN-dc_id is established, the client must generate an auth_key (after confirming that the public RSA MTProto key of the CDN DC matches one from the list returned in help.getCdnConfig). Then the client must perform an upload.getCdnFile for each offset. For files of an unknown size it is necessary to repeat the query until an empty reply is returned.

+

upload.getCdnFile may return the upload.cdnFileReuploadNeeded constructor. In this case, the client needs to send an upload.reuploadCdnFile request to the DC that got the original upload.getFile request. Once upload.reuploadCdnFile is successfull, the app needs to request the file from the CDN DC again.

+

The main DC for a file is the DC where its main copy is stored (not to be confused with the main DC of the user) – either userProfilePhoto.dc_id, chatPhoto.dc_id, photo.dc_id, or document.dc_id.

+

Decrypting files

+

In upload.fileCdnRedirect, the server sends a decryption key and IV for the file (the fields encryption_key:bytes and encryption_iv:bytes respectively).

+

Having received a portion of encrypted data from the CDN DC inside upload.cdnFile, the client must decrypt this data using AES-256-CTR. For IV, it should use the value of encryption_iv, modified in the following manner: for each offset replace the last 4 bytes of the encryption_iv with offset / 16 in big-endian. This allows to effectively decrypt a file and to use random access to a file's content (e.g., for streaming).

+

Verifying files

+

In order to confirm that the CDN DC passed an untampered file, clients must verify hashes for each downloaded part. upload.fileCdnRedirect, upload.reuploadCdnFile and upload.getCdnFileHashes contain FileHash constructors. Each of these constructors contains the SHA-256 hash of a part of the file that starts with offset and takes limit bytes.

+

Before saving each portion of the data received from the CDN DC into the file, the client must 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.getCdnFileHashes method to obtain the missing hash.

+

Schema

+
fileHash#6242c773 offset:int limit:int hash:bytes = FileHash;
+
+upload.fileCdnRedirect#f18cda44 dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes file_hashes:Vector<FileHash> = upload.File;
+
+upload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile;
+upload.cdnFile#a99fca4f bytes:bytes = upload.CdnFile;
+
+
+dcOption#18b7a10d flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true id:int ip_address:string port:int secret:flags.10?bytes = DcOption;
+
+cdnPublicKey#c982eaba dc_id:int public_key:string = CdnPublicKey;
+
+
+cdnConfig#5725e40a public_keys:Vector<CdnPublicKey> = CdnConfig;
+
+---functions---
+
+// CDN DC
+upload.getCdnFile#2000bcc3 file_token:bytes offset:int limit:int = upload.CdnFile;
+
+// Master DC
+upload.reuploadCdnFile#9b2754a8 file_token:bytes request_token:bytes = Vector<FileHash>;
+upload.getCdnFileHashes#4da54231 file_token:bytes offset:int = Vector<FileHash>;
+
+help.getCdnConfig#52029342 = CdnConfig;
+

Restrictions on upload.getFile and upload.getCdnFile parameters

+
    +
  • offset must be divisible by 4096 bytes
  • +
  • limit must be divisible by 4096 bytes
  • +
  • 1048576 (1MB) must be divisible by limit
  • +
  • offset / (1024 * 1024) == (offset + limit - 1) / (1024 * 1024)
    (file parts that are being downloaded must always be inside the same megabyte-sized fragment)
  • +
+

Possible errors and their meanings

+ + + + + + + + + + + + + + + + + + +
upload.getCdnFileFILE_TOKEN_INVALIDThe CDN DC did not accept the file_token (e.g., the token has expired). Continue downloading the file from the master DC using upload.getFile.
upload.reuploadCdnFileFILE_TOKEN_INVALIDThe master DC did not accept the file_token (e.g., the token has expired). Continue downloading the file from the master DC using upload.getFile.
upload.reuploadCdnFileREQUEST_TOKEN_INVALIDThe master DC did not accept the request_token from the CDN DC. Continue downloading the file from the master DC using upload.getFile.
+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/cdn/faq_ir.html b/data/core.telegram.org/cdn/faq_ir.html new file mode 100644 index 0000000000..288c222a9e --- /dev/null +++ b/data/core.telegram.org/cdn/faq_ir.html @@ -0,0 +1,142 @@ + + + + + شبکه‌های تحویل محتوا (CDN) رمزنگاری شده + + + + + + + + + + + + + +
+ +
+
+
+
+

شبکه‌های تحویل محتوا (CDN) رمزنگاری شده

+ +
+ + +

از نسخهٔ ۴.۲ تلگرام ما از CDN رمزنگاری شده برای ذخیره فایل‌های کانال های عمومی با بیش از ۱۰۰٫۰۰۰ عضو پشتیبانی می‌کنیم. نقاط ذخیره سازی CDN در مناطقی در نظر گرفته شده اند که تلگرام ترافیک زیادی دارد ولی ما به دلایل مختلف تمایلی به قرارگیری سرورهای تلگرام در آن مناطق نداریم.

+
+

برای اطلاعات فنی در خصوص نحوه پیاده سازی، رمزنگاری و تایید اعتبار داده‌ها راهنمای CDN در این لینک را ببینید. همچنین برای توضیحات سیستم از طرف پاول دورُف به این پست مراجعه کنید.

+
+

سوال: چرا تصمیم به استفاده از CDN گرفتید؟

+

ما از سرور‌های توزیع شده خود برای افزایش سرعت دانلود در مناطق بدون سانسور که در آنها آزادی بیان تضمین شده‌است استفاده می‌کنیم. و حتی در آن مناطق نیز به آنها اعتماد نمی‌کنیم. اما وقتی تلگرام در مناطق دیگر به شدت محبوب می‌شود، فقط می‌توانیم روی CDNها تکیه کنیم؛ که با آنها از نقطه نظر فنی مانند سرویس‌دهنده‌‌های اینترنت (ISP) رفتار می‌کنیم و آنها فقط داده‌های رمزنگاری شده‌ای را که قادر به کشف رمز آن نیستند دریافت می‌کنند.
به لطف این فناوری، سرعت دانلود عکس‌ها و فیلم‌هایی که به صورت عمومی منتشر می‌شوند در مناطقی نظیر ترکیه، اندونزی،‌ عربستان سعودی، هند، ایران و عراق به مراتب افزایش می‌یابد، بدون اینکه کمترین خدشه‌ای به امنیت وارد شود.

+

سوال: آیا CDN می‌تواند فایل‌ها را رمزگشایی کند؟

+

خیر. هر فایلی که به مراکز داده CDN ارسال می‌شود، با یک کلید منحصر به فرد با استفاده از تکنولوژی AES-256-CTR رمزگذاری می‌شود. CDN دسترسی به اطلاعاتی که ذخیره می‌کند ندارد، چرا که این کلید‌ها تنها در سرور MTProto (سرور رمزگذاری) اصلی و دستگاه کاربر قابل دسترسی هستند.

+

سوال: آیا CDNها می‌توانند اطلاعات را با اطلاعات دلخواه خودشان جایگزین کنند؟

+

خیر. اطلاعات و داده‌های دانلود شده (دریافتی)‌ از سمت نقاط ذخیره سازی CDN همیشه از طرف Telegram بوسیله رمزنگاری hash تایید و بررسی می‌شود: بدين ترتیب هکرها یا افراد متجاوز نمی‌توانند هیچ فایلی را جایگزین کنند.

+

سوال: آيا CDN مى‌تواند هر نوع فايل را حذف كند؟

+

خير. CDNها فقط كپى‌ فايل هاى رمزنگارى شده را ذخيره مى‌كنند، فايل‌هاى اصلي در سرورهای تلگرام ذخيره مى‌شوند. كاربر تنها اعلان دريافت فايل را از طريق سرور تلگرام مى‌گيرد. اگر كه CDN فايل مورد نظر را به كاربر ارسال نكند، كاربر اين فايل را مستقيماً از سرور تلگرام دريافت خواهد كرد.

+

سوال: آيا CDN ها مى توانند برای سانسور استفاده بشوند؟

+

خير. تمامى فايل‌هاى اصلي در سرورهای تلگرام ذخيره مى‌شوند. CDN ها فقط داده هاى رمزگذاري شده را دريافت مى‌كنند و قادر نيستند آن را رمزگشايى و يا هيچ گونه داده را جايگزين كنند. اگر مشكلى پيش آيد، فايل مورد نظر مستقيما از سرور هاى تلگرام به كاربران ارسال می‌شود. كاربران هميشه داده هایشان را دريافت مى‌كنند و هيچ كس نمى‌تواند مانع آنها بشود.

+

سوال: آیا می‌توانم این موضوع را بررسی کنم؟

+

بله. همه می‌توانند روش ما برای پیاده‌سازی CDN را با بررسی کد‌های Source Code برنامه‌های تلگرام و بررسی ترافیک داده بررسی کنند.

+

سوال: آیا این شامل اطلاعات خصوصی هم می‌شود؟

+

خیر. نقاط ذخیره سازی CDN بخشی از سرور اَبری تلگرام نیستند. CDNها فقط برای ذخیره‌سازی فایل‌های پر طرفدار از کانال‌های پر بازدید استفاده می‌شوند. اطلاعات خصوصی و شخصی هرگز به آنها راه پیدا نمی‌کنند.

+

سوال: آیا این با درخواست‌های دولت‌ها برای انتقال اطلاعات خصوصی به قلمرو آن‌ها مرتبط هست؟

+

خیر. ما وارد هیچ توافق یا تفاهمی با دولت‌ها در این مورد نشده‌ایم و CDNها بخشی از هیچ معامله‌ای نیستند. این به دلیل غیر منطقی بودن قوانین محلی نیست – ما هیچ‌گاه سرورهایمان را به کشوری با سابقه سانسور اینترنتی انتقال نمی‌دهیم.

+

تنها هدف استفاده از CDNها این است که کیفیت اتصال در مناطق با تقاضای بالا، که تلگرام نمی‌تواند سرورهای خود را به آنجا منتقل کند، با روشی ایمن، افزایش یابد.

+

سوال: آیا این موضوع می‌تواند به برخی کشورها، قدرت تسلط بر تلگرام بدهد؟

+

خیر. ما احتیاط ویژه‌ای به خرج داده‌ایم تا مطمئن شویم هیچ کشوری از طریق نقاط ذخیره سازی CDN به قدرت نفوذ روی تلگرام دست نیابد:
- CDNها و نقاط آن به تلگرام تعلق نداشته و همه ریسک آن به گردن شرکت ثالثی که نقاط ذخیره سازی CDN در سراسر دنیا را برای ما تامین می‌کند خواهد بود.
- ما هیچ سرمایه‌گذاری‌ای روی این CDNها انجام نمی‌دهیم و تنها بابت ترافیک مصرفی برای انتقال موارد ذخیره شده از خوشهٔ کامپیوترهای اصلی خودمان به کاربر نهایی، هزینه پرداخت می‌کنیم.

+

در نتیجه، اگر کشوری تصمیم به دستکاری CDN در منطقه خودش بگیرد، به چیزی جز پایین آوردن کیفیت اتصال شهروندان خودشان دست نمی‌یابد – و تلگرام هیچ چیز با ارزشی را از دست نخواهد داد.

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/cdn/faq_ir/durov.html b/data/core.telegram.org/cdn/faq_ir/durov.html new file mode 100644 index 0000000000..4db4f4fe7d --- /dev/null +++ b/data/core.telegram.org/cdn/faq_ir/durov.html @@ -0,0 +1,133 @@ + + + + + توضيحات CDNهاى رمزنگارى شده + + + + + + + + + + + + + +
+ +
+
+
+
+

توضيحات CDNهاى رمزنگارى شده

+ +
+ +
+

ترجمه فارسى اين پست از كانال رسمى پاول دورُف در تلگرام در زير آمده است:

+
+

همانطور که پیشتر قول داده بودم، جزئیات بیشتری درباره اینکه چطور نقاط ذخیره سازی CDN ثالث می‌توانند سرعت دانلود محتوای عمومیِ پربازدید را در مناطقی که تلگرام تمایل به نصب سرورهای خود در آنجا ندارد، به روشی امن بالا ببرد، منتشر می‌کنم.

+ +

همانطور که مشاهده می‌کنید، نقاط ذخیره سازی CDN هیچ ارتباطی با مساله انتقال سرورهای تلگرام یا رعایت قوانین غیر منطقی محلی ندارند. CDNها صرفا ابزاری جهت ارتقا کیفیت اتصال میلیون‌ها کاربر، به روشی امن، هستند. ما با این نقاط CDN دقیقا همانطور رفتار می‌کنیم که با مراکز تامین کننده اینترنت (ISP) شما رفتار می‌کنیم. آنها صرفا مشتی دادهٔ رمزنگاری شده دریافت می‌کنند که قادر به کشف رمز آن نخواهند بود.

+

خوبی تلگرام این است که وقتی بحث امنیت مطرح می‌شود، لازم نیست صرفا روی گفته‌های من حساب کنید. هر کسی می‌تواند نحوه اجرای نقاط CDN در نسخه بروز شده تلگرام برای iOS و اندروید را بررسی کند. همچنین اگر تمایل داشته‌باشید می‌توانید نگاهی به اسناد ما در لینک فوق بیندازید، تا مطمئن شوید همه چیز امن است.

+

ما با یک تامین کننده بین‌المللی CDN همکاری می‌کنیم که با نقاط ذخیره سازی خود در سراسر دنیا به ما کمک می‌کند. اگر یک دولت محلی تصمیم به توقیف یک نقطه ذخیره سازی در مرزهای خود بگیرد، تلگرام چیزی از دست نخواهد داد؛ چرا که آن CDN جز اموال ما نیست و حتی در تئوری کوچکترین اطلاعات خصوصی تحت تاثیر این عمل قرار نخواهد گرفت. بنابراین به قوانین و دولت‌های محلی وابستگی پیدا نمی‌کنیم و هیچ ریسک حقوقی یا مالی نخواهیم داشت، اما سرعت دانلود محتوای عمومی را بطور چشمگیری افزایش می‌دهیم.

+

چنانچه، با وجود توضیحات فوق، باز هم برخی رسانه‌ها از تیتر های جنجالی مانند «تلگرام سرورهایش را به کره شمالی انتقال داد» استفاده کردند، لطفا مارا با اطلاع رسانی در مورد حقیقت ماجرا که در لینک‌های این پیام آمده است، یاری کنید. بابت مطالعه این مطلب از شما تشکر می‌کنم و مثل همیشه، در همین کانال، شما را از هر خبر بین المللی در مورد تلگرام مطلع خواهم کرد.

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/account.sentChangePhoneCode b/data/core.telegram.org/constructor/account.sentChangePhoneCode new file mode 100644 index 0000000000..5f981a22dc --- /dev/null +++ b/data/core.telegram.org/constructor/account.sentChangePhoneCode @@ -0,0 +1,161 @@ + + + + + account.sentChangePhoneCode + + + + + + + + + + + + + +
+ +
+
+
+ +

account.sentChangePhoneCode

+ + + +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/auth.sentAppCode b/data/core.telegram.org/constructor/auth.sentAppCode new file mode 100644 index 0000000000..631be2127d --- /dev/null +++ b/data/core.telegram.org/constructor/auth.sentAppCode @@ -0,0 +1,163 @@ + + + + + auth.sentAppCode + + + + + + + + + + + + + +
+ +
+
+
+ +

auth.sentAppCode

+ +

Contains info on a confirmation code message sent via Telegram.

+

You can force resending the message via SMS by invoking the method auth.sendSms.

+

+
Constructor schema is available as of layer 50. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
phone_registeredBoolThe given number corresponds to a registered Telegram user
phone_code_hashstringMessage identifier
send_call_timeoutintDelay in seconds before calling auth.sendCall
is_passwordBoolThe sent code is a text password
+

Type

+

auth.SentCode

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessage.html b/data/core.telegram.org/constructor/decryptedMessage.html new file mode 100644 index 0000000000..aef16e9a26 --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessage.html @@ -0,0 +1,217 @@ + + + + + decryptedMessage + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessage

+ +

Contents of an encrypted message.

+

+
===8===
+decryptedMessage#1f814f1f random_id:long random_bytes:bytes message:string media:DecryptedMessageMedia = DecryptedMessage;
+
+===17===
+decryptedMessage#204d3878 random_id:long ttl:int message:string media:DecryptedMessageMedia = DecryptedMessage;
+
+===45===
+decryptedMessage#36b091de flags:# random_id:long ttl:int message:string media:flags.9?DecryptedMessageMedia entities:flags.7?Vector<MessageEntity> via_bot_name:flags.11?string reply_to_random_id:flags.3?long = DecryptedMessage;
+
+===73===
+decryptedMessage#91cc4674 flags:# no_webpage:flags.1?true silent:flags.5?true random_id:long ttl:int message:string media:flags.9?DecryptedMessageMedia entities:flags.7?Vector<MessageEntity> via_bot_name:flags.11?string reply_to_random_id:flags.3?long grouped_id:flags.17?long = DecryptedMessage;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields (added in layer 45)
no_webpageflags.1?trueWhether the webpage preview is disabled
silentflags.5?trueWhether this is a silent message (no notification triggered)
random_idlongRandom message ID, assigned by the author of message.
Must be equal to the ID passed to sending method.
ttlintMessage lifetime. Has higher priority than decryptedMessageActionSetMessageTTL.
Parameter added in Layer 17.
messagestringMessage text
mediaflags.9?DecryptedMessageMediaMedia content
entitiesflags.7?Vector<MessageEntity>Message entities for styled text (parameter added in layer 45)
via_bot_nameflags.11?stringSpecifies the ID of the inline bot that generated the message (parameter added in layer 45)
reply_to_random_idflags.3?longRandom message ID of the message this message replies to (parameter added in layer 45)
grouped_idflags.17?longRandom group ID, assigned by the author of message.
Multiple encrypted messages with a photo attached and with the same group ID indicate an album or grouped media (parameter added in layer 45)
+

Type

+

DecryptedMessage

+

Related pages

+

decryptedMessageActionSetMessageTTL

+

Setting of a message lifetime after reading.

+

Upon receiving such message the client shall start deleting of all messages of an encrypted chat ttl_seconds seconds after the messages were read by user.

+

Layers

+

Below you will find information on scheme changes. For more details on the use of layers, see Invoking API methods.

+

Styled text with message entities

+

How to create styled text with message entities

+

Uploading and Downloading Files

+

How to transfer large data batches correctly.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageActionAbortKey.html b/data/core.telegram.org/constructor/decryptedMessageActionAbortKey.html new file mode 100644 index 0000000000..1ff212bf50 --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageActionAbortKey.html @@ -0,0 +1,148 @@ + + + + + decryptedMessageActionAbortKey + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageActionAbortKey

+ + + +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageActionAcceptKey.html b/data/core.telegram.org/constructor/decryptedMessageActionAcceptKey.html new file mode 100644 index 0000000000..b8e1b16c4f --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageActionAcceptKey.html @@ -0,0 +1,160 @@ + + + + + decryptedMessageActionAcceptKey + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageActionAcceptKey

+ +

Accept new key

+

+
===20===
+decryptedMessageActionAcceptKey#6fe1735b exchange_id:long g_b:bytes key_fingerprint:long = DecryptedMessageAction;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
exchange_idlongExchange ID
g_bbytesB parameter, see rekeying process
key_fingerprintlongKey fingerprint, see rekeying process
+

Type

+

DecryptedMessageAction

+

Related pages

+

Perfect Forward Secrecy

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageActionCommitKey.html b/data/core.telegram.org/constructor/decryptedMessageActionCommitKey.html new file mode 100644 index 0000000000..53b57d2e22 --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageActionCommitKey.html @@ -0,0 +1,155 @@ + + + + + decryptedMessageActionCommitKey + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageActionCommitKey

+ +

Commit new key, see rekeying process

+

+
===20===
+decryptedMessageActionCommitKey#ec2e0b9b exchange_id:long key_fingerprint:long = DecryptedMessageAction;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
exchange_idlongExchange ID, see rekeying process
key_fingerprintlongKey fingerprint, see rekeying process
+

Type

+

DecryptedMessageAction

+

Related pages

+

Perfect Forward Secrecy

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageActionDeleteMessages.html b/data/core.telegram.org/constructor/decryptedMessageActionDeleteMessages.html new file mode 100644 index 0000000000..53ebf03019 --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageActionDeleteMessages.html @@ -0,0 +1,148 @@ + + + + + decryptedMessageActionDeleteMessages + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageActionDeleteMessages

+ +

Deleted messages.

+

+
===8===
+decryptedMessageActionDeleteMessages#65614304 random_ids:Vector<long> = DecryptedMessageAction;

+

Parameters

+ + + + + + + + + + + + + + + +
NameTypeDescription
random_idsVector<long>List of deleted message IDs
+

Type

+

DecryptedMessageAction

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageActionFlushHistory.html b/data/core.telegram.org/constructor/decryptedMessageActionFlushHistory.html new file mode 100644 index 0000000000..fbd24979cf --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageActionFlushHistory.html @@ -0,0 +1,133 @@ + + + + + decryptedMessageActionFlushHistory + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageActionFlushHistory

+ + + +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageActionNoop.html b/data/core.telegram.org/constructor/decryptedMessageActionNoop.html new file mode 100644 index 0000000000..b5c513beeb --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageActionNoop.html @@ -0,0 +1,133 @@ + + + + + decryptedMessageActionNoop + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageActionNoop

+ + + +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageActionNotifyLayer.html b/data/core.telegram.org/constructor/decryptedMessageActionNotifyLayer.html new file mode 100644 index 0000000000..52b89dad0c --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageActionNotifyLayer.html @@ -0,0 +1,151 @@ + + + + + decryptedMessageActionNotifyLayer + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageActionNotifyLayer

+ +

A notification stating the API layer that is used by the client. You should use your current layer and take notice of the layer used on the other side of a conversation when sending messages.

+

+
===17===
+decryptedMessageActionNotifyLayer#f3048883 layer:int = DecryptedMessageAction;

+

Parameters

+ + + + + + + + + + + + + + + +
NameTypeDescription
layerintLayer number, must be 17 or higher (this contructor was introduced in Layer 17).
+

Type

+

DecryptedMessageAction

+

Related pages

+

Layers

+

Below you will find information on scheme changes. For more details on the use of layers, see Invoking API methods.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageActionReadMessages.html b/data/core.telegram.org/constructor/decryptedMessageActionReadMessages.html new file mode 100644 index 0000000000..3f968d0078 --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageActionReadMessages.html @@ -0,0 +1,148 @@ + + + + + decryptedMessageActionReadMessages + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageActionReadMessages

+ +

Messages marked as read.

+

+
===8===
+decryptedMessageActionReadMessages#c4f40be random_ids:Vector<long> = DecryptedMessageAction;

+

Parameters

+ + + + + + + + + + + + + + + +
NameTypeDescription
random_idsVector<long>List of message IDs
+

Type

+

DecryptedMessageAction

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageActionRequestKey.html b/data/core.telegram.org/constructor/decryptedMessageActionRequestKey.html new file mode 100644 index 0000000000..7917d5d473 --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageActionRequestKey.html @@ -0,0 +1,155 @@ + + + + + decryptedMessageActionRequestKey + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageActionRequestKey

+ +

Request rekeying, see rekeying process

+

+
===20===
+decryptedMessageActionRequestKey#f3c9611b exchange_id:long g_a:bytes = DecryptedMessageAction;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
exchange_idlongExchange ID
g_abytesg_a, see rekeying process
+

Type

+

DecryptedMessageAction

+

Related pages

+

Perfect Forward Secrecy

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageActionResend.html b/data/core.telegram.org/constructor/decryptedMessageActionResend.html new file mode 100644 index 0000000000..2fd3de2b58 --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageActionResend.html @@ -0,0 +1,155 @@ + + + + + decryptedMessageActionResend + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageActionResend

+ +

Request for the other party in a Secret Chat to automatically resend a contiguous range of previously sent messages, as explained in Sequence number is Secret Chats.

+

+
===17===
+decryptedMessageActionResend#511110b0 start_seq_no:int end_seq_no:int = DecryptedMessageAction;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
start_seq_nointout_seq_no of the first message to be resent, with correct parity
end_seq_nointout_seq_no of the last message to be resent, with same parity.
+

Type

+

DecryptedMessageAction

+

Related pages

+

Sequence numbers in Secret Chats

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageActionScreenshotMessages.html b/data/core.telegram.org/constructor/decryptedMessageActionScreenshotMessages.html new file mode 100644 index 0000000000..81ba8b7d01 --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageActionScreenshotMessages.html @@ -0,0 +1,148 @@ + + + + + decryptedMessageActionScreenshotMessages + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageActionScreenshotMessages

+ +

A screenshot was taken.

+

+
===8===
+decryptedMessageActionScreenshotMessages#8ac1f475 random_ids:Vector<long> = DecryptedMessageAction;

+

Parameters

+ + + + + + + + + + + + + + + +
NameTypeDescription
random_idsVector<long>List of affected message ids (that appeared on the screenshot)
+

Type

+

DecryptedMessageAction

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageActionSetMessageTTL.html b/data/core.telegram.org/constructor/decryptedMessageActionSetMessageTTL.html new file mode 100644 index 0000000000..cc4d6651e7 --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageActionSetMessageTTL.html @@ -0,0 +1,149 @@ + + + + + decryptedMessageActionSetMessageTTL + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageActionSetMessageTTL

+ +

Setting of a message lifetime after reading.

+

Upon receiving such message the client shall start deleting of all messages of an encrypted chat ttl_seconds seconds after the messages were read by user.

+

+
===8===
+decryptedMessageActionSetMessageTTL#a1733aec ttl_seconds:int = DecryptedMessageAction;

+

Parameters

+ + + + + + + + + + + + + + + +
NameTypeDescription
ttl_secondsintLifetime in seconds
+

Type

+

DecryptedMessageAction

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageActionTyping.html b/data/core.telegram.org/constructor/decryptedMessageActionTyping.html new file mode 100644 index 0000000000..1d23f2e882 --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageActionTyping.html @@ -0,0 +1,148 @@ + + + + + decryptedMessageActionTyping + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageActionTyping

+ +

User is preparing a message: typing, recording, uploading, etc.

+

+
===17===
+decryptedMessageActionTyping#ccb27641 action:SendMessageAction = DecryptedMessageAction;

+

Parameters

+ + + + + + + + + + + + + + + +
NameTypeDescription
actionSendMessageActionType of action
+

Type

+

DecryptedMessageAction

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageLayer.html b/data/core.telegram.org/constructor/decryptedMessageLayer.html new file mode 100644 index 0000000000..834201b2e3 --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageLayer.html @@ -0,0 +1,173 @@ + + + + + decryptedMessageLayer + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageLayer

+ +

Sets the layer number for the contents of an encrypted message.

+

+
===17===
+decryptedMessageLayer#1be31789 random_bytes:bytes layer:int in_seq_no:int out_seq_no:int message:DecryptedMessage = DecryptedMessageLayer;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
random_bytesbytesSet of random bytes to prevent content recognition in short encrypted messages.
Clients are required to check that there are at least 15 random bytes included in each message. Messages with less than 15 random bytes must be ignored.
Parameter moved here from decryptedMessage in Layer 17.
layerintLayer number. Mimimal value - 17 (the layer in which the constructor was added).
in_seq_noint2x the number of messages in the sender's inbox (including deleted and service messages), incremented by 1 if current user was not the chat creator
Parameter added in Layer 17.
out_seq_noint2x the number of messages in the recipient's inbox (including deleted and service messages), incremented by 1 if current user was the chat creator
Parameter added in Layer 17.
messageDecryptedMessageThe content of message itself
+

Type

+

DecryptedMessageLayer

+

Related pages

+

decryptedMessage

+

Contents of an encrypted message.

+

Layers

+

Below you will find information on scheme changes. For more details on the use of layers, see Invoking API methods.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageMediaAudio.html b/data/core.telegram.org/constructor/decryptedMessageMediaAudio.html new file mode 100644 index 0000000000..2231da96c7 --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageMediaAudio.html @@ -0,0 +1,174 @@ + + + + + decryptedMessageMediaAudio + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageMediaAudio

+ +

Audio file attached to a secret chat message.

+

+
===8===
+decryptedMessageMediaAudio#6080758f duration:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+
+===17===
+decryptedMessageMediaAudio#57e0a9cb duration:int mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
durationintAudio duration in seconds
mime_typestringMIME-type of the audio file
Parameter added in Layer 13.
sizeintFile size
keybytesKey to decrypt the attached media file
ivbytesInitialization vector
+

Type

+

DecryptedMessageMedia

+

Related pages

+

Layers

+

Below you will find information on scheme changes. For more details on the use of layers, see Invoking API methods.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageMediaContact.html b/data/core.telegram.org/constructor/decryptedMessageMediaContact.html new file mode 100644 index 0000000000..8d6d7eae6a --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageMediaContact.html @@ -0,0 +1,163 @@ + + + + + decryptedMessageMediaContact + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageMediaContact

+ +

Contact attached to an encrypted message.

+

+
===8===
+decryptedMessageMediaContact#588a0a97 phone_number:string first_name:string last_name:string user_id:int = DecryptedMessageMedia;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
phone_numberstringPhone number
first_namestringContact's first name
last_namestringContact's last name
user_idintTelegram User ID of signed-up contact
+

Type

+

DecryptedMessageMedia

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageMediaDocument.html b/data/core.telegram.org/constructor/decryptedMessageMediaDocument.html new file mode 100644 index 0000000000..7f35a6b824 --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageMediaDocument.html @@ -0,0 +1,191 @@ + + + + + decryptedMessageMediaDocument + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageMediaDocument

+ +

Document attached to a message in a secret chat.

+

+
===8===
+decryptedMessageMediaDocument#b095434b thumb:bytes thumb_w:int thumb_h:int file_name:string mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+
+===45===
+decryptedMessageMediaDocument#7afe8ae2 thumb:bytes thumb_w:int thumb_h:int mime_type:string size:int key:bytes iv:bytes attributes:Vector<DocumentAttribute> caption:string = DecryptedMessageMedia;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
thumbbytesThumbnail-file contents (JPEG-file, quality 55, set in a 90x90 square)
thumb_wintThumbnail width
thumb_hintThumbnail height
mime_typestringFile MIME-type
sizeintDocument size
keybytesKey to decrypt the attached document file
ivbytesInitialization
attributesVector<DocumentAttribute>Document attributes for media types
captionstringCaption
+

Type

+

DecryptedMessageMedia

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageMediaEmpty.html b/data/core.telegram.org/constructor/decryptedMessageMediaEmpty.html new file mode 100644 index 0000000000..fefe75ebcb --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageMediaEmpty.html @@ -0,0 +1,133 @@ + + + + + decryptedMessageMediaEmpty + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageMediaEmpty

+ + + +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageMediaExternalDocument.html b/data/core.telegram.org/constructor/decryptedMessageMediaExternalDocument.html new file mode 100644 index 0000000000..8a486544be --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageMediaExternalDocument.html @@ -0,0 +1,183 @@ + + + + + decryptedMessageMediaExternalDocument + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageMediaExternalDocument

+ +

Non-e2e documented forwarded from non-secret chat

+

+
===23===
+decryptedMessageMediaExternalDocument#fa95b0dd id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector<DocumentAttribute> = DecryptedMessageMedia;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
idlongDocument ID
access_hashlongaccess hash
dateintDate
mime_typestringMime type
sizeintSize
thumbPhotoSizeThumbnail
dc_idintDC ID
attributesVector<DocumentAttribute>Attributes for media types
+

Type

+

DecryptedMessageMedia

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageMediaGeoPoint.html b/data/core.telegram.org/constructor/decryptedMessageMediaGeoPoint.html new file mode 100644 index 0000000000..70b028a15d --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageMediaGeoPoint.html @@ -0,0 +1,153 @@ + + + + + decryptedMessageMediaGeoPoint + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageMediaGeoPoint

+ +

GeoPont attached to an encrypted message.

+

+
===8===
+decryptedMessageMediaGeoPoint#35480a59 lat:double long:double = DecryptedMessageMedia;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
latdoubleLatitude of point
longdoubleLongtitude of point
+

Type

+

DecryptedMessageMedia

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageMediaPhoto.html b/data/core.telegram.org/constructor/decryptedMessageMediaPhoto.html new file mode 100644 index 0000000000..bfd6167d2c --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageMediaPhoto.html @@ -0,0 +1,191 @@ + + + + + decryptedMessageMediaPhoto + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageMediaPhoto

+ +

Photo attached to an encrypted message.

+

+
===8===
+decryptedMessageMediaPhoto#32798a8c thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+
+===45===
+decryptedMessageMediaPhoto#f1fa8d78 thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes caption:string = DecryptedMessageMedia;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
thumbbytesContent of thumbnail file (JPEGfile, quality 55, set in a square 90x90)
thumb_wintThumbnail width
thumb_hintThumbnail height
wintPhoto width
hintPhoto height
sizeintSize of the photo in bytes
keybytesKey to decrypt an attached file with a full version
ivbytesInitialization vector
captionstringCaption
+

Type

+

DecryptedMessageMedia

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageMediaVenue.html b/data/core.telegram.org/constructor/decryptedMessageMediaVenue.html new file mode 100644 index 0000000000..7cfa09dbe7 --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageMediaVenue.html @@ -0,0 +1,173 @@ + + + + + decryptedMessageMediaVenue + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageMediaVenue

+ +

Venue

+

+
===45===
+decryptedMessageMediaVenue#8a0df56f lat:double long:double title:string address:string provider:string venue_id:string = DecryptedMessageMedia;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
latdoubleLatitude of venue
longdoubleLongitude of venue
titlestringVenue name
addressstringAddress
providerstringVenue provider: currently only "foursquare" needs to be supported
venue_idstringVenue ID in the provider's database
+

Type

+

DecryptedMessageMedia

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageMediaVideo.html b/data/core.telegram.org/constructor/decryptedMessageMediaVideo.html new file mode 100644 index 0000000000..56f021246f --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageMediaVideo.html @@ -0,0 +1,207 @@ + + + + + decryptedMessageMediaVideo + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageMediaVideo

+ +

Video attached to an encrypted message.

+

+
===8===
+decryptedMessageMediaVideo#4cee6ef3 thumb:bytes thumb_w:int thumb_h:int duration:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+
+===17===
+decryptedMessageMediaVideo#524a415d thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+
+===45===
+decryptedMessageMediaVideo#970c8c0e thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes caption:string = DecryptedMessageMedia;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
thumbbytesContent of thumbnail file (JPEG file, quality 55, set in a square 90x90)
thumb_wintThumbnail width
thumb_hintThumbnail height
durationintDuration of video in seconds
mime_typestringMIME-type of the video file
Parameter added in Layer 17.
wintImage width
hintImage height
sizeintFile size
keybytesKey to decrypt the attached video file
ivbytesInitialization vector
captionstringCaption
+

Type

+

DecryptedMessageMedia

+

Related pages

+

Layers

+

Below you will find information on scheme changes. For more details on the use of layers, see Invoking API methods.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageMediaWebPage.html b/data/core.telegram.org/constructor/decryptedMessageMediaWebPage.html new file mode 100644 index 0000000000..e312bd108f --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageMediaWebPage.html @@ -0,0 +1,148 @@ + + + + + decryptedMessageMediaWebPage + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageMediaWebPage

+ + + +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/decryptedMessageService.html b/data/core.telegram.org/constructor/decryptedMessageService.html new file mode 100644 index 0000000000..47ea730538 --- /dev/null +++ b/data/core.telegram.org/constructor/decryptedMessageService.html @@ -0,0 +1,156 @@ + + + + + decryptedMessageService + + + + + + + + + + + + + +
+ +
+
+
+ +

decryptedMessageService

+ +

Contents of an encrypted service message.

+

+
===8===
+decryptedMessageService#aa48327d random_id:long random_bytes:bytes action:DecryptedMessageAction = DecryptedMessage;
+
+===17===
+decryptedMessageService#73164160 random_id:long action:DecryptedMessageAction = DecryptedMessage;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
random_idlongRandom message ID, assigned by the message author.
Must be equal to the ID passed to the sending method.
actionDecryptedMessageActionAction relevant to the service message
+

Type

+

DecryptedMessage

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/disabledFeature.html b/data/core.telegram.org/constructor/disabledFeature.html new file mode 100644 index 0000000000..45f9a9498a --- /dev/null +++ b/data/core.telegram.org/constructor/disabledFeature.html @@ -0,0 +1,163 @@ + + + + + disabledFeature + + + + + + + + + + + + + +
+ +
+
+
+ +

disabledFeature

+ + + +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/fileLocation.html b/data/core.telegram.org/constructor/fileLocation.html new file mode 100644 index 0000000000..f9bf845025 --- /dev/null +++ b/data/core.telegram.org/constructor/fileLocation.html @@ -0,0 +1,182 @@ + + + + + fileLocation + + + + + + + + + + + + + +
+ +
+
+
+ +

fileLocation

+ +

File location.

+

+
Constructor schema is available as of layer 86. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
dc_idintNumber of the data center holding the file
volume_idlongServer volume
local_idintFile ID
secretlongChecksum to access the file
+

Type

+

FileLocation

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/fileLocationUnavailable.html b/data/core.telegram.org/constructor/fileLocationUnavailable.html new file mode 100644 index 0000000000..361ebf6d88 --- /dev/null +++ b/data/core.telegram.org/constructor/fileLocationUnavailable.html @@ -0,0 +1,179 @@ + + + + + fileLocationUnavailable + + + + + + + + + + + + + +
+ +
+
+
+ +

fileLocationUnavailable

+ +

File is currently unavailable.

+

+
Constructor schema is available as of layer 98. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
volume_idlongServer volume
local_idintFile ID
secretlongChecksum to access the file
+

Type

+

FileLocation

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/inputMediaUploadedThumbDocument.html b/data/core.telegram.org/constructor/inputMediaUploadedThumbDocument.html new file mode 100644 index 0000000000..39fffd0454 --- /dev/null +++ b/data/core.telegram.org/constructor/inputMediaUploadedThumbDocument.html @@ -0,0 +1,176 @@ + + + + + inputMediaUploadedThumbDocument + + + + + + + + + + + + + +
+ +
+
+
+ +

inputMediaUploadedThumbDocument

+ +

New document with a thumbnail.

+

+
Constructor schema is available as of layer 22. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fileInputFileDocument, saved in parts by using the methods upload.saveFilePart or upload.saveBigFilePart
thumbInputFileThumbnail file, saved in parts by using upload.saveFilePart
file_namestringFile name with extension
mime_typestringFile MIME-type
+

Type

+

InputMedia

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/messageMediaAudio.html b/data/core.telegram.org/constructor/messageMediaAudio.html new file mode 100644 index 0000000000..b95eaa4bff --- /dev/null +++ b/data/core.telegram.org/constructor/messageMediaAudio.html @@ -0,0 +1,147 @@ + + + + + messageMediaAudio + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/messageMediaVideo.html b/data/core.telegram.org/constructor/messageMediaVideo.html new file mode 100644 index 0000000000..29438e0667 --- /dev/null +++ b/data/core.telegram.org/constructor/messageMediaVideo.html @@ -0,0 +1,147 @@ + + + + + messageMediaVideo + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/messages.sentMessageLink b/data/core.telegram.org/constructor/messages.sentMessageLink new file mode 100644 index 0000000000..0b546e1d09 --- /dev/null +++ b/data/core.telegram.org/constructor/messages.sentMessageLink @@ -0,0 +1,167 @@ + + + + + messages.sentMessageLink + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.sentMessageLink

+ +

Info on successfully sent message and on changes links.

+

+
Constructor schema is available as of layer 24. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
idintMessage ID
dateintDate of sending
ptsintNew value of pts parameter of a current state
seqintNew value of seq parameter of a current state
linksVector<contacts.Link>List of changes links
+

Type

+

messages.SentMessage

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/messages.statedMessageLink b/data/core.telegram.org/constructor/messages.statedMessageLink new file mode 100644 index 0000000000..66b2ab9a74 --- /dev/null +++ b/data/core.telegram.org/constructor/messages.statedMessageLink @@ -0,0 +1,172 @@ + + + + + messages.statedMessageLink + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.statedMessageLink

+ +

Message with auxiliary data, state data and the list of changed links.

+

+
Constructor schema is available as of layer 24. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
messageMessageMessage
chatsVector<Chat>List of chats mentioned in message
usersVector<User>List of users mentioned in message and chats
linksVector<contacts.Link>List of changed links
ptsintNumber of events occurred in text box
seqintNumber of sent updates
+

Type

+

messages.StatedMessage

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/messages.statedMessagesLinks b/data/core.telegram.org/constructor/messages.statedMessagesLinks new file mode 100644 index 0000000000..355f29d8d4 --- /dev/null +++ b/data/core.telegram.org/constructor/messages.statedMessagesLinks @@ -0,0 +1,172 @@ + + + + + messages.statedMessagesLinks + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.statedMessagesLinks

+ +

Message with auxiliary data, state data and the list of changed links.

+

+
Constructor schema is available as of layer 24. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
messagesVector<Message>List of messages
chatsVector<Chat>List of cats mentioned in messages
usersVector<User>List of users mentioned in messages and cahts
linksVector<contacts.Link>List of changed links
ptsintNumber of event occurred in a text box
seqintNumber of sent updates
+

Type

+

messages.StatedMessages

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/payments.ValidatedRequestedInfo b/data/core.telegram.org/constructor/payments.ValidatedRequestedInfo new file mode 100644 index 0000000000..44ad5e365c --- /dev/null +++ b/data/core.telegram.org/constructor/payments.ValidatedRequestedInfo @@ -0,0 +1,145 @@ + + + + + payments.ValidatedRequestedInfo + + + + + + + + + + + + + +
+ +
+
+
+ +

payments.ValidatedRequestedInfo

+ +

Validated user-provided info

+

{scheme}

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
idflags.0?stringID
shipping_optionsflags.1?Vector<ShippingOption>Shipping options
+

Type

+

payments.ValidatedRequestedInfo

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/updateChannelParticipant.html b/data/core.telegram.org/constructor/updateChannelParticipant.html new file mode 100644 index 0000000000..7b0a3bd8b2 --- /dev/null +++ b/data/core.telegram.org/constructor/updateChannelParticipant.html @@ -0,0 +1,182 @@ + + + + + updateChannelParticipant + + + + + + + + + + + + + +
+ +
+
+
+ +

updateChannelParticipant

+ +

A participant has left, joined, was banned or admined in a channel or supergroup.

+

+
Constructor schema is available as of layer 124. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
channel_idintChannel ID
dateintDate of the event
user_idintUser in question
prev_participantflags.0?ChannelParticipantPrevious participant status
new_participantflags.1?ChannelParticipantNew participant status
qtsintPTS
+

Type

+

Update

+

Related pages

+

Working with Updates

+

How to subscribe to updates and handle them properly.

+

Channels

+

How to handle channels, supergroups, groups, and what's the difference between them.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/updateUserBlocked.html b/data/core.telegram.org/constructor/updateUserBlocked.html new file mode 100644 index 0000000000..613249be7d --- /dev/null +++ b/data/core.telegram.org/constructor/updateUserBlocked.html @@ -0,0 +1,159 @@ + + + + + updateUserBlocked + + + + + + + + + + + + + +
+ +
+
+
+ +

updateUserBlocked

+ +

User was added to the blacklist (method contacts.block) or removed from the blacklist (method contacts.unblock).

+

+
Constructor schema is available as of layer 119. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user_idintUser id
blockedBool(boolTrue) if the the user is blocked
+

Type

+

Update

+

Related pages

+

boolTrue

+

The constructor can be interpreted as a booleantrue value.

+

contacts.block

+

Adds the user to the blacklist.

+

contacts.unblock

+

Deletes the user from the blacklist.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/userForeign.html b/data/core.telegram.org/constructor/userForeign.html new file mode 100644 index 0000000000..e080eac64b --- /dev/null +++ b/data/core.telegram.org/constructor/userForeign.html @@ -0,0 +1,177 @@ + + + + + userForeign + + + + + + + + + + + + + +
+ +
+
+
+ +

userForeign

+ +

A user that is not a contact of the current user.

+

+
Constructor schema is available as of layer 18. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
idintUser identifier
first_namestringFirst name as supplied by the user
last_namestringLast name as supplied by the user
access_hashlongChecksum dependent on the user identifier
photoUserProfilePhotoProfile photo
statusUserStatusCurrent status
usernamestringUsername
Parameter added in Layer 18.
+

Type

+

User

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/userRequest.html b/data/core.telegram.org/constructor/userRequest.html new file mode 100644 index 0000000000..970414f6c4 --- /dev/null +++ b/data/core.telegram.org/constructor/userRequest.html @@ -0,0 +1,182 @@ + + + + + userRequest + + + + + + + + + + + + + +
+ +
+
+
+ +

userRequest

+ +

A user that is not a contact of the current user, but whose phone number is available.

+

+
Constructor schema is available as of layer 18. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
idintUser identifier
first_namestringFirst name the user supplied
last_namestringLast name the user supplied
access_hashlongChecksum dependent on the user identifier
phonestringPhone number
photoUserProfilePhotoProfile photo
statusUserStatusCurrent status
usernamestringUsername
Parameter added in Layer 18.
+

Type

+

User

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/wallPaperSolid.html b/data/core.telegram.org/constructor/wallPaperSolid.html new file mode 100644 index 0000000000..e7f3679044 --- /dev/null +++ b/data/core.telegram.org/constructor/wallPaperSolid.html @@ -0,0 +1,162 @@ + + + + + wallPaperSolid + + + + + + + + + + + + + +
+ +
+
+
+ +

wallPaperSolid

+ +

One-color background wallpaper (no image).

+

+
Constructor schema is available as of layer 93. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
idintIdentifier
titlestringName
bg_colorintBackground color (RGB)
colorintBasic background color (RGB)
+

Type

+

WallPaper

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/contest300K.html b/data/core.telegram.org/contest300K.html new file mode 100644 index 0000000000..d88b5642be --- /dev/null +++ b/data/core.telegram.org/contest300K.html @@ -0,0 +1,237 @@ + + + + + Telegram Cracking Contest Description + + + + + + + + + + + + + +
+ +
+
+
+
+

Telegram Cracking Contest Description

+ +

« Back to Contest Announcement

+
+

The current round of the contest is over. Go to results »

+
+

In this contest you assume the role of a malicious entity in control of Telegram's servers. Your goal is to extract sensitive data (a secret email and password) from a conversation between two peers — Paul and Nick. They are represented by two virtual users that communicate via Secret Chats in Telegram.

+

Paul and Nick are both using clients that perform all the checks from Telegram Security Guidelines and compare their key visualizations over an independent channel as soon as a new Secret Chat is established. If any of these checks fails, they stop accepting messages in that Secret Chat. You control the entire process by sending commands to the Telegram user @CryptoContest, used as an interface for this contest. This enables contestants to try CPA, KPA, MITM and other kinds of active attacks and data tampering.

+

Protocol

+

The protocol used by Paul and Nick to establish Secret Сhats and exchange messages is identical to the one used for Secret Chats in Telegram. Since we assume that the attacker is already in full control of the Telegram servers, basic MTProto encryption is bypassed altogether. In order to further simplify the task for contestants, we have removed irrelevant parameters, such as user_id and random_id.

+

The following TL scheme is used to establish Secret Chats in this contest:

+
contest.dhConfig#01e00a51 g:int p:64*[int] random:64*[int] = contest.DhConfig;
+contest.requestEncryption#3a73a74c g_a:64*[int] = contest.Message;
+contest.acceptEncryption#068e4342 g_b:64*[int] fingerprint:int = contest.Message;
+contest.encryptedMessage#11a6d4b1 id:long message:string = contest.Message;
+---functions---
+contest.getDhConfig#369ee1a6 = contest.DhConfig;
+

For exchange of encrypted messages (see documentation), the up-to-date layer 17 scheme with sequence numbers is used, but with plain text message support only.

+

Each plaintext message is first created as a layer 17 decryptedMessage, then embedded in a decryptedMessageLayer and encrypted as explained in the Secret Chat documentation. For the purpose of this contest, it is the result of this encryption (ciphertext) that is exchanged between the parties.

+

Notice that sending messages in an actual Telegram Secret Chat involves further embedding of that ciphertext into an API call and an additional layer of MTProto encryption for client-server interaction. This step is omitted here, since we assume the attacker to be in control of the Telegram servers, not just of the communication lines between the clients and Telegram servers.

+

Interface

+

To access the interface, find the Telegram user @CryptoContest using the Global Search by username in any of the Telegram apps. This is a special bot we created for this contest. You can control communication between Paul and Nick by sending particularly formed text messages to this bot and processing automatically generated answers to these messages (you may find the unofficial Linux CLI convenient for mass automated queries).

+

You can create as many parallel Secret Chats between Paul and Nick as you like using the bot — each of them will have a separate session_id. All data is represented in hexadecimal format, with the exception of the session_id.

+

Commands

+

Below, A stands for the creator of the Secret Chat, B stands for the second party, S — the Telegram Server.

+

Each Secret Chat session in this contest is divided in two phases:

+ +
1. Creating a Secret Chat
+

In order to create a new Secret Chat, six messages need to be exchanged:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SourceDestinationMessage
AScontest.getDhConfig
SAcontest.DhConfig
ABcontest.requestEncryption
BScontest.getDhConfig
SBcontest.DhConfig
BAcontest.acceptEncryption
+

To create a Secret Chat in this contest:

+
    +
  • Send the START command to the user @CryptoContest in Telegram. You'll get the getDhConfig query, sent by A to the Server, and the answer that the server would normally send to A. You shall also receive the new session_id as the first 32-bit integer. All further messages related to this particular session (Secret Chat instance) must be prefixed with this session_id in decimal form.
  • +
  • After that, use the PASS command to pass the server's answer to A or ANSWER bytes to send a different answer instead. Bytes is represented by a string of an even number of hexadecimal digits. You'll receive the requestEncryption query as the result.
  • +
  • After that, use the PASS command to pass this query to B or ANSWER bytes to arbitrarily change it. You‘ll receive B’s getDhConfig to the server as the result.
  • +
  • As before, you can use either PASS or ANSWER bytes. You'll receive acceptEncryption as the result.
  • +
  • As before, you can use either PASS or ANSWER bytes. You'll receive “Ok” as the result.
  • +
+

You will receive an error text as the result after any of these steps in case the participating clients perceive that something went wrong. This can happen if a security check is failed, or in the case that the first 128 bits of the SHA-1 of the newly created encryption key don‘t match on both parties’ clients when this stage is completed (this corresponds to Paul and Nick comparing the key visualizations for the Secret Chat in their Telegram apps).

+

If you obtain such an error, the session is failed and can no longer be used. You'll have to start new session. Note that the time to complete this phase is limited. Each step should not take longer than one hour, otherwise the Secret Chat will get cancelled.

+

Example:

+
START
+15 a6e19e36 510ae00103000000c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b202d33053c2340fd84dd024e8012277e9c6442ad7cd09fe85955c13196e2d32861ad0d8f8139ce5870f1c3563fbff77428632897352abd91cd0a6497a0f64a33d87cd8b53470cf1bc6a052bba7d0121623e9611c0de83ffeb63b7d15831a70187093373cb20df5613bdfab12a54bbc6fff94598d95a8dcdb1374631b021e77c350261bca9ffc16c59b19d3041bee011a20b06fc9806d633b6b9cdd79cbb8b02fe8ef9dde29b6d31d80b030c69d67d6fc4a7edb33ffab532d085796cf3e7635fd42ee72ea24840082186fd40c3c45cf0acef886533d4de7468f88942a662d302928470aa8704529180a6aec2f877398efb91893cc9b549e5123d7269adfe7b6ee
+15 PASS
+15 4ca7733a1a7823b420111d8e86e3fe9a7cff9fc611ce339d6999fc3053973ef6c8276af841b53547fdebdcb057cbad16aff6178be3fb8747889937dec082c984227c974a19232b85ad85ef457521fcf17d5f697a17b7e62952306f0ed086deb1ebcff0c8a32787789fe7afaa4035c2d0e07c10db46c0df6930a1729d3607fb035154e90c02036318862c5a9537e87a55bc656e3fc53db08f41a07f834e4917ebaaace1214409ffb44c5a806a9cb4def209bfb8ab2e59f1cb6257e422f37dfab288170bdc5666e6a63d1b0447a7b935ad3bdac8d53f64278d433b45925c84dc60214473363d57a30e31324d9b3cc42fb56d375aac2d9d1af16331ad3a92b43a9d64e47813
+15 PASS
+15 a6e19e36 510ae00103000000c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b1ccd9c752428f0bca9ac9060bb85b8f90acb9374cd8d5a03110635f591a18f131cb7cc204407efec0687a8b77ba6c4e6732c35174e79e36aaa7fa6ab685257710e074065961ce1b16d21fed8a83cd95efcc4be7111cd33b5704fe759dfab21fc3e8aaa86d44609dc0b073354f8160c653f4fbde3ae7c28c87c3667e0797fac24b32e5c1a870cd898b2a9c517709bb0b8e4ee875ff857868eb56548e6dc993f198fd78c8a77cf997ed42a15f99a9b6265c7cf9bedc7580a11514047b881f717b233f3570ec21856bd2b9791e4c43b125e9260ac3fd48b9a10de5f9d5080e53d92d194adb796766684d905cca35e691fab0c76d6b5f49242f81eb92fcc8adc5a64
+15 ANSWER 510ae00103000000c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b1ccd9c752428f0bca9ac9060bb85b8f90acb9374cd8d5a03110635f591a18f131cb7cc204407efec0687a8b77ba6c4e6732c35174e79e36aaa7fa6ab685257710e074065961ce1b16d21fed8a83cd95efcc4be7111cd33b5704fe759dfab21fc3e8aaa86d44609dc0b073354f8160c653f4fbde3ae7c28c87c3667e0797fac24b32e5c1a870cd898b2a9c517709bb0b8e4ee875ff857868eb56548e6dc993f198fd78c8a77cf997ed42a15f99a9b6265c7cf9bedc7580a11514047b881f717b233f3570ec21856bd2b9791e4c43b125e9260ac3fd48b9a10de5f9d5080e53d92d194adb796766684d905cca35e691fab0c76d6b5f49242f81eb92fcc8ad00000
+15 42438e06bbb424bba5fd95122ec2f206c9b502f1f6d4e4fdbf74ed2c946ad60abaefd6fbd6a08e3ef418709d15bc557ef5e486a51d1e304f6c1e943faad948fde4e6273c0cad0df07068ad028fb01dc0fd7221aeed6ed5dc510dbe4824939036b0f3a45e740b40cef86a32f0b73b20234efc41d573f3e14efc08b3f65e9f7be52d5b930de52d41c7aadc4e0e85dfcf3bb1dd2e9cdf94fc236082879aea27207415cb846a5d5969e619040416a7f0f708f56a5b340a8fd0be1a26bfdc3de365a950532d363b427d6d905af7534af574ae8afd3f47658de5da3fa02dd818a31523122ff53dd31ffd7aa22e53cbf2da7772a1589e9a242f28f9cb1130f54553fcb355b3398fc877b80b3ef2cc3d
+15 PASS
+15 Ok
+
2. Sending Text Messages
+

Once the Secret Chat has been established, you can use the following queries to make Paul and Nick exchange text messages inside the Secret Chat:

+
    +
  • ASK [A|B] — asks A or B to send a random plaintext message to the other party. It is guaranteed that at least one of the first ten generated messages will contain the secret email and password that are the goal of this contest. It is also guaranteed that apart from that, all messages will contain only dictionary English words, spaces, line breaks and punctuation marks. The result to this query is the ciphertext corresponding to the randomly generated plaintext.
  • +
  • TXT [A|B] bytes — asks A or B to encrypt bytes as the (plaintext) contents of a text message and send it to the other party. Note that bytes can be any byte sequence, not necessarily a valid UTF-8 sequence. The result to this query is the ciphertext corresponding to the given plaintext.
  • +
  • MSG [A|B] bytes — send a specified (ciphertext) message (for example, obtained as an answer to an ASK or TXT query) to A or B. You will receive ‘Ok’ if this message was decrypted successfully and accepted by the client, or ‘Fail’ otherwise.
  • +
+

Example:

+
15 ASK A
+15 b1d4a6119278722b0309a8c1fee80000c877b80b3ef2cc3dc92104de4322d8ae374fbf38758091fe4c86bafffa792f7eb37d8431cf8f868319c3af005791b7c55f788e260b8fa6a96b6808d0d448abfdb49913160c5355ef2d4e439a676055e42de6b26dd7d0e06e3fb48981208449658aff63fd8262ef0669f8bb242ade401e1190d2f54f3896ac17c1b796cbe185d5b0166649d5bac25e4626c08c78527458fc7877ee2add14a8e7b1f9b56651b8264284aa2fd28de55f96bcec8075dd43bbc69f6c05c2428795e51a081e3995e4ede72d190d55d0b30d8215bf4ed13fde7c8f578993050280ec4a940e910eb182bd335e52e2a699d9b5
+15 MSG B b1d4a6119278722b0309a8c1fee80000c877b80b3ef2cc3dc92104de4322d8ae374fbf38758091fe4c86bafffa792f7eb37d8431cf8f868319c3af005791b7c55f788e260b8fa6a96b6808d0d448abfdb49913160c5355ef2d4e439a676055e42de6b26dd7d0e06e3fb48981208449658aff63fd8262ef0669f8bb242ade401e1190d2f54f3896ac17c1b796cbe185d5b0166649d5bac25e4626c08c78527458fc7877ee2add14a8e7b1f9b56651b8264284aa2fd28de55f96bcec8075dd43bbc69f6c05c2428795e51a081e3995e4ede72d190d55d0b30d8215bf4ed13fde7c8f578993050280ec4a940e910eb182bd335e52e2a699d9b0
+15 Fail
+15 MSG B b1d4a6119278722b0309a8c1fee80000c877b80b3ef2cc3dc92104de4322d8ae374fbf38758091fe4c86bafffa792f7eb37d8431cf8f868319c3af005791b7c55f788e260b8fa6a96b6808d0d448abfdb49913160c5355ef2d4e439a676055e42de6b26dd7d0e06e3fb48981208449658aff63fd8262ef0669f8bb242ade401e1190d2f54f3896ac17c1b796cbe185d5b0166649d5bac25e4626c08c78527458fc7877ee2add14a8e7b1f9b56651b8264284aa2fd28de55f96bcec8075dd43bbc69f6c05c2428795e51a081e3995e4ede72d190d55d0b30d8215bf4ed13fde7c8f578993050280ec4a940e910eb182bd335e52e2a699d9b5
+15 Ok
+15 TXT B abac
+15 b1d4a61101771d42f62323e6fe680000c877b80b3ef2cc3df751e68b935b083a6f5c15ba8d95b94388fc34453a1e7b9b20222402b7698be5dd8a6ff69a5141b01ca2488b0dada8f2b0e47980218f48912168ddd2cebd3b61b1edf2f557c7ec44768595ce1cb42a01f7c14dd4e6e6e7601cb17ab0b6d5a274
+
+

Objectives

+

We are offering a $300,000 reward to the first person to break Telegram's encryption protocol in this contest.

+

Your goal is to extract a secret email address from one of the random messages that are exchanged between Nick and Paul when you use the ASK command. It is guaranteed that at least one of the first ten generated messages within a session will contain the secret address. It is also guaranteed that apart from that, all messages will contain only dictionary English words, spaces, line breaks and punctuation marks.

+

Once you have the address, you will need to send an email to it. That email must contain:
- The entire text of the message that contained the secret email.
- Session logs for the successful attempt with your user_id.
- A detailed explanation of the attack on the protocol.
- Your bank account details to receive the $300,000 prize.

+

Decrypting messages

+

To prove that the competition was fair, we will add a command that returns the keys used for a particular session by its session_id at the end of the contest. This will be done as soon as a winner is announced, or on February 4, 2015 in case no winner is announced to that date.

+

Bonus objective

+

We are also offering an independent $100,000 reward to the first person to make the bot accept a ciphertext message (i.e. the first person to send a message using MSG [A|B] bytes and receive the result ‘OK’), provided that that ciphertext deciphers to a plaintext that was never encrypted by the bot itself within this session.

+

Should you succeed at this, kindly send an email to security@telegram.org and include the following:
- Session logs for the successful attempt with your user_id.
- A detailed explanation of the attack on the protocol.
- Your bank account details to receive the $100,000 prize.

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/contestfaq.html b/data/core.telegram.org/contestfaq.html new file mode 100644 index 0000000000..daadde049f --- /dev/null +++ b/data/core.telegram.org/contestfaq.html @@ -0,0 +1,152 @@ + + + + + Security Contest Winter 2013-2014 FAQ + + + + + + + + + + + + + +
+ +
+
+
+
+ +
+ +
+

Security Contest Winter 2013-2014 FAQ

+ +
+

This contest has ended. Check out our new contest »

+
+

Q: Why did you launch this contest?

+

The goal of this contest is to solve a real-life problem. The question at hand is whether your internet-provider or another entity that intercepts your traffic would be able to decrypt your conversations over Telegram. We are inviting hackers and security experts to find ways of decrypting Telegram traffic. As a result we will either find a vulnerability in our encryption algorithm and fix it, or or get indirect evidence that decrypting our traffic is no easy task.

+

Q: What happens if someone wins?

+

If we have a winner in the current competition, we will start a new competition with an even larger prize. Of course, before launching a new competition we will have to fix the vulnerability that allowed the winner to decipher the traffic of Telegram.

+

Q: What do I have access to?

+

You have access to a detailed description of the encryption system we use, app source code, as well as complete traffic logs for the target ‘Paul’ (+79112317383) from the day he signed up for Telegram, updated in real time.

+

You need to decipher the secret email address, that Paul sends daily in one of the messages to ‘Nick’ (+79218944725), and describe the successful attack in an email to that address.

+

Q: What is the structure of your traffic log?

+

The structure of the traffic log is as follows:

+
    Unixtime Length-in-bytes Direction (in/out) ServerIP:Port Hexdump.
+

For your convenience, only high-level TCP stream bytes are shown, ignoring IP packet boundaries and omitting TCP/IP headers.

+

Q: Does Paul send the same message to Nick every day?

+

No, just as in real life, Paul‘s messages to Nick can be different each time. The only thing that doesn’t change is the secret email address in his daily messages.

+

Q: Could you provide an example of a Paul's message to Nick?

+

Sure. The message may look like “Hey Nick, so here is the secret email address for the bounty hunters – {here goes the email}”.

+

Q: I want to try active attacks in the current contest, how can I do that?

+

At this stage, it is possible to analyze the traffic and send modified packets to the server, therefore perfoming length extension attacks, replay attacks etc. In case nobody achieves the goal of the current contest (deciphering intercepted Telegram traffic) by March 2014, we are willing to facilitate the task and provide the contestants with tools for performing more complicated active attacks.

+

Q: What if I don‘t trust bitcoins and don’t want them as a prize?

+

If the winner prefers conventional money over bitcoin, we will be happy to transfer them 200,000 regular USD instead of BTC.

+

Q: It is only 2,5 months. I need more time to find bugs in your protocol!

+

The contests to crack Telegram's encrypted protocol are a permanent feature of our project. We will always be launching a new contest after the end of the previous one, and the amount of the prize money is likely to increase. So whenever you are the first person to find vulnerabilities in our encryption system, you will be able to claim a prize — even after the current competition is over.

+
+ +
+ +

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/css/bootstrap-extra.css b/data/core.telegram.org/css/bootstrap-extra.css new file mode 100644 index 0000000000..8a35b6069b --- /dev/null +++ b/data/core.telegram.org/css/bootstrap-extra.css @@ -0,0 +1,3274 @@ +/* glyph */ +@font-face { + font-family: 'Glyphicons Halflings'; + src: url('../fonts/glyphicons-halflings-regular.eot'); + src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); +} +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.glyphicon-asterisk:before { + content: "\2a"; +} +.glyphicon-plus:before { + content: "\2b"; +} +.glyphicon-euro:before { + content: "\20ac"; +} +.glyphicon-minus:before { + content: "\2212"; +} +.glyphicon-cloud:before { + content: "\2601"; +} +.glyphicon-envelope:before { + content: "\2709"; +} +.glyphicon-pencil:before { + content: "\270f"; +} +.glyphicon-glass:before { + content: "\e001"; +} +.glyphicon-music:before { + content: "\e002"; +} +.glyphicon-search:before { + content: "\e003"; +} +.glyphicon-heart:before { + content: "\e005"; +} +.glyphicon-star:before { + content: "\e006"; +} +.glyphicon-star-empty:before { + content: "\e007"; +} +.glyphicon-user:before { + content: "\e008"; +} +.glyphicon-film:before { + content: "\e009"; +} +.glyphicon-th-large:before { + content: "\e010"; +} +.glyphicon-th:before { + content: "\e011"; +} +.glyphicon-th-list:before { + content: "\e012"; +} +.glyphicon-ok:before { + content: "\e013"; +} +.glyphicon-remove:before { + content: "\e014"; +} +.glyphicon-zoom-in:before { + content: "\e015"; +} +.glyphicon-zoom-out:before { + content: "\e016"; +} +.glyphicon-off:before { + content: "\e017"; +} +.glyphicon-signal:before { + content: "\e018"; +} +.glyphicon-cog:before { + content: "\e019"; +} +.glyphicon-trash:before { + content: "\e020"; +} +.glyphicon-home:before { + content: "\e021"; +} +.glyphicon-file:before { + content: "\e022"; +} +.glyphicon-time:before { + content: "\e023"; +} +.glyphicon-road:before { + content: "\e024"; +} +.glyphicon-download-alt:before { + content: "\e025"; +} +.glyphicon-download:before { + content: "\e026"; +} +.glyphicon-upload:before { + content: "\e027"; +} +.glyphicon-inbox:before { + content: "\e028"; +} +.glyphicon-play-circle:before { + content: "\e029"; +} +.glyphicon-repeat:before { + content: "\e030"; +} +.glyphicon-refresh:before { + content: "\e031"; +} +.glyphicon-list-alt:before { + content: "\e032"; +} +.glyphicon-lock:before { + content: "\e033"; +} +.glyphicon-flag:before { + content: "\e034"; +} +.glyphicon-headphones:before { + content: "\e035"; +} +.glyphicon-volume-off:before { + content: "\e036"; +} +.glyphicon-volume-down:before { + content: "\e037"; +} +.glyphicon-volume-up:before { + content: "\e038"; +} +.glyphicon-qrcode:before { + content: "\e039"; +} +.glyphicon-barcode:before { + content: "\e040"; +} +.glyphicon-tag:before { + content: "\e041"; +} +.glyphicon-tags:before { + content: "\e042"; +} +.glyphicon-book:before { + content: "\e043"; +} +.glyphicon-bookmark:before { + content: "\e044"; +} +.glyphicon-print:before { + content: "\e045"; +} +.glyphicon-camera:before { + content: "\e046"; +} +.glyphicon-font:before { + content: "\e047"; +} +.glyphicon-bold:before { + content: "\e048"; +} +.glyphicon-italic:before { + content: "\e049"; +} +.glyphicon-text-height:before { + content: "\e050"; +} +.glyphicon-text-width:before { + content: "\e051"; +} +.glyphicon-align-left:before { + content: "\e052"; +} +.glyphicon-align-center:before { + content: "\e053"; +} +.glyphicon-align-right:before { + content: "\e054"; +} +.glyphicon-align-justify:before { + content: "\e055"; +} +.glyphicon-list:before { + content: "\e056"; +} +.glyphicon-indent-left:before { + content: "\e057"; +} +.glyphicon-indent-right:before { + content: "\e058"; +} +.glyphicon-facetime-video:before { + content: "\e059"; +} +.glyphicon-picture:before { + content: "\e060"; +} +.glyphicon-map-marker:before { + content: "\e062"; +} +.glyphicon-adjust:before { + content: "\e063"; +} +.glyphicon-tint:before { + content: "\e064"; +} +.glyphicon-edit:before { + content: "\e065"; +} +.glyphicon-share:before { + content: "\e066"; +} +.glyphicon-check:before { + content: "\e067"; +} +.glyphicon-move:before { + content: "\e068"; +} +.glyphicon-step-backward:before { + content: "\e069"; +} +.glyphicon-fast-backward:before { + content: "\e070"; +} +.glyphicon-backward:before { + content: "\e071"; +} +.glyphicon-play:before { + content: "\e072"; +} +.glyphicon-pause:before { + content: "\e073"; +} +.glyphicon-stop:before { + content: "\e074"; +} +.glyphicon-forward:before { + content: "\e075"; +} +.glyphicon-fast-forward:before { + content: "\e076"; +} +.glyphicon-step-forward:before { + content: "\e077"; +} +.glyphicon-eject:before { + content: "\e078"; +} +.glyphicon-chevron-left:before { + content: "\e079"; +} +.glyphicon-chevron-right:before { + content: "\e080"; +} +.glyphicon-plus-sign:before { + content: "\e081"; +} +.glyphicon-minus-sign:before { + content: "\e082"; +} +.glyphicon-remove-sign:before { + content: "\e083"; +} +.glyphicon-ok-sign:before { + content: "\e084"; +} +.glyphicon-question-sign:before { + content: "\e085"; +} +.glyphicon-info-sign:before { + content: "\e086"; +} +.glyphicon-screenshot:before { + content: "\e087"; +} +.glyphicon-remove-circle:before { + content: "\e088"; +} +.glyphicon-ok-circle:before { + content: "\e089"; +} +.glyphicon-ban-circle:before { + content: "\e090"; +} +.glyphicon-arrow-left:before { + content: "\e091"; +} +.glyphicon-arrow-right:before { + content: "\e092"; +} +.glyphicon-arrow-up:before { + content: "\e093"; +} +.glyphicon-arrow-down:before { + content: "\e094"; +} +.glyphicon-share-alt:before { + content: "\e095"; +} +.glyphicon-resize-full:before { + content: "\e096"; +} +.glyphicon-resize-small:before { + content: "\e097"; +} +.glyphicon-exclamation-sign:before { + content: "\e101"; +} +.glyphicon-gift:before { + content: "\e102"; +} +.glyphicon-leaf:before { + content: "\e103"; +} +.glyphicon-fire:before { + content: "\e104"; +} +.glyphicon-eye-open:before { + content: "\e105"; +} +.glyphicon-eye-close:before { + content: "\e106"; +} +.glyphicon-warning-sign:before { + content: "\e107"; +} +.glyphicon-plane:before { + content: "\e108"; +} +.glyphicon-calendar:before { + content: "\e109"; +} +.glyphicon-random:before { + content: "\e110"; +} +.glyphicon-comment:before { + content: "\e111"; +} +.glyphicon-magnet:before { + content: "\e112"; +} +.glyphicon-chevron-up:before { + content: "\e113"; +} +.glyphicon-chevron-down:before { + content: "\e114"; +} +.glyphicon-retweet:before { + content: "\e115"; +} +.glyphicon-shopping-cart:before { + content: "\e116"; +} +.glyphicon-folder-close:before { + content: "\e117"; +} +.glyphicon-folder-open:before { + content: "\e118"; +} +.glyphicon-resize-vertical:before { + content: "\e119"; +} +.glyphicon-resize-horizontal:before { + content: "\e120"; +} +.glyphicon-hdd:before { + content: "\e121"; +} +.glyphicon-bullhorn:before { + content: "\e122"; +} +.glyphicon-bell:before { + content: "\e123"; +} +.glyphicon-certificate:before { + content: "\e124"; +} +.glyphicon-thumbs-up:before { + content: "\e125"; +} +.glyphicon-thumbs-down:before { + content: "\e126"; +} +.glyphicon-hand-right:before { + content: "\e127"; +} +.glyphicon-hand-left:before { + content: "\e128"; +} +.glyphicon-hand-up:before { + content: "\e129"; +} +.glyphicon-hand-down:before { + content: "\e130"; +} +.glyphicon-circle-arrow-right:before { + content: "\e131"; +} +.glyphicon-circle-arrow-left:before { + content: "\e132"; +} +.glyphicon-circle-arrow-up:before { + content: "\e133"; +} +.glyphicon-circle-arrow-down:before { + content: "\e134"; +} +.glyphicon-globe:before { + content: "\e135"; +} +.glyphicon-wrench:before { + content: "\e136"; +} +.glyphicon-tasks:before { + content: "\e137"; +} +.glyphicon-filter:before { + content: "\e138"; +} +.glyphicon-briefcase:before { + content: "\e139"; +} +.glyphicon-fullscreen:before { + content: "\e140"; +} +.glyphicon-dashboard:before { + content: "\e141"; +} +.glyphicon-paperclip:before { + content: "\e142"; +} +.glyphicon-heart-empty:before { + content: "\e143"; +} +.glyphicon-link:before { + content: "\e144"; +} +.glyphicon-phone:before { + content: "\e145"; +} +.glyphicon-pushpin:before { + content: "\e146"; +} +.glyphicon-usd:before { + content: "\e148"; +} +.glyphicon-gbp:before { + content: "\e149"; +} +.glyphicon-sort:before { + content: "\e150"; +} +.glyphicon-sort-by-alphabet:before { + content: "\e151"; +} +.glyphicon-sort-by-alphabet-alt:before { + content: "\e152"; +} +.glyphicon-sort-by-order:before { + content: "\e153"; +} +.glyphicon-sort-by-order-alt:before { + content: "\e154"; +} +.glyphicon-sort-by-attributes:before { + content: "\e155"; +} +.glyphicon-sort-by-attributes-alt:before { + content: "\e156"; +} +.glyphicon-unchecked:before { + content: "\e157"; +} +.glyphicon-expand:before { + content: "\e158"; +} +.glyphicon-collapse-down:before { + content: "\e159"; +} +.glyphicon-collapse-up:before { + content: "\e160"; +} +.glyphicon-log-in:before { + content: "\e161"; +} +.glyphicon-flash:before { + content: "\e162"; +} +.glyphicon-log-out:before { + content: "\e163"; +} +.glyphicon-new-window:before { + content: "\e164"; +} +.glyphicon-record:before { + content: "\e165"; +} +.glyphicon-save:before { + content: "\e166"; +} +.glyphicon-open:before { + content: "\e167"; +} +.glyphicon-saved:before { + content: "\e168"; +} +.glyphicon-import:before { + content: "\e169"; +} +.glyphicon-export:before { + content: "\e170"; +} +.glyphicon-send:before { + content: "\e171"; +} +.glyphicon-floppy-disk:before { + content: "\e172"; +} +.glyphicon-floppy-saved:before { + content: "\e173"; +} +.glyphicon-floppy-remove:before { + content: "\e174"; +} +.glyphicon-floppy-save:before { + content: "\e175"; +} +.glyphicon-floppy-open:before { + content: "\e176"; +} +.glyphicon-credit-card:before { + content: "\e177"; +} +.glyphicon-transfer:before { + content: "\e178"; +} +.glyphicon-cutlery:before { + content: "\e179"; +} +.glyphicon-header:before { + content: "\e180"; +} +.glyphicon-compressed:before { + content: "\e181"; +} +.glyphicon-earphone:before { + content: "\e182"; +} +.glyphicon-phone-alt:before { + content: "\e183"; +} +.glyphicon-tower:before { + content: "\e184"; +} +.glyphicon-stats:before { + content: "\e185"; +} +.glyphicon-sd-video:before { + content: "\e186"; +} +.glyphicon-hd-video:before { + content: "\e187"; +} +.glyphicon-subtitles:before { + content: "\e188"; +} +.glyphicon-sound-stereo:before { + content: "\e189"; +} +.glyphicon-sound-dolby:before { + content: "\e190"; +} +.glyphicon-sound-5-1:before { + content: "\e191"; +} +.glyphicon-sound-6-1:before { + content: "\e192"; +} +.glyphicon-sound-7-1:before { + content: "\e193"; +} +.glyphicon-copyright-mark:before { + content: "\e194"; +} +.glyphicon-registration-mark:before { + content: "\e195"; +} +.glyphicon-cloud-download:before { + content: "\e197"; +} +.glyphicon-cloud-upload:before { + content: "\e198"; +} +.glyphicon-tree-conifer:before { + content: "\e199"; +} +.glyphicon-tree-deciduous:before { + content: "\e200"; +} + + +/*btn*/ +.btn { + display: inline-block; + margin-bottom: 0; + font-weight: normal; + text-align: center; + vertical-align: middle; + cursor: pointer; + background-image: none; + border: 1px solid transparent; + white-space: nowrap; + padding: 6px 12px; + font-size: 12px; + line-height: 1.42857143; + border-radius: 4px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.btn:focus, +.btn:active:focus, +.btn.active:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn:hover, +.btn:focus { + color: #333333; + text-decoration: none; +} +.btn:active, +.btn.active { + outline: 0; + background-image: none; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn.disabled, +.btn[disabled], +fieldset[disabled] .btn { + cursor: not-allowed; + pointer-events: none; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-default { + color: #333333; + background-color: #ffffff; + border-color: #cccccc; +} +.btn-default:hover, +.btn-default:focus, +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + color: #333333; + background-color: #e6e6e6; + border-color: #adadad; +} +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + background-image: none; +} +.btn-default.disabled, +.btn-default[disabled], +fieldset[disabled] .btn-default, +.btn-default.disabled:hover, +.btn-default[disabled]:hover, +fieldset[disabled] .btn-default:hover, +.btn-default.disabled:focus, +.btn-default[disabled]:focus, +fieldset[disabled] .btn-default:focus, +.btn-default.disabled:active, +.btn-default[disabled]:active, +fieldset[disabled] .btn-default:active, +.btn-default.disabled.active, +.btn-default[disabled].active, +fieldset[disabled] .btn-default.active { + background-color: #ffffff; + border-color: #cccccc; +} +.btn-default .badge { + color: #ffffff; + background-color: #333333; +} +.btn-primary { + color: #ffffff; + background-color: #428bca; + border-color: #357ebd; +} +.btn-primary:hover, +.btn-primary:focus, +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + color: #ffffff; + background-color: #3071a9; + border-color: #285e8e; +} +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + background-image: none; +} +.btn-primary.disabled, +.btn-primary[disabled], +fieldset[disabled] .btn-primary, +.btn-primary.disabled:hover, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary:hover, +.btn-primary.disabled:focus, +.btn-primary[disabled]:focus, +fieldset[disabled] .btn-primary:focus, +.btn-primary.disabled:active, +.btn-primary[disabled]:active, +fieldset[disabled] .btn-primary:active, +.btn-primary.disabled.active, +.btn-primary[disabled].active, +fieldset[disabled] .btn-primary.active { + background-color: #428bca; + border-color: #357ebd; +} +.btn-primary .badge { + color: #428bca; + background-color: #ffffff; +} +.btn-success { + color: #ffffff; + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success:hover, +.btn-success:focus, +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + color: #ffffff; + background-color: #449d44; + border-color: #398439; +} +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + background-image: none; +} +.btn-success.disabled, +.btn-success[disabled], +fieldset[disabled] .btn-success, +.btn-success.disabled:hover, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success:hover, +.btn-success.disabled:focus, +.btn-success[disabled]:focus, +fieldset[disabled] .btn-success:focus, +.btn-success.disabled:active, +.btn-success[disabled]:active, +fieldset[disabled] .btn-success:active, +.btn-success.disabled.active, +.btn-success[disabled].active, +fieldset[disabled] .btn-success.active { + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success .badge { + color: #5cb85c; + background-color: #ffffff; +} +.btn-info { + color: #ffffff; + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info:hover, +.btn-info:focus, +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + color: #ffffff; + background-color: #31b0d5; + border-color: #269abc; +} +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + background-image: none; +} +.btn-info.disabled, +.btn-info[disabled], +fieldset[disabled] .btn-info, +.btn-info.disabled:hover, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info:hover, +.btn-info.disabled:focus, +.btn-info[disabled]:focus, +fieldset[disabled] .btn-info:focus, +.btn-info.disabled:active, +.btn-info[disabled]:active, +fieldset[disabled] .btn-info:active, +.btn-info.disabled.active, +.btn-info[disabled].active, +fieldset[disabled] .btn-info.active { + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info .badge { + color: #5bc0de; + background-color: #ffffff; +} +.btn-warning { + color: #ffffff; + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning:hover, +.btn-warning:focus, +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + color: #ffffff; + background-color: #ec971f; + border-color: #d58512; +} +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + background-image: none; +} +.btn-warning.disabled, +.btn-warning[disabled], +fieldset[disabled] .btn-warning, +.btn-warning.disabled:hover, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning:hover, +.btn-warning.disabled:focus, +.btn-warning[disabled]:focus, +fieldset[disabled] .btn-warning:focus, +.btn-warning.disabled:active, +.btn-warning[disabled]:active, +fieldset[disabled] .btn-warning:active, +.btn-warning.disabled.active, +.btn-warning[disabled].active, +fieldset[disabled] .btn-warning.active { + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning .badge { + color: #f0ad4e; + background-color: #ffffff; +} +.btn-danger { + color: #ffffff; + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger:hover, +.btn-danger:focus, +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + color: #ffffff; + background-color: #c9302c; + border-color: #ac2925; +} +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + background-image: none; +} +.btn-danger.disabled, +.btn-danger[disabled], +fieldset[disabled] .btn-danger, +.btn-danger.disabled:hover, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger:hover, +.btn-danger.disabled:focus, +.btn-danger[disabled]:focus, +fieldset[disabled] .btn-danger:focus, +.btn-danger.disabled:active, +.btn-danger[disabled]:active, +fieldset[disabled] .btn-danger:active, +.btn-danger.disabled.active, +.btn-danger[disabled].active, +fieldset[disabled] .btn-danger.active { + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger .badge { + color: #d9534f; + background-color: #ffffff; +} +.btn-link { + color: #0088cc; + font-weight: normal; + cursor: pointer; + border-radius: 0; +} +.btn-link, +.btn-link:active, +.btn-link[disabled], +fieldset[disabled] .btn-link { + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-link, +.btn-link:hover, +.btn-link:focus, +.btn-link:active { + border-color: transparent; +} +.btn-link:hover, +.btn-link:focus { + color: #0088cc; + text-decoration: underline; + background-color: transparent; +} +.btn-link[disabled]:hover, +fieldset[disabled] .btn-link:hover, +.btn-link[disabled]:focus, +fieldset[disabled] .btn-link:focus { + color: #777777; + text-decoration: none; +} +.btn-lg { + padding: 10px 16px; + font-size: 15px; + line-height: 1.33; + border-radius: 6px; +} +.btn-sm { + padding: 5px 10px; + font-size: 11px; + line-height: 1.5; + border-radius: 3px; +} +.btn-xs { + padding: 1px 5px; + font-size: 11px; + line-height: 1.5; + border-radius: 3px; +} +.btn-block { + display: block; + width: 100%; +} +.btn-block + .btn-block { + margin-top: 5px; +} +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} + +.img-responsive { + display: block; + width: 100% \9; + max-width: 100%; + height: auto; +} +.img-rounded { + border-radius: 6px; +} +.img-thumbnail { + padding: 4px; + line-height: 1.42857143; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 0; + -webkit-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + display: inline-block; + width: 100% \9; + max-width: 100%; + height: auto; +} +.img-circle { + border-radius: 50%; +} + + + +.row { + margin-left: -15px; + margin-right: -15px; +} +.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { + position: relative; + min-height: 1px; + padding-left: 15px; + padding-right: 15px; +} +.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { + float: left; +} +.col-xs-12 { + width: 100%; +} +.col-xs-11 { + width: 91.66666667%; +} +.col-xs-10 { + width: 83.33333333%; +} +.col-xs-9 { + width: 75%; +} +.col-xs-8 { + width: 66.66666667%; +} +.col-xs-7 { + width: 58.33333333%; +} +.col-xs-6 { + width: 50%; +} +.col-xs-5 { + width: 41.66666667%; +} +.col-xs-4 { + width: 33.33333333%; +} +.col-xs-3 { + width: 25%; +} +.col-xs-2 { + width: 16.66666667%; +} +.col-xs-1 { + width: 8.33333333%; +} +.col-xs-pull-12 { + right: 100%; +} +.col-xs-pull-11 { + right: 91.66666667%; +} +.col-xs-pull-10 { + right: 83.33333333%; +} +.col-xs-pull-9 { + right: 75%; +} +.col-xs-pull-8 { + right: 66.66666667%; +} +.col-xs-pull-7 { + right: 58.33333333%; +} +.col-xs-pull-6 { + right: 50%; +} +.col-xs-pull-5 { + right: 41.66666667%; +} +.col-xs-pull-4 { + right: 33.33333333%; +} +.col-xs-pull-3 { + right: 25%; +} +.col-xs-pull-2 { + right: 16.66666667%; +} +.col-xs-pull-1 { + right: 8.33333333%; +} +.col-xs-pull-0 { + right: auto; +} +.col-xs-push-12 { + left: 100%; +} +.col-xs-push-11 { + left: 91.66666667%; +} +.col-xs-push-10 { + left: 83.33333333%; +} +.col-xs-push-9 { + left: 75%; +} +.col-xs-push-8 { + left: 66.66666667%; +} +.col-xs-push-7 { + left: 58.33333333%; +} +.col-xs-push-6 { + left: 50%; +} +.col-xs-push-5 { + left: 41.66666667%; +} +.col-xs-push-4 { + left: 33.33333333%; +} +.col-xs-push-3 { + left: 25%; +} +.col-xs-push-2 { + left: 16.66666667%; +} +.col-xs-push-1 { + left: 8.33333333%; +} +.col-xs-push-0 { + left: auto; +} +.col-xs-offset-12 { + margin-left: 100%; +} +.col-xs-offset-11 { + margin-left: 91.66666667%; +} +.col-xs-offset-10 { + margin-left: 83.33333333%; +} +.col-xs-offset-9 { + margin-left: 75%; +} +.col-xs-offset-8 { + margin-left: 66.66666667%; +} +.col-xs-offset-7 { + margin-left: 58.33333333%; +} +.col-xs-offset-6 { + margin-left: 50%; +} +.col-xs-offset-5 { + margin-left: 41.66666667%; +} +.col-xs-offset-4 { + margin-left: 33.33333333%; +} +.col-xs-offset-3 { + margin-left: 25%; +} +.col-xs-offset-2 { + margin-left: 16.66666667%; +} +.col-xs-offset-1 { + margin-left: 8.33333333%; +} +.col-xs-offset-0 { + margin-left: 0%; +} +@media (min-width: 768px) { + .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { + float: left; + } + .col-sm-12 { + width: 100%; + } + .col-sm-11 { + width: 91.66666667%; + } + .col-sm-10 { + width: 83.33333333%; + } + .col-sm-9 { + width: 75%; + } + .col-sm-8 { + width: 66.66666667%; + } + .col-sm-7 { + width: 58.33333333%; + } + .col-sm-6 { + width: 50%; + } + .col-sm-5 { + width: 41.66666667%; + } + .col-sm-4 { + width: 33.33333333%; + } + .col-sm-3 { + width: 25%; + } + .col-sm-2 { + width: 16.66666667%; + } + .col-sm-1 { + width: 8.33333333%; + } + .col-sm-pull-12 { + right: 100%; + } + .col-sm-pull-11 { + right: 91.66666667%; + } + .col-sm-pull-10 { + right: 83.33333333%; + } + .col-sm-pull-9 { + right: 75%; + } + .col-sm-pull-8 { + right: 66.66666667%; + } + .col-sm-pull-7 { + right: 58.33333333%; + } + .col-sm-pull-6 { + right: 50%; + } + .col-sm-pull-5 { + right: 41.66666667%; + } + .col-sm-pull-4 { + right: 33.33333333%; + } + .col-sm-pull-3 { + right: 25%; + } + .col-sm-pull-2 { + right: 16.66666667%; + } + .col-sm-pull-1 { + right: 8.33333333%; + } + .col-sm-pull-0 { + right: auto; + } + .col-sm-push-12 { + left: 100%; + } + .col-sm-push-11 { + left: 91.66666667%; + } + .col-sm-push-10 { + left: 83.33333333%; + } + .col-sm-push-9 { + left: 75%; + } + .col-sm-push-8 { + left: 66.66666667%; + } + .col-sm-push-7 { + left: 58.33333333%; + } + .col-sm-push-6 { + left: 50%; + } + .col-sm-push-5 { + left: 41.66666667%; + } + .col-sm-push-4 { + left: 33.33333333%; + } + .col-sm-push-3 { + left: 25%; + } + .col-sm-push-2 { + left: 16.66666667%; + } + .col-sm-push-1 { + left: 8.33333333%; + } + .col-sm-push-0 { + left: auto; + } + .col-sm-offset-12 { + margin-left: 100%; + } + .col-sm-offset-11 { + margin-left: 91.66666667%; + } + .col-sm-offset-10 { + margin-left: 83.33333333%; + } + .col-sm-offset-9 { + margin-left: 75%; + } + .col-sm-offset-8 { + margin-left: 66.66666667%; + } + .col-sm-offset-7 { + margin-left: 58.33333333%; + } + .col-sm-offset-6 { + margin-left: 50%; + } + .col-sm-offset-5 { + margin-left: 41.66666667%; + } + .col-sm-offset-4 { + margin-left: 33.33333333%; + } + .col-sm-offset-3 { + margin-left: 25%; + } + .col-sm-offset-2 { + margin-left: 16.66666667%; + } + .col-sm-offset-1 { + margin-left: 8.33333333%; + } + .col-sm-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 992px) { + .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { + float: left; + } + .col-md-12 { + width: 100%; + } + .col-md-11 { + width: 91.66666667%; + } + .col-md-10 { + width: 83.33333333%; + } + .col-md-9 { + width: 75%; + } + .col-md-8 { + width: 66.66666667%; + } + .col-md-7 { + width: 58.33333333%; + } + .col-md-6 { + width: 50%; + } + .col-md-5 { + width: 41.66666667%; + } + .col-md-4 { + width: 33.33333333%; + } + .col-md-3 { + width: 25%; + } + .col-md-2 { + width: 16.66666667%; + } + .col-md-1 { + width: 8.33333333%; + } + .col-md-pull-12 { + right: 100%; + } + .col-md-pull-11 { + right: 91.66666667%; + } + .col-md-pull-10 { + right: 83.33333333%; + } + .col-md-pull-9 { + right: 75%; + } + .col-md-pull-8 { + right: 66.66666667%; + } + .col-md-pull-7 { + right: 58.33333333%; + } + .col-md-pull-6 { + right: 50%; + } + .col-md-pull-5 { + right: 41.66666667%; + } + .col-md-pull-4 { + right: 33.33333333%; + } + .col-md-pull-3 { + right: 25%; + } + .col-md-pull-2 { + right: 16.66666667%; + } + .col-md-pull-1 { + right: 8.33333333%; + } + .col-md-pull-0 { + right: auto; + } + .col-md-push-12 { + left: 100%; + } + .col-md-push-11 { + left: 91.66666667%; + } + .col-md-push-10 { + left: 83.33333333%; + } + .col-md-push-9 { + left: 75%; + } + .col-md-push-8 { + left: 66.66666667%; + } + .col-md-push-7 { + left: 58.33333333%; + } + .col-md-push-6 { + left: 50%; + } + .col-md-push-5 { + left: 41.66666667%; + } + .col-md-push-4 { + left: 33.33333333%; + } + .col-md-push-3 { + left: 25%; + } + .col-md-push-2 { + left: 16.66666667%; + } + .col-md-push-1 { + left: 8.33333333%; + } + .col-md-push-0 { + left: auto; + } + .col-md-offset-12 { + margin-left: 100%; + } + .col-md-offset-11 { + margin-left: 91.66666667%; + } + .col-md-offset-10 { + margin-left: 83.33333333%; + } + .col-md-offset-9 { + margin-left: 75%; + } + .col-md-offset-8 { + margin-left: 66.66666667%; + } + .col-md-offset-7 { + margin-left: 58.33333333%; + } + .col-md-offset-6 { + margin-left: 50%; + } + .col-md-offset-5 { + margin-left: 41.66666667%; + } + .col-md-offset-4 { + margin-left: 33.33333333%; + } + .col-md-offset-3 { + margin-left: 25%; + } + .col-md-offset-2 { + margin-left: 16.66666667%; + } + .col-md-offset-1 { + margin-left: 8.33333333%; + } + .col-md-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 1200px) { + .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { + float: left; + } + .col-lg-12 { + width: 100%; + } + .col-lg-11 { + width: 91.66666667%; + } + .col-lg-10 { + width: 83.33333333%; + } + .col-lg-9 { + width: 75%; + } + .col-lg-8 { + width: 66.66666667%; + } + .col-lg-7 { + width: 58.33333333%; + } + .col-lg-6 { + width: 50%; + } + .col-lg-5 { + width: 41.66666667%; + } + .col-lg-4 { + width: 33.33333333%; + } + .col-lg-3 { + width: 25%; + } + .col-lg-2 { + width: 16.66666667%; + } + .col-lg-1 { + width: 8.33333333%; + } + .col-lg-pull-12 { + right: 100%; + } + .col-lg-pull-11 { + right: 91.66666667%; + } + .col-lg-pull-10 { + right: 83.33333333%; + } + .col-lg-pull-9 { + right: 75%; + } + .col-lg-pull-8 { + right: 66.66666667%; + } + .col-lg-pull-7 { + right: 58.33333333%; + } + .col-lg-pull-6 { + right: 50%; + } + .col-lg-pull-5 { + right: 41.66666667%; + } + .col-lg-pull-4 { + right: 33.33333333%; + } + .col-lg-pull-3 { + right: 25%; + } + .col-lg-pull-2 { + right: 16.66666667%; + } + .col-lg-pull-1 { + right: 8.33333333%; + } + .col-lg-pull-0 { + right: auto; + } + .col-lg-push-12 { + left: 100%; + } + .col-lg-push-11 { + left: 91.66666667%; + } + .col-lg-push-10 { + left: 83.33333333%; + } + .col-lg-push-9 { + left: 75%; + } + .col-lg-push-8 { + left: 66.66666667%; + } + .col-lg-push-7 { + left: 58.33333333%; + } + .col-lg-push-6 { + left: 50%; + } + .col-lg-push-5 { + left: 41.66666667%; + } + .col-lg-push-4 { + left: 33.33333333%; + } + .col-lg-push-3 { + left: 25%; + } + .col-lg-push-2 { + left: 16.66666667%; + } + .col-lg-push-1 { + left: 8.33333333%; + } + .col-lg-push-0 { + left: auto; + } + .col-lg-offset-12 { + margin-left: 100%; + } + .col-lg-offset-11 { + margin-left: 91.66666667%; + } + .col-lg-offset-10 { + margin-left: 83.33333333%; + } + .col-lg-offset-9 { + margin-left: 75%; + } + .col-lg-offset-8 { + margin-left: 66.66666667%; + } + .col-lg-offset-7 { + margin-left: 58.33333333%; + } + .col-lg-offset-6 { + margin-left: 50%; + } + .col-lg-offset-5 { + margin-left: 41.66666667%; + } + .col-lg-offset-4 { + margin-left: 33.33333333%; + } + .col-lg-offset-3 { + margin-left: 25%; + } + .col-lg-offset-2 { + margin-left: 16.66666667%; + } + .col-lg-offset-1 { + margin-left: 8.33333333%; + } + .col-lg-offset-0 { + margin-left: 0%; + } +} + + + + +.form-control { + display: block; + width: 100%; + height: 31px; + padding: 6px 12px; + font-size: 12px; + line-height: 1.42857143; + color: #555555; + background-color: #ffffff; + background-image: none; + border: 1px solid #cccccc; + border-radius: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.form-control:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); +} +.form-control::-moz-placeholder { + color: #777777; + opacity: 1; +} +.form-control:-ms-input-placeholder { + color: #777777; +} +.form-control::-webkit-input-placeholder { + color: #777777; +} +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + cursor: not-allowed; + background-color: #eeeeee; + opacity: 1; +} +textarea.form-control { + height: auto; +} +input[type="search"] { + -webkit-appearance: none; +} +input[type="date"], +input[type="time"], +input[type="datetime-local"], +input[type="month"] { + line-height: 31px; + line-height: 1.42857143 \0; +} +input[type="date"].input-sm, +input[type="time"].input-sm, +input[type="datetime-local"].input-sm, +input[type="month"].input-sm { + line-height: 28px; +} +input[type="date"].input-lg, +input[type="time"].input-lg, +input[type="datetime-local"].input-lg, +input[type="month"].input-lg { + line-height: 42px; +} +.form-group { + margin-bottom: 15px; +} +.radio, +.checkbox { + position: relative; + display: block; + min-height: 17px; + margin-top: 10px; + margin-bottom: 10px; +} +.radio label, +.checkbox label { + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + cursor: pointer; +} +.radio input[type="radio"], +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { + position: absolute; + margin-left: -20px; + margin-top: 4px \9; +} +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; +} +.radio-inline, +.checkbox-inline { + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + vertical-align: middle; + font-weight: normal; + cursor: pointer; +} +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { + margin-top: 0; + margin-left: 10px; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"].disabled, +input[type="checkbox"].disabled, +fieldset[disabled] input[type="radio"], +fieldset[disabled] input[type="checkbox"] { + cursor: not-allowed; +} +.radio-inline.disabled, +.checkbox-inline.disabled, +fieldset[disabled] .radio-inline, +fieldset[disabled] .checkbox-inline { + cursor: not-allowed; +} +.radio.disabled label, +.checkbox.disabled label, +fieldset[disabled] .radio label, +fieldset[disabled] .checkbox label { + cursor: not-allowed; +} +.form-control-static { + padding-top: 7px; + padding-bottom: 7px; + margin-bottom: 0; +} +.form-control-static.input-lg, +.form-control-static.input-sm { + padding-left: 0; + padding-right: 0; +} +.input-sm, +.form-horizontal .form-group-sm .form-control { + height: 28px; + padding: 5px 10px; + font-size: 11px; + line-height: 1.5; + border-radius: 3px; +} +select.input-sm { + height: 28px; + line-height: 28px; +} +textarea.input-sm, +select[multiple].input-sm { + height: auto; +} +.input-lg, +.form-horizontal .form-group-lg .form-control { + height: 42px; + padding: 10px 16px; + font-size: 15px; + line-height: 1.33; + border-radius: 6px; +} +select.input-lg { + height: 42px; + line-height: 42px; +} +textarea.input-lg, +select[multiple].input-lg { + height: auto; +} +.has-feedback { + position: relative; +} +.has-feedback .form-control { + padding-right: 38.75px; +} +.form-control-feedback { + position: absolute; + top: 22px; + right: 0; + z-index: 2; + display: block; + width: 31px; + height: 31px; + line-height: 31px; + text-align: center; +} +.input-lg + .form-control-feedback { + width: 42px; + height: 42px; + line-height: 42px; +} +.input-sm + .form-control-feedback { + width: 28px; + height: 28px; + line-height: 28px; +} +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline { + color: #3c763d; +} +.has-success .form-control { + border-color: #3c763d; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-success .form-control:focus { + border-color: #2b542c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; +} +.has-success .input-group-addon { + color: #3c763d; + border-color: #3c763d; + background-color: #dff0d8; +} +.has-success .form-control-feedback { + color: #3c763d; +} +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline { + color: #8a6d3b; +} +.has-warning .form-control { + border-color: #8a6d3b; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-warning .form-control:focus { + border-color: #66512c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; +} +.has-warning .input-group-addon { + color: #8a6d3b; + border-color: #8a6d3b; + background-color: #fcf8e3; +} +.has-warning .form-control-feedback { + color: #8a6d3b; +} +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline { + color: #a94442; +} +.has-error .form-control { + border-color: #a94442; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-error .form-control:focus { + border-color: #843534; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; +} +.has-error .input-group-addon { + color: #a94442; + border-color: #a94442; + background-color: #f2dede; +} +.has-error .form-control-feedback { + color: #a94442; +} +.has-feedback label.sr-only ~ .form-control-feedback { + top: 0; +} +.help-block { + display: block; + margin-top: 5px; + margin-bottom: 10px; + color: #737373; +} +@media (min-width: 768px) { + .form-inline .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .form-inline .input-group { + display: inline-table; + vertical-align: middle; + } + .form-inline .input-group .input-group-addon, + .form-inline .input-group .input-group-btn, + .form-inline .input-group .form-control { + width: auto; + } + .form-inline .input-group > .form-control { + width: 100%; + } + .form-inline .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio, + .form-inline .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio label, + .form-inline .checkbox label { + padding-left: 0; + } + .form-inline .radio input[type="radio"], + .form-inline .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .form-inline .has-feedback .form-control-feedback { + top: 0; + } +} +.form-horizontal .radio, +.form-horizontal .checkbox, +.form-horizontal .radio-inline, +.form-horizontal .checkbox-inline { + margin-top: 0; + margin-bottom: 0; + padding-top: 7px; +} +.form-horizontal .radio, +.form-horizontal .checkbox { + min-height: 24px; +} +.form-horizontal .form-group { + margin-left: -15px; + margin-right: -15px; +} +@media (min-width: 768px) { + .form-horizontal .control-label { + text-align: right; + margin-bottom: 0; + padding-top: 7px; + } +} +.form-horizontal .has-feedback .form-control-feedback { + top: 0; + right: 15px; +} +@media (min-width: 768px) { + .form-horizontal .form-group-lg .control-label { + padding-top: 14.3px; + } +} +@media (min-width: 768px) { + .form-horizontal .form-group-sm .control-label { + padding-top: 6px; + } +} + +.tooltip { + position: absolute; + z-index: 1070; + display: block; + visibility: visible; + font-size: 11px; + line-height: 1.4; + opacity: 0; + filter: alpha(opacity=0); +} +.tooltip.in { + opacity: 0.9; + filter: alpha(opacity=90); +} +.tooltip.top { + margin-top: -3px; + padding: 5px 0; +} +.tooltip.right { + margin-left: 3px; + padding: 0 5px; +} +.tooltip.bottom { + margin-top: 3px; + padding: 5px 0; +} +.tooltip.left { + margin-left: -3px; + padding: 0 5px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.top-left .tooltip-arrow { + bottom: 0; + left: 5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.top-right .tooltip-arrow { + bottom: 0; + right: 5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.tooltip.bottom-left .tooltip-arrow { + top: 0; + left: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.tooltip.bottom-right .tooltip-arrow { + top: 0; + right: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} + +.modal-open { + overflow: hidden; +} +.modal { + display: none; + overflow: hidden; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1050; + -webkit-overflow-scrolling: touch; + outline: 0; +} +.modal.fade .modal-dialog { + -webkit-transform: translate3d(0, -25%, 0); + transform: translate3d(0, -25%, 0); + -webkit-transition: -webkit-transform 0.3s ease-out; + -moz-transition: -moz-transform 0.3s ease-out; + -o-transition: -o-transform 0.3s ease-out; + transition: transform 0.3s ease-out; +} +.modal.in .modal-dialog { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; +} +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} +.modal-content { + position: relative; + background-color: #ffffff; + border: 1px solid #999999; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + background-clip: padding-box; + outline: 0; +} +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000000; +} +.modal-backdrop.fade { + opacity: 0; + filter: alpha(opacity=0); +} +.modal-backdrop.in { + opacity: 0.5; + filter: alpha(opacity=50); +} +.modal-header { + padding: 15px; + border-bottom: 1px solid #e5e5e5; + min-height: 16.42857143px; +} +.modal-header .close { + margin-top: -2px; +} +.modal-title { + margin: 0; + line-height: 1.42857143; +} +.modal-body { + position: relative; + padding: 15px; +} +.modal-footer { + padding: 15px; + text-align: right; + border-top: 1px solid #e5e5e5; +} +.modal-footer .btn + .btn { + margin-left: 5px; + margin-bottom: 0; +} +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + .modal-content { + -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + } + .modal-sm { + width: 300px; + } +} +@media (min-width: 992px) { + .modal-lg { + width: 900px; + } +} + +.modal-footer:before, +.modal-footer:after { + content: " "; + display: table; +} +.navbar-collapse:after, +.modal-footer:after { + clear: both; +} + + +.alert { + padding: 15px; + margin-bottom: 17px; + border: 1px solid transparent; + border-radius: 0; +} +.alert h4 { + margin-top: 0; + color: inherit; +} +.alert .alert-link { + font-weight: bold; +} +.alert > p, +.alert > ul { + margin-bottom: 0; +} +.alert > p + p { + margin-top: 5px; +} +.alert-dismissable, +.alert-dismissible { + padding-right: 35px; +} +.alert-dismissable .close, +.alert-dismissible .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; +} +.alert-success { + background-color: #dff0d8; + border-color: #d6e9c6; + color: #3c763d; +} +.alert-success hr { + border-top-color: #c9e2b3; +} +.alert-success .alert-link { + color: #2b542c; +} +.alert-info { + background-color: #d9edf7; + border-color: #bce8f1; + color: #31708f; +} +.alert-info hr { + border-top-color: #a6e1ec; +} +.alert-info .alert-link { + color: #245269; +} +.alert-warning { + background-color: #fcf8e3; + border-color: #faebcc; + color: #8a6d3b; +} +.alert-warning hr { + border-top-color: #f7e1b5; +} +.alert-warning .alert-link { + color: #66512c; +} +.alert-danger { + background-color: #f2dede; + border-color: #ebccd1; + color: #a94442; +} +.alert-danger hr { + border-top-color: #e4b9c0; +} + +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} +.well-lg { + padding: 24px; + border-radius: 6px; +} +.well-sm { + padding: 9px; + border-radius: 3px; +} +.close { + float: right; + font-size: 18px; + font-weight: bold; + line-height: 1; + color: #000000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} +.close:hover, +.close:focus { + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.5; + filter: alpha(opacity=50); +} +button.close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} + + +/* Manually added pager */ +.pagination { + display: inline-block; + padding-left: 0; + margin: 20px 0; + border-radius: 4px; +} +.pagination > li { + display: inline; +} +.pagination > li > a, +.pagination > li > span { + position: relative; + float: left; + padding: 6px 12px; + line-height: 1.42857143; + text-decoration: none; + color: #337ab7; + background-color: #ffffff; + border: 1px solid #dddddd; + margin-left: -1px; +} +.pagination > li:first-child > a, +.pagination > li:first-child > span { + margin-left: 0; + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} +.pagination > li:last-child > a, +.pagination > li:last-child > span { + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; +} +.pagination > li > a:hover, +.pagination > li > span:hover, +.pagination > li > a:focus, +.pagination > li > span:focus { + z-index: 2; + color: #23527c; + background-color: #eeeeee; + border-color: #dddddd; +} +.pagination > .active > a, +.pagination > .active > span, +.pagination > .active > a:hover, +.pagination > .active > span:hover, +.pagination > .active > a:focus, +.pagination > .active > span:focus { + z-index: 3; + color: #ffffff; + background-color: #337ab7; + border-color: #337ab7; + cursor: default; +} +.pagination > .disabled > span, +.pagination > .disabled > span:hover, +.pagination > .disabled > span:focus, +.pagination > .disabled > a, +.pagination > .disabled > a:hover, +.pagination > .disabled > a:focus { + color: #777777; + background-color: #ffffff; + border-color: #dddddd; + cursor: not-allowed; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; +} +.pagination-lg > li:first-child > a, +.pagination-lg > li:first-child > span { + border-bottom-left-radius: 6px; + border-top-left-radius: 6px; +} +.pagination-lg > li:last-child > a, +.pagination-lg > li:last-child > span { + border-bottom-right-radius: 6px; + border-top-right-radius: 6px; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; +} +.pagination-sm > li:first-child > a, +.pagination-sm > li:first-child > span { + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; +} +.pagination-sm > li:last-child > a, +.pagination-sm > li:last-child > span { + border-bottom-right-radius: 3px; + border-top-right-radius: 3px; +} +.pager { + padding-left: 0; + margin: 20px 0; + list-style: none; + text-align: center; +} +.pager li { + display: inline; +} +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 15px; +} +.pager li > a:hover, +.pager li > a:focus { + text-decoration: none; + background-color: #eeeeee; +} +.pager .next > a, +.pager .next > span { + float: right; +} +.pager .previous > a, +.pager .previous > span { + float: left; +} +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > a:focus, +.pager .disabled > span { + color: #777777; + background-color: #ffffff; + cursor: not-allowed; +} +.pager:before, +.pager:after { + content: " "; + display: table; +} +.pager:after { + clear: both; +} + +/* List and panel */ +.list-group { + margin-bottom: 20px; + padding-left: 0; +} +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #ffffff; + border: 1px solid #dddddd; +} +.list-group-item:first-child { + border-top-right-radius: 4px; + border-top-left-radius: 4px; +} +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +a.list-group-item, +button.list-group-item { + color: #555555; +} +a.list-group-item .list-group-item-heading, +button.list-group-item .list-group-item-heading { + color: #333333; +} +a.list-group-item:hover, +button.list-group-item:hover, +a.list-group-item:focus, +button.list-group-item:focus { + text-decoration: none; + color: #555555; + background-color: #f5f5f5; +} +button.list-group-item { + width: 100%; + text-align: left; +} +.list-group-item.disabled, +.list-group-item.disabled:hover, +.list-group-item.disabled:focus { + background-color: #eeeeee; + color: #777777; + cursor: not-allowed; +} +.list-group-item.disabled .list-group-item-heading, +.list-group-item.disabled:hover .list-group-item-heading, +.list-group-item.disabled:focus .list-group-item-heading { + color: inherit; +} +.list-group-item.disabled .list-group-item-text, +.list-group-item.disabled:hover .list-group-item-text, +.list-group-item.disabled:focus .list-group-item-text { + color: #777777; +} +.list-group-item.active, +.list-group-item.active:hover, +.list-group-item.active:focus { + z-index: 2; + color: #ffffff; + background-color: #337ab7; + border-color: #337ab7; +} +.list-group-item.active .list-group-item-heading, +.list-group-item.active:hover .list-group-item-heading, +.list-group-item.active:focus .list-group-item-heading, +.list-group-item.active .list-group-item-heading > small, +.list-group-item.active:hover .list-group-item-heading > small, +.list-group-item.active:focus .list-group-item-heading > small, +.list-group-item.active .list-group-item-heading > .small, +.list-group-item.active:hover .list-group-item-heading > .small, +.list-group-item.active:focus .list-group-item-heading > .small { + color: inherit; +} +.list-group-item.active .list-group-item-text, +.list-group-item.active:hover .list-group-item-text, +.list-group-item.active:focus .list-group-item-text { + color: #c7ddef; +} +.list-group-item-success { + color: #3c763d; + background-color: #dff0d8; +} +a.list-group-item-success, +button.list-group-item-success { + color: #3c763d; +} +a.list-group-item-success .list-group-item-heading, +button.list-group-item-success .list-group-item-heading { + color: inherit; +} +a.list-group-item-success:hover, +button.list-group-item-success:hover, +a.list-group-item-success:focus, +button.list-group-item-success:focus { + color: #3c763d; + background-color: #d0e9c6; +} +a.list-group-item-success.active, +button.list-group-item-success.active, +a.list-group-item-success.active:hover, +button.list-group-item-success.active:hover, +a.list-group-item-success.active:focus, +button.list-group-item-success.active:focus { + color: #fff; + background-color: #3c763d; + border-color: #3c763d; +} +.list-group-item-info { + color: #31708f; + background-color: #d9edf7; +} +a.list-group-item-info, +button.list-group-item-info { + color: #31708f; +} +a.list-group-item-info .list-group-item-heading, +button.list-group-item-info .list-group-item-heading { + color: inherit; +} +a.list-group-item-info:hover, +button.list-group-item-info:hover, +a.list-group-item-info:focus, +button.list-group-item-info:focus { + color: #31708f; + background-color: #c4e3f3; +} +a.list-group-item-info.active, +button.list-group-item-info.active, +a.list-group-item-info.active:hover, +button.list-group-item-info.active:hover, +a.list-group-item-info.active:focus, +button.list-group-item-info.active:focus { + color: #fff; + background-color: #31708f; + border-color: #31708f; +} +.list-group-item-warning { + color: #8a6d3b; + background-color: #fcf8e3; +} +a.list-group-item-warning, +button.list-group-item-warning { + color: #8a6d3b; +} +a.list-group-item-warning .list-group-item-heading, +button.list-group-item-warning .list-group-item-heading { + color: inherit; +} +a.list-group-item-warning:hover, +button.list-group-item-warning:hover, +a.list-group-item-warning:focus, +button.list-group-item-warning:focus { + color: #8a6d3b; + background-color: #faf2cc; +} +a.list-group-item-warning.active, +button.list-group-item-warning.active, +a.list-group-item-warning.active:hover, +button.list-group-item-warning.active:hover, +a.list-group-item-warning.active:focus, +button.list-group-item-warning.active:focus { + color: #fff; + background-color: #8a6d3b; + border-color: #8a6d3b; +} +.list-group-item-danger { + color: #a94442; + background-color: #f2dede; +} +a.list-group-item-danger, +button.list-group-item-danger { + color: #a94442; +} +a.list-group-item-danger .list-group-item-heading, +button.list-group-item-danger .list-group-item-heading { + color: inherit; +} +a.list-group-item-danger:hover, +button.list-group-item-danger:hover, +a.list-group-item-danger:focus, +button.list-group-item-danger:focus { + color: #a94442; + background-color: #ebcccc; +} +a.list-group-item-danger.active, +button.list-group-item-danger.active, +a.list-group-item-danger.active:hover, +button.list-group-item-danger.active:hover, +a.list-group-item-danger.active:focus, +button.list-group-item-danger.active:focus { + color: #fff; + background-color: #a94442; + border-color: #a94442; +} +.list-group-item-muted { + color: #777777; + background-color: #f7f7f7; +} +a.list-group-item-muted, +button.list-group-item-muted { + color: #777777; +} +a.list-group-item-muted .list-group-item-heading, +button.list-group-item-muted .list-group-item-heading { + color: inherit; +} +a.list-group-item-muted:hover, +button.list-group-item-muted:hover, +a.list-group-item-muted:focus, +button.list-group-item-muted:focus { + color: #777777; + background-color: #f1f1f1; +} +a.list-group-item-muted.active, +button.list-group-item-muted.active, +a.list-group-item-muted.active:hover, +button.list-group-item-muted.active:hover, +a.list-group-item-muted.active:focus, +button.list-group-item-muted.active:focus { + color: #fff; + background-color: #777777; + border-color: #777777; +} +.list-group-item-heading { + margin-top: 0; + margin-bottom: 0; +} +.list-group-item-text { + margin-top: 5px; + margin-bottom: 0; + line-height: 1.3; +} +.list-group-item-text:empty { + margin-top: 0; +} +.panel { + margin-bottom: 20px; + background-color: #ffffff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); +} +.panel-body { + padding: 15px; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; +} +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 16px; + color: inherit; +} +.panel-title > a, +.panel-title > small, +.panel-title > .small, +.panel-title > small > a, +.panel-title > .small > a { + color: inherit; +} +.panel-footer { + padding: 10px 15px; + background-color: #f5f5f5; + border-top: 1px solid #dddddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .list-group, +.panel > .panel-collapse > .list-group { + margin-bottom: 0; +} +.panel > .list-group .list-group-item, +.panel > .panel-collapse > .list-group .list-group-item { + border-width: 1px 0; + border-radius: 0; +} +.panel > .list-group:first-child .list-group-item:first-child, +.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { + border-top: 0; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel > .list-group:last-child .list-group-item:last-child, +.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { + border-bottom: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child { + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.panel-heading + .list-group .list-group-item:first-child { + border-top-width: 0; +} +.list-group + .panel-footer { + border-top-width: 0; +} +.panel > .table, +.panel > .table-responsive > .table, +.panel > .panel-collapse > .table { + margin-bottom: 0; +} +.panel > .table caption, +.panel > .table-responsive > .table caption, +.panel > .panel-collapse > .table caption { + padding-left: 15px; + padding-right: 15px; +} +.panel > .table:first-child, +.panel > .table-responsive:first-child > .table:first-child { + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { + border-top-right-radius: 3px; +} +.panel > .table:last-child, +.panel > .table-responsive:last-child > .table:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { + border-bottom-right-radius: 3px; +} +.panel > .panel-body + .table, +.panel > .panel-body + .table-responsive, +.panel > .table + .panel-body, +.panel > .table-responsive + .panel-body { + border-top: 1px solid #dddddd; +} +.panel > .table > tbody:first-child > tr:first-child th, +.panel > .table > tbody:first-child > tr:first-child td { + border-top: 0; +} +.panel > .table-bordered, +.panel > .table-responsive > .table-bordered { + border: 0; +} +.panel > .table-bordered > thead > tr > th:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:first-child, +.panel > .table-bordered > tbody > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, +.panel > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-bordered > thead > tr > td:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:first-child, +.panel > .table-bordered > tbody > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, +.panel > .table-bordered > tfoot > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; +} +.panel > .table-bordered > thead > tr > th:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:last-child, +.panel > .table-bordered > tbody > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, +.panel > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-bordered > thead > tr > td:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:last-child, +.panel > .table-bordered > tbody > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, +.panel > .table-bordered > tfoot > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; +} +.panel > .table-bordered > thead > tr:first-child > td, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > td, +.panel > .table-bordered > tbody > tr:first-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, +.panel > .table-bordered > thead > tr:first-child > th, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > th, +.panel > .table-bordered > tbody > tr:first-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { + border-bottom: 0; +} +.panel > .table-bordered > tbody > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, +.panel > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-bordered > tbody > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, +.panel > .table-bordered > tfoot > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; +} +.panel > .table-responsive { + border: 0; + margin-bottom: 0; +} +.panel-group { + margin-bottom: 20px; +} +.panel-group .panel { + margin-bottom: 0; + border-radius: 4px; +} +.panel-group .panel + .panel { + margin-top: 5px; +} +.panel-group .panel-heading { + border-bottom: 0; +} +.panel-group .panel-heading + .panel-collapse > .panel-body, +.panel-group .panel-heading + .panel-collapse > .list-group { + border-top: 1px solid #dddddd; +} +.panel-group .panel-footer { + border-top: 0; +} +.panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom: 1px solid #dddddd; +} +.panel-default { + border-color: #dddddd; +} +.panel-default > .panel-heading { + color: #333333; + background-color: #f5f5f5; + border-color: #dddddd; +} +.panel-default > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #dddddd; +} +.panel-default > .panel-heading .badge { + color: #f5f5f5; + background-color: #333333; +} +.panel-default > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #dddddd; +} +.panel-primary { + border-color: #337ab7; +} +.panel-primary > .panel-heading { + color: #ffffff; + background-color: #337ab7; + border-color: #337ab7; +} +.panel-primary > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #337ab7; +} +.panel-primary > .panel-heading .badge { + color: #337ab7; + background-color: #ffffff; +} +.panel-primary > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #337ab7; +} +.panel-success { + border-color: #d6e9c6; +} +.panel-success > .panel-heading { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.panel-success > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #d6e9c6; +} +.panel-success > .panel-heading .badge { + color: #dff0d8; + background-color: #3c763d; +} +.panel-success > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #d6e9c6; +} +.panel-info { + border-color: #bce8f1; +} +.panel-info > .panel-heading { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.panel-info > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #bce8f1; +} +.panel-info > .panel-heading .badge { + color: #d9edf7; + background-color: #31708f; +} +.panel-info > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #bce8f1; +} +.panel-warning { + border-color: #faebcc; +} +.panel-warning > .panel-heading { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.panel-warning > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #faebcc; +} +.panel-warning > .panel-heading .badge { + color: #fcf8e3; + background-color: #8a6d3b; +} +.panel-warning > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #faebcc; +} +.panel-danger { + border-color: #ebccd1; +} +.panel-danger > .panel-heading { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.panel-danger > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #ebccd1; +} +.panel-danger > .panel-heading .badge { + color: #f2dede; + background-color: #a94442; +} +.panel-danger > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #ebccd1; +} + +/* Inline Group */ + +.input-group { + position: relative; + display: table; + border-collapse: separate; +} +.input-group[class*="col-"] { + float: none; + padding-left: 0; + padding-right: 0; +} +.input-group .form-control { + position: relative; + z-index: 2; + float: left; + width: 100%; + margin-bottom: 0; +} +.input-group .form-control:focus { + z-index: 3; +} +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + height: 41px; + padding: 10px 16px; + font-size: 15px; + line-height: 1.3333333; + border-radius: 6px; +} +select.input-group-lg > .form-control, +select.input-group-lg > .input-group-addon, +select.input-group-lg > .input-group-btn > .btn { + height: 41px; + line-height: 41px; +} +textarea.input-group-lg > .form-control, +textarea.input-group-lg > .input-group-addon, +textarea.input-group-lg > .input-group-btn > .btn, +select[multiple].input-group-lg > .form-control, +select[multiple].input-group-lg > .input-group-addon, +select[multiple].input-group-lg > .input-group-btn > .btn { + height: auto; +} +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-group-sm > .form-control, +select.input-group-sm > .input-group-addon, +select.input-group-sm > .input-group-btn > .btn { + height: 30px; + line-height: 30px; +} +textarea.input-group-sm > .form-control, +textarea.input-group-sm > .input-group-addon, +textarea.input-group-sm > .input-group-btn > .btn, +select[multiple].input-group-sm > .form-control, +select[multiple].input-group-sm > .input-group-addon, +select[multiple].input-group-sm > .input-group-btn > .btn { + height: auto; +} +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; +} +.input-group-addon:not(:first-child):not(:last-child), +.input-group-btn:not(:first-child):not(:last-child), +.input-group .form-control:not(:first-child):not(:last-child) { + border-radius: 0; +} +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; +} +.input-group-addon { + padding: 6px 12px; + font-size: 14px; + font-weight: normal; + line-height: 1; + color: #555555; + text-align: center; + background-color: #eeeeee; + border: 1px solid #cccccc; + border-radius: 4px; +} +.input-group-addon.input-sm { + padding: 5px 10px; + font-size: 12px; + border-radius: 3px; +} +.input-group-addon.input-lg { + padding: 10px 16px; + font-size: 15px; + border-radius: 6px; +} +.input-group-addon input[type="radio"], +.input-group-addon input[type="checkbox"] { + margin-top: 0; +} +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child), +.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.input-group-addon:last-child { + border-left: 0; +} +.input-group-btn { + position: relative; + font-size: 0; + white-space: nowrap; +} +.input-group-btn > .btn { + position: relative; +} +.input-group-btn > .btn + .btn { + margin-left: -1px; +} +.input-group-btn > .btn:hover, +.input-group-btn > .btn:focus, +.input-group-btn > .btn:active { + z-index: 2; +} +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group { + margin-right: -1px; +} +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group { + z-index: 2; + margin-left: -1px; +} +.clearfix:before, +.clearfix:after, +.form-horizontal .form-group:before, +.form-horizontal .form-group:after { + content: " "; + display: table; +} +.clearfix:after, +.form-horizontal .form-group:after { + clear: both; +} diff --git a/data/core.telegram.org/css/core-widgets.css b/data/core.telegram.org/css/core-widgets.css new file mode 100644 index 0000000000..6b86cfbf74 --- /dev/null +++ b/data/core.telegram.org/css/core-widgets.css @@ -0,0 +1,105 @@ +.widget-accent-colors { + display: flex; + flex-wrap: nowrap; + justify-content: space-between; + max-width: 480px; + margin: 3px 0 0; +} +.widget-accent-colors .widget-accent-color-item { + position: relative; + flex-basis: 42px; + font-weight: normal; + text-align: center; + cursor: pointer; +} +.widget-accent-color-item input.radio { + position: absolute; + left: -5000px; +} +.widget-accent-color-item input.radio + .widget-color-circle:after { + position: absolute; + left: 0; + display: inline-block; + content: ''; + width: 100%; + height: 100%; + border-radius: 50%; + vertical-align: top; + background: url('data:image/svg+xml,%3Csvg height="15" viewBox="0 0 18 15" width="18" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%23fff" fill-rule="evenodd"%3E%3Crect height="8" rx="1.472727" transform="matrix(.70710678 -.70710678 .70710678 .70710678 -5.753048 6.110913)" width="3" x="3" y="6"/%3E%3Crect height="3" rx="1.472727" transform="matrix(.70710678 -.70710678 .70710678 .70710678 -2.081475 9.974874)" width="16" x="3" y="6"/%3E%3C/g%3E%3C/svg%3E') no-repeat center 11px; + transition: transform 0.12s linear; + transform: scale3d(0, 0, 1); +} +.widget-accent-color-item input.radio + .widget-color-circle.bordered, +.widget-accent-color-item input.radio:checked + .widget-color-circle-custom.bordered { + box-shadow: inset 0 0 0 1px #eaeaea; +} +.widget-accent-color-item input.radio + .widget-color-circle-custom.bordered { + border: none; +} +.widget-accent-color-item input.radio + .widget-color-circle.light:after { + background-image: url('data:image/svg+xml,%3Csvg height="15" viewBox="0 0 18 15" width="18" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%2315202b" fill-rule="evenodd"%3E%3Crect height="8" rx="1.472727" transform="matrix(.70710678 -.70710678 .70710678 .70710678 -5.753048 6.110913)" width="3" x="3" y="6"/%3E%3Crect height="3" rx="1.472727" transform="matrix(.70710678 -.70710678 .70710678 .70710678 -2.081475 9.974874)" width="16" x="3" y="6"/%3E%3C/g%3E%3C/svg%3E'); +} +.widget-accent-color-item input.radio:checked + .widget-color-circle:after { + transform: scale3d(1, 1, 1); +} +.widget-color-circle { + position: relative; + display: inline-block; + vertical-align: top; + width: 36px; + height: 36px; + border-radius: 50%; + background-color: #319BE6; + transition: background-color 0.12s ease, box-shadow 0.12s ease; +} +.widget-color-circle-custom { + background-color: #F5F5F5; + color: #F5F5F5; +} +.widget-accent-color-item input.radio + .widget-color-circle-custom:before { + position: absolute; + left: 0; + display: inline-block; + content: ''; + width: 100%; + height: 100%; + vertical-align: top; + background: url('data:image/svg+xml,%3Csvg height="14" viewBox="0 0 15 14" width="15" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="m3.9468491 8.55631162c-1.3103539 0-2.36810946 1.04207749-2.36810946 2.33300928 0 1.0187474-.91566899 1.5553396-1.57873964 1.5553396.72622023.9487571 1.96553085 1.5553395 3.15747928 1.5553395 1.7445073 0 3.15747928-1.3920289 3.15747928-3.1106791 0-1.29093179-1.05775556-2.33300928-2.36810946-2.33300928zm10.8222602-7.28676572-1.0577555-1.04207749c-.3078543-.30329121-.8051572-.30329121-1.1130115 0l-7.07275356 6.96792112 2.170767 2.13859186 7.07275356-6.96792112c.3078543-.30329121.3078543-.79322316 0-1.09651437z" fill="%23bdbdbd"/%3E%3C/svg%3E') no-repeat center; + transition: opacity 0.12s ease; +} +.widget-color-label { + font-size: 12px; + line-height: 14px; + margin-top: 8px; + color: #333; +} +.widget-color-label-custom { + transition: opacity 0.12s ease; + position: absolute; + width: 100%; +} +.widget-accent-color-field-item { + transition: all .2s ease; + opacity: 0; +} +.widget-accent-color-field-item input.widget-accent-color-field { + font-size: 12px !important; + line-height: 14px !important; + text-transform: uppercase; + position: relative; + text-align: center; + margin-top: 3px !important; + padding: 5px 0 !important; + color: #222 !important; + width: 52px !important; +} +.widget-accent-color-item input.radio:checked ~ .widget-accent-color-field-item { + opacity: 1; +} +.widget-accent-color-item input.radio:checked ~ .widget-color-circle-custom { + background-color: currentColor !important; +} +.widget-accent-color-item input.radio:checked + .widget-color-circle-custom:before, +.widget-accent-color-item input.radio:checked ~ .widget-color-label-custom { + opacity: 0; +} diff --git a/data/core.telegram.org/css/telegram-extra.css b/data/core.telegram.org/css/telegram-extra.css new file mode 100644 index 0000000000..6b408d1ae4 --- /dev/null +++ b/data/core.telegram.org/css/telegram-extra.css @@ -0,0 +1,246 @@ +.telegram-passport-wrap { + overflow: hidden; +} +.telegram-passport-form { + position: relative; +} +.telegram-passport-form .control-label { + line-height: 20px; + padding-top: 11px; +} +.telegram-passport-header { + font-size: 18px; + line-height: 27px; +} +.telegram-passport-greeting { + margin-right: 10px; +} +.telegram-passport-greeting a, +.telegram-passport-greeting a:hover { + color: inherit; +} +.telegram-passport-logout { + font-size: 16px; + font-weight: normal; +} +.telegram-passport-login-wrap { + margin: 10px 0 50px; + text-align: center; +} +.telegram-passport-relogin-wrap { + margin: 10px 0 50px; + text-align: center; +} +.telegram-passport-pending { + padding: 20px 0 40px; + text-align: center; +} +.telegram-passport-block-header, +.telegram-passport-item { + border-bottom: 1px solid #e7e7e7; +} +.telegram-passport-block-header, +.telegram-passport-item-name, +.telegram-passport-item-value { + padding: 15px 0; + line-height: 20px; +} +.telegram-passport-block-header { + margin: 25px 0 0; +} +.telegram-passport-item-name { + margin-right: 15px; + margin-bottom: -5px; + padding-bottom: 0; + float: left; +} +.telegram-passport-item-files, +.telegram-passport-item-value { + clear: left; + font-weight: bold; +} +.telegram-passport-item-value { + transition: color .12s linear; +} +.telegram-passport-item-files { + padding: 6px 0; +} +.telegram-passport-item-file { + padding: 6px 0; + min-height: 60px; +} +.telegram-passport-item .telegram-passport-checkbox-right .checkbox-input { + margin: 0; +} +.telegram-passport-item .telegram-passport-checkbox-right { + float: right; + margin: 40px -5px 10px; + padding: 5px; +} +.telegram-passport-item-files .checkbox-item-block { + margin: 6px 0; +} +.telegram-passport-item-file .telegram-passport-checkbox-right { + margin: 9px -5px; +} +.telegram-passport-scan-thumb { + display: inline-block; + width: 64px; + height: 48px; + background: #f7f7f7 no-repeat center; + background-size: cover; + float: left; + border-radius: 3px; + margin-right: 15px; +} +.telegram-passport-scan-name { + display: inline-block; + font-size: 14px; + padding: 3px 0 0; + transition: color .12s linear; + color: #2e87ca; +} +.telegram-passport-scan-size { + font-size: 13px; + padding: 1px 0 0; + font-weight: normal; + transition: color .12s linear; + color: #999; +} +.telegram-passport-item-value, +.telegram-passport-scan-info { + margin-right: 42px; +} +.telegram-passport-item .checkbox-item-block .checkbox-label { + transition: color .12s linear; +} +.telegram-passport-item.item-rejected .telegram-passport-item-value, +.telegram-passport-item-file.item-rejected .telegram-passport-scan-name, +.telegram-passport-item-file.item-rejected .telegram-passport-scan-size, +.telegram-passport-item .checkbox-item-block.item-rejected .checkbox-label { + color: #c93c3c; +} + +.telegram-passport-item .checkbox-item-block .checkbox-input-icon:before { + border-color: #eb5454; + background-color: #eb5454; + background-position: -3px -119px; +} +.telegram-passport-item .checkbox-item-block input.checkbox:checked + .checkbox-input .ripple { + background-color: rgba(235, 84, 84, .2); +} +.telegram-passport-errors-wrap { + text-align: right; + margin: 20px 16px 0; +} +.btn.telegram-passport-errors { + font-size: 15px; + font-weight: 500; + line-height: 20px; + border-radius: 6px; + background-color: transparent; + padding: 8px 16px 10px; + margin: 4px -16px; + border: none; + color: #c93c3c; + position: relative; + z-index: 1; +} +.btn.telegram-passport-errors:hover { + background-color: #f7e3e3; +} +.btn.telegram-passport-errors:focus { + outline: none; +} +.btn.telegram-passport-errors:active { + box-shadow: none; +} +.telegram-passport-errors-icon { + display: inline-block; + vertical-align: top; + width: 18px; + height: 19px; + margin: 1px 12px 0 0; + background: url(/img/passport_bug.png) no-repeat 0 0; +} +@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { + .telegram-passport-errors-icon { + background-image: url(/img/passport_bug_2x.png); + background-size: 18px 19px; + } +} +.telegram-passport-errors-sent { + font-size: 14px; + line-height: 20px; + padding: 13px 24px 0 0; + color: #999; + transition: opacity .12s linear; + opacity: 0; +} +.telegram-passport-errors-sent.shown { + opacity: 1; +} + +@media (min-width: 768px) { + .telegram-passport-login-wrap { + text-align: left; + } + .telegram-passport-relogin-wrap { + text-align: left; + margin: 50px 0 50px 240px; + } + .telegram-passport-item-files, + .telegram-passport-item-value { + clear: none; + margin-left: 240px; + } + .telegram-passport-item .telegram-passport-checkbox-right { + margin-top: 10px; + } + .telegram-passport-item-file .telegram-passport-checkbox-right { + margin: 9px -5px; + } + .telegram-passport-errors-wrap { + position: absolute; + right: 0; + margin: 50px 0 0; + } +} + +.telegram-passport-form .sub-control-label { + text-align: left; + margin: 11px 0 6px; +} +.telegram-passport-form .sub-control-label .radio-label { + font-weight: bold; +} +.telegram-passport-form .sub-control-label .radio-item + .radio-item, +.telegram-passport-form .sub-control-label .checkbox-item + .checkbox-item { + margin-left: 25px; +} +.telegram-passport-form label.control-label .radio-label { + font-weight: bold; +} +.passport-opt, +.passport-opt-col { + display: inline-block; + margin-left: 31px; + margin-top: -10px; +} +.passport-opt + .passport-opt, +.passport-opt-col + .passport-opt-col { + margin-left: 0; +} +@media (min-width: 992px) { + .passport-opt-col { + margin-left: 0; + margin-top: 0; + text-align: center; + } + .passport-opt-col .checkbox-label { + text-align: left; + } + .passport-opt-col .checkbox-item input.checkbox ~ .checkbox-label { + display: none; + } +} diff --git a/data/core.telegram.org/js/core-widgets.js b/data/core.telegram.org/js/core-widgets.js new file mode 100644 index 0000000000..67bf4c7d05 --- /dev/null +++ b/data/core.telegram.org/js/core-widgets.js @@ -0,0 +1,279 @@ +function fixColor(color) { + color = color.toUpperCase(); + if (color.length == 1 || color.length == 2) { + color = color + color + color; + } else if (color.length > 3 && color.length < 6) { + color = color.substr(0, 3); + } else if (color.length > 6) { + color = color.substr(0, 6); + } + return color; +} + +function isColorLight(color, k) { + var hsl = rgb2hsl(color); + if (typeof k === 'undefined') k = 0.8; + if (k > 0) return (hsl.l > k); + return (hsl.l < (1 + k)); +} + +function rgb2hsl(rgb) { + rgb = fixColor(rgb); + if (rgb.length == 3) { + rgb = rgb[0] + rgb[0] + rgb[1] + rgb[1] + rgb[2] + rgb[2]; + } + var r = parseInt(rgb.substr(0, 2), 16); + var g = parseInt(rgb.substr(2, 2), 16); + var b = parseInt(rgb.substr(4, 2), 16); + r /= 255; g /= 255; b /= 255; + var max = Math.max(r, g, b), + min = Math.min(r, g, b); + var h, s, l = (max + min) / 2; + if (max == min) { + h = s = 0; // achromatic + } else { + var d = max - min; + s = l > 0.5 ? d / (2 - max - min) : d / (max + min); + switch (max) { + case r: h = (g - b) / d + (g < b ? 6 : 0); break; + case g: h = (b - r) / d + 2; break; + case b: h = (r - g) / d + 4; break; + } + h /= 6; + } + return {h: h, s: s, l: l}; +} + +var PostWidget = { + options: {}, + init: function(options) { + var form = $('#post_widget_config').get(0); + if (!form) return; + PostWidget.options = options || {}; + $('.form-telegram input.form-control[type="text"]').on('change blur', function() { + PostWidget.update(); + }); + $('.form-telegram input.radio, .form-telegram input.checkbox').on('change', function() { + var is_dark = (this.getAttribute('name') == 'dark'); + PostWidget.update(is_dark); + }); + $('.widget-accent-color-item input.radio').on('change', function() { + if (this.value == 'custom') { + $('.widget-accent-color-field').select(); + } + PostWidget.update(); + }); + $('.widget-accent-color-field').on('input', function() { + var val = this.value; + this.value = val.toUpperCase().replace(/[^0-9A-F]+/g, ''); + var color = fixColor(this.value); + $('.widget-color-circle-custom').css('color', color ? '#' + color : '').toggleClass('light', isColorLight(color)).toggleClass('bordered', isColorLight(color, 0.95)); + }); + $('.widget-accent-color-field').on('focus', function() { + $('.widget-accent-color-item .radio[value="custom"]').prop('checked', true); + PostWidget.update(); + }); + PostWidget.update(); + initRipple(); + }, + update: function(toggle_dark) { + var options = PostWidget.options || {}; + var form = $('#post_widget_config').get(0); + if (!form) return; + var tfi = $('#post_link').parents('.textfield-item'); + var post_link = $('#post_link').val() || options.default_link, + match; + if (match = post_link.match(/^(?:(?:https?):\/\/)?(?:t\.me|telegram\.me|telegram\.dog)\/([a-zA-Z0-9_]+\/\d+)(?:\?(.*))?$/i)) { + var post_id = match[1], suffix = match[2] || ''; + var querystring = suffix.split('#')[0]; + var str_values = querystring.split('&'); + var query = {}; + for (var i = 0; i < str_values.length; i++) { + var key_value = str_values[i].split('='); + var key = decodeURIComponent(key_value[0]); + var value = key_value.length > 1 ? decodeURIComponent(key_value[1]) : null; + query[key] = value; + } + var single = typeof query.single !== 'undefined'; + var comment_id = parseInt(query.comment); + } else { + tfi.addClass('is-invalid'); + $('#post_link_error').html(options.link_error); + $('#post_link').one('input', function() { + tfi.removeClass('is-invalid'); + }); + return; + } + tfi.removeClass('is-invalid'); + var width = form.width.value; + if (!width) width = '100%'; + var author_photo = form.author_photo.value; + var dark = form.dark.checked; + var dark_colors = {}; + $('.widget-accent-color-item[data-color]').each(function() { + var color = $(this).attr('data-color'); + var dark_color = $(this).attr('data-dark-color'); + var bg_color = $(this).attr(dark ? 'data-dark-color' : 'data-bg-color'); + var text = $(this).attr(dark ? 'data-dark-text' : 'data-text'); + var cur_color = dark && dark_color ? dark_color : color; + dark_colors[color] = dark_color; + $('.widget-color-circle', this).css('backgroundColor', '#' + bg_color).toggleClass('light', isColorLight(cur_color)).toggleClass('bordered', isColorLight(cur_color, 0.95)); + if (text) { + $('.widget-color-label', this).text(text); + } + }); + var color = form.color.value; + var dark_color = ''; + var customcolor = form.customcolor.value; + if (color == 'default') { + color = ''; + dark_color = ''; + } else if (color == 'custom') { + color = fixColor(customcolor); + if (color != customcolor) { + form.customcolor.value = color; + $('.widget-color-circle-custom').css('color', color ? '#' + color : '').toggleClass('light', isColorLight(color)).toggleClass('bordered', isColorLight(color, 0.95)); + } + dark_color = color; + } else { + dark_color = dark_colors[color] || color; + } + if (!color) { + color = ''; + dark_color = ''; + $('.widget-accent-color-item .radio[value="default"]').prop('checked', true); + var custom_default = form.customcolor.defaultValue; + form.customcolor.value = custom_default; + $('.widget-color-circle-custom').css('color', custom_default ? '#' + custom_default : '').toggleClass('light', isColorLight(custom_default)).toggleClass('bordered', isColorLight(custom_default, 0.95)); + } + var code = ''; + $('#embed_code').val(code); + $('#embed_code').height(0); + $('#embed_code').height($('#embed_code').get(0).scrollHeight); + if (PostWidget.lastCode != code) { + PostWidget.lastCode = code; + $('#widget_container').toggleClass('dark', !!dark); + if (toggle_dark) { + var frame = $('#widget_container iframe').get(0); + Telegram.setWidgetOptions({dark: dark}, frame); + } else { + $('#widget_container').html(code); + } + } + } +}; + +var DiscussionWidget = { + options: {}, + init: function(options) { + var form = $('#discussion_widget_config').get(0); + if (!form) return; + DiscussionWidget.options = options || {}; + $('.form-telegram input.form-control[type="text"]').on('change blur', function() { + DiscussionWidget.update(); + }); + $('.form-telegram input.checkbox').on('change', function() { + var is_dark = (this.getAttribute('name') == 'dark'); + DiscussionWidget.update(is_dark); + }); + $('.widget-accent-color-item input.radio').on('change', function() { + if (this.value == 'custom') { + $('.widget-accent-color-field').select(); + } + DiscussionWidget.update(); + }); + $('.widget-accent-color-field').on('input', function() { + var val = this.value; + this.value = val.toUpperCase().replace(/[^0-9A-F]+/g, ''); + var color = fixColor(this.value); + $('.widget-color-circle-custom').css('color', color ? '#' + color : '').toggleClass('light', isColorLight(color)).toggleClass('bordered', isColorLight(color, 0.95)); + }); + $('.widget-accent-color-field').on('focus', function() { + $('.widget-accent-color-item .radio[value="custom"]').prop('checked', true); + DiscussionWidget.update(); + }); + DiscussionWidget.update(); + initRipple(); + }, + update: function(toggle_dark) { + var options = DiscussionWidget.options || {}; + var form = $('#discussion_widget_config').get(0); + if (!form) return; + var tfi = $('#post_link').parents('.textfield-item'); + var post_link = $('#post_link').val() || options.default_link, + match; + var post_full_id = '', post_id = 0; + if (match = post_link.match(/^(?:(?:https?):\/\/)?(?:t\.me|telegram\.me|telegram\.dog)\/([a-zA-Z0-9_]+(\/\d+)?)/i)) { + post_full_id = match[1]; + post_id = match[2] || 0; + } else { + tfi.addClass('is-invalid'); + $('#post_link_error').html(options.link_error); + $('#post_link').one('input', function() { + tfi.removeClass('is-invalid'); + }); + return; + } + $('.canonical-helper', form).toggleClass('hide', !!post_id); + tfi.removeClass('is-invalid'); + var limit = parseInt(form.comments_limit.value) || 5; + var real_limit = Math.max(3, Math.min(50, limit)); + form.comments_limit.value = real_limit; + var height = parseInt(form.height.value) || 0; + var real_height = height > 0 ? Math.max(300, height) : 0; + form.height.value = real_height || ''; + var dark = form.dark.checked; + var dark_colors = {}; + $('.widget-accent-color-item[data-color]').each(function() { + var color = $(this).attr('data-color'); + var dark_color = $(this).attr('data-dark-color'); + var bg_color = $(this).attr(dark ? 'data-dark-color' : 'data-bg-color'); + var text = $(this).attr(dark ? 'data-dark-text' : 'data-text'); + var cur_color = dark && dark_color ? dark_color : color; + dark_colors[color] = dark_color; + $('.widget-color-circle', this).css('backgroundColor', '#' + bg_color).toggleClass('light', isColorLight(cur_color)).toggleClass('bordered', isColorLight(cur_color, 0.95)); + if (text) { + $('.widget-color-label', this).text(text); + } + }); + var color = form.color.value; + var dark_color = ''; + var customcolor = form.customcolor.value; + if (color == 'default') { + color = ''; + dark_color = ''; + } else if (color == 'custom') { + color = fixColor(customcolor); + if (color != customcolor) { + form.customcolor.value = color; + $('.widget-color-circle-custom').css('color', color ? '#' + color : '').toggleClass('light', isColorLight(color)).toggleClass('bordered', isColorLight(color, 0.95)); + } + dark_color = color; + } else { + dark_color = dark_colors[color] || color; + } + if (!color) { + color = ''; + dark_color = ''; + $('.widget-accent-color-item .radio[value="default"]').prop('checked', true); + var custom_default = form.customcolor.defaultValue; + form.customcolor.value = custom_default; + $('.widget-color-circle-custom').css('color', custom_default ? '#' + custom_default : '').toggleClass('light', isColorLight(custom_default)).toggleClass('bordered', isColorLight(custom_default, 0.95)); + } + var colorful = form.colorful.checked; + var code = ''; + $('#embed_code').val(code); + $('#embed_code').height(0); + $('#embed_code').height($('#embed_code').get(0).scrollHeight); + if (DiscussionWidget.lastCode != code) { + DiscussionWidget.lastCode = code; + $('#widget_container').toggleClass('dark', !!dark); + if (toggle_dark) { + var frame = $('#widget_container iframe').get(0); + Telegram.setWidgetOptions({dark: dark}, frame); + } else { + $('#widget_container').html(code); + } + } + } +}; diff --git a/data/core.telegram.org/js/jquery-ui.min.js b/data/core.telegram.org/js/jquery-ui.min.js new file mode 100644 index 0000000000..a47c061a05 --- /dev/null +++ b/data/core.telegram.org/js/jquery-ui.min.js @@ -0,0 +1,9 @@ +/*! jQuery UI - v1.11.4 - 2017-08-30 +* http://jqueryui.com +* Includes: core.js, widget.js, mouse.js, draggable.js, resizable.js, sortable.js, slider.js, effect.js, effect-slide.js +* Copyright jQuery Foundation and other contributors; Licensed MIT */ + +(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(e,s){var n,o,a,r=e.nodeName.toLowerCase();return"area"===r?(n=e.parentNode,o=n.name,e.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']")[0],!!a&&i(a)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!e.disabled:"a"===r?e.href||s:s)&&i(e)}function i(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}t.ui=t.ui||{},t.extend(t.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({scrollParent:function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])},focusable:function(i){return e(i,!isNaN(t.attr(i,"tabindex")))},tabbable:function(i){var s=t.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&e(i,!n)}}),t("").outerWidth(1).jquery||t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.fn.extend({focus:function(e){return function(i,s){return"number"==typeof i?this.each(function(){var e=this;setTimeout(function(){t(e).focus(),s&&s.call(e)},i)}):e.apply(this,arguments)}}(t.fn.focus),disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(e){if(void 0!==e)return this.css("zIndex",e);if(this.length)for(var i,s,n=t(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}};var s=0,n=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r,l={},h=e.split(".")[0];return e=e.split(".")[1],n=h+"-"+e,s||(s=i,i=t.Widget),t.expr[":"][n.toLowerCase()]=function(e){return!!t.data(e,n)},t[h]=t[h]||{},o=t[h][e],a=t[h][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new a(t,e)},t.extend(a,o,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),r=new i,r.options=t.widget.extend({},r.options),t.each(s,function(e,s){return t.isFunction(s)?(l[e]=function(){var t=function(){return i.prototype[e].apply(this,arguments)},n=function(t){return i.prototype[e].apply(this,t)};return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(l[e]=s,void 0)}),a.prototype=t.widget.extend(r,{widgetEventPrefix:o?r.widgetEventPrefix||e:e},l,{constructor:a,namespace:h,widgetName:e,widgetFullName:n}),o?(t.each(o._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,a,i._proto)}),delete o._childConstructors):i._childConstructors.push(a),t.widget.bridge(e,a),a},t.widget.extend=function(e){for(var i,s,o=n.call(arguments,1),a=0,r=o.length;r>a;a++)for(i in o[a])s=o[a][i],o[a].hasOwnProperty(i)&&void 0!==s&&(e[i]=t.isPlainObject(s)?t.isPlainObject(e[i])?t.widget.extend({},e[i],s):t.widget.extend({},s):s);return e},t.widget.bridge=function(e,i){var s=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=n.call(arguments,1),l=this;return a?this.each(function(){var i,n=t.data(this,s);return"instance"===o?(l=n,!1):n?t.isFunction(n[o])&&"_"!==o.charAt(0)?(i=n[o].apply(n,r),i!==n&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,s);e?(e.option(o||{}),e._init&&e._init()):t.data(this,s,new i(o,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=s++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!e),e&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.delegate(c,h,r):i.bind(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(i).undelegate(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget;var o=!1;t(document).mouseup(function(){o=!1}),t.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!o){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,n="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),o=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),o=!1,!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.widget("ui.draggable",t.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(e){var i=this.options;return this._blurActiveElement(e),this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("
").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=this.document[0];if(this.handleElement.is(e.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&t(i.activeElement).blur()}catch(s){}},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._normalizeRightBottom(),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.focus(),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper),n=s?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options,o=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,n,o,a=this.options,r=this._isRootNode(this.scrollParent[0]),l=t.pageX,h=t.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.lefti[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,h=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,l=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o),"y"===a.axis&&(l=this.originalPageX),"x"===a.axis&&(h=this.originalPageY)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var n=t.extend({},i,{item:s.element});s.sortables=[],t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,n))})},stop:function(e,i,s){var n=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,t.each(s.sortables,function(){var t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,n))})},drag:function(e,i,s){t.each(s.sortables,function(){var n=!1,o=this;o.positionAbs=s.positionAbs,o.helperProportions=s.helperProportions,o.offset.click=s.offset.click,o._intersectsWith(o.containerCache)&&(n=!0,t.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(n=!1),n})),n?(o.isOver||(o.isOver=1,s._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=s.offset.click.top,o.offset.click.left=s.offset.click.left,o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top,s._trigger("toSortable",e),s.dropped=o.element,t.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,o.fromOutside=s),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(e),i.position=s._generatePosition(e,!0),s._trigger("fromSortable",e),s.dropped=!1,t.each(s.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var n=t("body"),o=s.options;n.css("cursor")&&(o._cursor=n.css("cursor")),n.css("cursor",o.cursor)},stop:function(e,i,s){var n=s.options;n._cursor&&t("body").css("cursor",n._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("opacity")&&(o._opacity=n.css("opacity")),n.css("opacity",o.opacity)},stop:function(e,i,s){var n=s.options;n._opacity&&t(i.helper).css("opacity",n._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,s){var n=s.options,o=!1,a=s.scrollParentNotHidden[0],r=s.document[0];a!==r&&"HTML"!==a.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+a.offsetHeight-e.pageY=0;d--)l=s.snapElements[d].left-s.margins.left,h=l+s.snapElements[d].width,c=s.snapElements[d].top-s.margins.top,u=c+s.snapElements[d].height,l-g>_||m>h+g||c-g>b||v>u+g||!t.contains(s.snapElements[d].item.ownerDocument,s.snapElements[d].item)?(s.snapElements[d].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=g>=Math.abs(c-b),o=g>=Math.abs(u-v),a=g>=Math.abs(l-_),r=g>=Math.abs(h-m),n&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left)),p=n||o||a||r,"outer"!==f.snapMode&&(n=g>=Math.abs(c-v),o=g>=Math.abs(u-b),a=g>=Math.abs(l-m),r=g>=Math.abs(h-_),n&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left)),!s.snapElements[d].snapping&&(n||o||a||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=n||o||a||r||p)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var n,o=s.options,a=t.makeArray(t(o.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});a.length&&(n=parseInt(t(a[0]).css("zIndex"),10)||0,t(a).each(function(e){t(this).css("zIndex",n+e)}),this.css("zIndex",n+a.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("zIndex")&&(o._zIndex=n.css("zIndex")),n.css("zIndex",o.zIndex)},stop:function(e,i,s){var n=s.options;n._zIndex&&t(i.helper).css("zIndex",n._zIndex)}}),t.ui.draggable,t.widget("ui.resizable",t.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseInt(t,10)||0 +},_isNumber:function(t){return!isNaN(parseInt(t,10))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i,s,n,o,a=this,r=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;e.length>i;i++)s=t.trim(e[i]),o="ui-resizable-"+s,n=t("
"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(t(this).removeClass("ui-resizable-autohide"),a._handles.show())}).mouseleave(function(){r.disabled||a.resizing||(t(this).addClass("ui-resizable-autohide"),a._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),a.addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,l=this._change[o];return this._updatePrevProperties(),l?(i=l.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,l,h=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,l=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,h.animate||this.element.css(t.extend(a,{top:l,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!h.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidtht.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,h=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&h&&(t.left=r-e.minWidth),s&&h&&(t.left=r-e.maxWidth),a&&c&&(t.top=l-e.minHeight),n&&c&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseInt(s[e],10)||0,i[e]+=parseInt(n[e],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("
"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,l={width:i.size.width-r,height:i.size.height-a},h=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(l,c&&h?{top:c,left:h}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,l=t(this).resizable("instance"),h=l.options,c=l.element,u=h.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(l.containerElement=t(d),/document/.test(u)||u===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=l._num(e.css("padding"+s))}),l.containerOffset=e.offset(),l.containerPosition=e.position(),l.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=l.containerOffset,n=l.containerSize.height,o=l.containerSize.width,a=l._hasScroll(d,"left")?d.scrollWidth:o,r=l._hasScroll(d)?d.scrollHeight:n,l.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,l=a.containerOffset,h=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=l),h.left<(a._helper?l.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-l.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?l.left:0),h.top<(a._helper?l.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-l.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?l.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-l.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-l.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),l=a.outerWidth()-e.sizeDiff.width,h=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:l,height:h}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:l,height:h})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.options,s=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,l="number"==typeof s.grid?[s.grid,s.grid]:s.grid,h=l[0]||1,c=l[1]||1,u=Math.round((n.width-o.width)/h)*h,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,g=s.maxWidth&&p>s.maxWidth,m=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=l,_&&(p+=h),v&&(f+=c),g&&(p-=h),m&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-h)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-h>0?(i.size.width=p,i.position.left=a.left-u):(p=h-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable,t.widget("ui.sortable",t.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&e+i>t},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),t.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):void 0}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,l=r+t.height,h=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+h>r&&l>s+h,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&l>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),s=e&&i,n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return s?this.floating?o&&"right"===o||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],l=[],h=this._connectWith();if(h&&e)for(s=h.length-1;s>=0;s--)for(o=t(h[s],this.document[0]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&l.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(l.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=l.length-1;s>=0;s--)l[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,l,h,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i],this.document[0]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,h=r.length;h>s;s++)l=t(r[s]),l.data(this.widgetName+"-item",a),c.push({item:l,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t(" ",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,n,o,a,r,l,h,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue; +d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,c=d.floating||this._isFloating(this.currentItem),a=c?"left":"top",r=c?"width":"height",u=c?"clientX":"clientY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(l=this.items[s].item.offset()[a],h=!1,e[u]-l>this.items[s][r]/2&&(h=!0),n>Math.abs(e[u]-l)&&(n=Math.abs(e[u]-l),o=this.items[s],this.direction=h?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.leftthis.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.widget("ui.slider",t.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)a.push(o);this.handles=n.add(t(a.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("
").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,o,a,r,l,h,c=this,u=this.options;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(n=i,o=t(this),a=e)}),r=this._start(e,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,o.addClass("ui-state-active").focus(),l=o.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-l.left-o.width()/2,top:e.pageY-l.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,o;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,o=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),o!==!1&&this.values(e,i))):i!==this.value()&&(o=this._trigger("slide",t,{handle:this.handles[e],value:i}),o!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),void 0;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!i),this._super(e,i),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step,s=Math.floor(+(t-e).toFixed(this._precision())/i)*i;t=s+e,this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,l=this,h=this._animateOff?!1:r.animate,c={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((l.values(s)-l._valueMin())/(l._valueMax()-l._valueMin())),c["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](c,r.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===s&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?100*((s-n)/(o-n)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range[h?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range[h?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(e){var i,s,n,o,a=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(e.target).addClass("ui-state-active"),i=this._start(e,a),i===!1))return}switch(o=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(a):this.value(),e.keyCode){case t.ui.keyCode.HOME:n=this._valueMin();break;case t.ui.keyCode.END:n=this._valueMax();break;case t.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-o)}this._slide(e,a,n)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}});var a="ui-effects-",r=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=h(),n=s._rgba=[];return i=i.toLowerCase(),f(l,function(t,o){var a,r=o.re.exec(i),l=r&&o.parse(r),h=o.space||"rgba";return l?(a=s[h](l),s[c[h].cache]=a[c[h].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=h.support={},p=t("

")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(n,a,r,l){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,l],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof h?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=h(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=h(t),n=s._space(),o=c[n],a=0===this.alpha()?h("transparent"):this,r=a[o.cache]||o.to(a._rgba),l=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],h=s[o],c=u[n.type]||{};null!==h&&(null===a?l[o]=h:(c.mod&&(h-a>c.mod/2?a+=c.mod:a-h>c.mod/2&&(a-=c.mod)),l[o]=i((h-a)*e+a,n)))}),this[n](l)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=h(e)._rgba;return h(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),l=Math.min(s,n,o),h=r-l,c=r+l,u=.5*c;return e=l===r?0:s===r?60*(n-o)/h+360:n===r?60*(o-s)/h+120:60*(s-n)/h+240,i=0===h?0:.5>=u?h/c:h/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,l=n.to,c=n.from;h.fn[s]=function(s){if(l&&!this[a]&&(this[a]=l(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=h(c(d)),n[a]=d,n):h(d)},f(o,function(e,i){h.fn[e]||(h.fn[e]=function(n){var o,a=t.type(n),l="alpha"===e?this._hsla?"hsla":"rgba":s,h=this[l](),c=h[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),h[i.idx]=n,this[l](h)))})})}),h.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=h(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(l){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(l){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(r),function(){function e(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function i(e,i){var s,o,a={};for(s in i)o=i[s],e[s]!==o&&(n[s]||(t.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(r.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(n,o,a,r){var l=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",h=l.children?a.find("*").addBack():a;h=h.map(function(){var i=t(this);return{el:i,start:e(this)}}),o=function(){t.each(s,function(t,e){n[e]&&a[e+"Class"](n[e])})},o(),h=h.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",r),h=h.map(function(){var e=this,i=t.Deferred(),s=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,h.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.11.4",save:function(t,e){for(var i=0;e.length>i;i++)null!==e[i]&&t.data(a+e[i],t[0].style[e[i]])},restore:function(t,e){var i,s;for(s=0;e.length>s;s++)null!==e[s]&&(i=t.data(a+e[s]),void 0===i&&(i=""),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("

").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){t.isFunction(o)&&o.call(n[0]),t.isFunction(e)&&e()}var n=t(this),o=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):a.call(n[0],s,i)}var s=e.apply(this,arguments),n=s.mode,o=s.queue,a=t.effects.effect[s.effect]; +return t.fx.off||!a?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):o===!1?this.each(i):this.queue(o||"fx",i)},show:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}(),t.effects,t.effects.effect.slide=function(e,i){var s,n=t(this),o=["position","top","bottom","left","right","width","height"],a=t.effects.setMode(n,e.mode||"show"),r="show"===a,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,u={};t.effects.save(n,o),n.show(),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(h,c?isNaN(s)?"-"+s:-s:s),u[h]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&n.hide(),t.effects.restore(n,o),t.effects.removeWrapper(n),i()}})}}); \ No newline at end of file diff --git a/data/core.telegram.org/js/telegram-passport2.js b/data/core.telegram.org/js/telegram-passport2.js new file mode 100644 index 0000000000..026006ade7 --- /dev/null +++ b/data/core.telegram.org/js/telegram-passport2.js @@ -0,0 +1,413 @@ +(function(window) { + if (!Array.isArray) { + Array.isArray = function(arg) { + return Object.prototype.toString.call(arg) === '[object Array]'; + }; + } + if (!Object.isSimpleObject) { + Object.isSimpleObject = function(arg) { + return arg != null && typeof arg === 'object'; + }; + } + function isFunction(func) { + return func && {}.toString.call(func) === '[object Function]'; + } + function getEl(elOrId) { + if (elOrId.nodeType) return elOrId; + return document.getElementById(elOrId); + } + function preventDefault(event) { + if (window.event) { + window.event.returnValue = false; + } + else if (event.preventDefault) { + event.preventDefault(); + } + else { + event.returnValue = false; + } + } + function addEvent(el, event, handler) { + var events = event.split(/\s+/); + for (var i = 0; i < events.length; i++) { + if (el.addEventListener) { + el.addEventListener(events[i], handler, false); + } else { + el.attachEvent('on' + events[i], handler); + } + } + } + + var UA = window.navigator.userAgent || ''; + var ScopeAliases = { + personal_details: 'pd', + passport: 'pp', + driver_license: 'dl', + identity_card: 'ic', + internal_passport: 'ip', + id_document: 'idd', + address: 'ad', + utility_bill: 'ub', + bank_statement: 'bs', + rental_agreement: 'ra', + passport_registration: 'pr', + temporary_registration: 'tr', + address_document: 'add', + phone_number: 'pn', + email: 'em', + }; + + function openDeepLink(url, tooltipToggle) { + var is_ios = /ios|iphone os|iphone|ipod|ipad/i.test(UA); + var is_firefox = /firefox/i.test(UA); + var use_iframe = (is_ios || is_firefox); + var use_once = (!is_ios && is_firefox); + var timeOpen; + var ttNeedHide = false; + var pageShown = true; + var onPageHide = function() { + pageShown = false; + }; + tooltipToggle = tooltipToggle || function(){}; + var onPageShow = function() { + pageShown = true; + if (ttNeedHide && (+(new Date) - timeOpen) > 5000) { + tooltipToggle(false); + } + }; + addEvent(window, 'pagehide', onPageHide); + addEvent(window, 'pageshow', onPageShow); + addEvent(window, 'blur', onPageHide); + addEvent(window, 'focus', onPageShow); + var showTooltip = function() { + tooltipToggle(true); + if (!pageShown) { + ttNeedHide = true; + } + }; + if (use_iframe) { + var iframeEl = document.createElement('iframe'); + iframeEl.style.position = 'absolute'; + iframeEl.style.left = '-10000px'; + iframeEl.style.top = '-10000px'; + document.body.appendChild(iframeEl); + if (iframeEl !== null) { + timeOpen = +(new Date); + iframeEl.src = url; + setTimeout(showTooltip, 2500); + } + if (!use_once) { + setTimeout(function() { + if (pageShown) { + timeOpen = +(new Date); + window.location = url; + } + }, 2000); + } + } + else { + setTimeout(function() { + timeOpen = +(new Date); + window.location = url; + }, 100); + setTimeout(showTooltip, 1500); + } + } + + function packScope(scope) { + if (scope.data) { + scope.d = scope.data; + delete scope.data; + } + if (!scope.d) { + throw new TypeError('scope data is required'); + } + if (!scope.v) { + throw new TypeError('scope version is required'); + } + for (var i = 0; i < scope.d.length; i++) { + scope.d[i] = packScopeField(scope.d[i]); + } + return JSON.stringify(scope); + } + function packScopeField(field) { + if (field.one_of) { + field._ = field.one_of; + delete field.one_of; + } else if (field.type) { + field._ = field.type; + delete field.type; + } + if (Array.isArray(field._)) { + for (var j = 0; j < field._.length; j++) { + field._[j] = packScopeField(field._[j]); + } + field = packScopeOpts(field); + } else if (field._) { + if (ScopeAliases[field._]) { + field._ = ScopeAliases[field._]; + } + field = packScopeOpts(field); + } else if (ScopeAliases[field]) { + field = ScopeAliases[field]; + } + return field; + } + function packScopeOpts(scope) { + if (scope.selfie) { + scope.s = 1; + delete scope.selfie; + } + if (scope.translation) { + scope.t = 1; + delete scope.translation; + } + if (scope.native_names) { + scope.n = 1; + delete scope.native_names; + } + return scope; + } + + function passportAuth(options, tooltipToggle) { + if (!options.bot_id) { + throw new Error('bot_id is required'); + } + if (!options.scope) { + throw new Error('scope is required'); + } + if (!Object.isSimpleObject(options.scope)) { + throw new TypeError('scope should be an object'); + } + if (!options.public_key) { + throw new Error('public_key is required'); + } + if (!options.nonce) { + throw new Error('nonce is required'); + } + if (options.payload) { + throw new Error('payload is deprecated, use nonce instead'); + } + var is_android = /android/i.test(UA); + var url = (is_android ? 'tg:' : 'tg://') + 'resolve?domain=telegrampassport' + + '&bot_id=' + encodeURIComponent(options.bot_id) + + '&scope=' + encodeURIComponent(packScope(options.scope)) + + '&public_key=' + encodeURIComponent(options.public_key) + + '&nonce=' + encodeURIComponent(options.nonce); + if (options.callback_url) { + url += '&callback_url=' + encodeURIComponent(options.callback_url); + } + url += '&payload=nonce'; // legacy for outdated apps + openDeepLink(url, tooltipToggle); + } + + function createAuthButton(contEl, authDataOrFunc, options) { + contEl = getEl(contEl); + if (!contEl) { + return false; + } + options = options || {}; + var btnText = options.text || 'Log In With Telegram'; + var btnRadius = parseInt(options.radius, 10) || 23; + var tooltipText = options.tooltip_text || 'Please install Telegram to use this option.'; + var tooltipForce = options.tooltip_force || false; + var tooltipPos = options.tooltip_position; + if (tooltipPos == 'top') { + var tooltipWrapClass = 'tooltip-top'; + } else if (tooltipPos == 'left') { + var tooltipWrapClass = 'tooltip-left'; + } else if (tooltipPos == 'right') { + var tooltipWrapClass = 'tooltip-right'; + } else { + var tooltipWrapClass = 'tooltip-bottom'; + } + var btnStyle = '' + + '.telegram-passport {' + + 'display: inline-block;' + + 'position: relative;' + + 'max-width: 100%;' + + '}' + + 'button.telegram-passport-button {' + + 'display: inline-block;' + + 'vertical-align: top;' + + 'font-family: "Lucida Grande", Arial, Helvetica, sans-serif;' + + 'font-size: 16px;' + + 'font-weight: 500;' + + 'line-height: 20px;' + + 'text-align: left;' + + 'border-radius: ' + btnRadius + 'px;' + + 'background-color: #54a9eb;' + + 'text-decoration: none;' + + 'padding: 12px 21px 14px;' + + 'margin: 0;' + + 'white-space: nowrap;' + + 'text-overflow: ellipsis;' + + 'overflow: hidden;' + + 'border: none;' + + 'color: #fff;' + + 'cursor: pointer;' + + 'max-width: 100%;' + + '}' + + 'button.telegram-passport-button:focus {' + + 'outline: none;' + + '}' + + '.telegram-passport-tooltip-wrap {' + + 'position: absolute;' + + 'pointer-events: none;' + + 'text-align: center;' + + 'z-index: 100;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-bottom {' + + 'left: -500px;' + + 'right: -500px;' + + 'top: 100%;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-top {' + + 'left: -500px;' + + 'right: -500px;' + + 'bottom: 100%;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-left {' + + 'right: 100%;' + + 'top: 7px;' + + 'bottom: 7px;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-right {' + + 'left: 100%;' + + 'top: 7px;' + + 'bottom: 7px;' + + '}' + + '.telegram-passport-tooltip {' + + 'position: relative;' + + 'font-family: "Lucida Grande", Arial, Helvetica, sans-serif;' + + 'background: #949494;' + + 'color: #fff;' + + 'white-space: nowrap;' + + 'border-radius: ' + btnRadius + 'px;' + + 'padding: 7px 16px;' + + 'display: inline-block;' + + 'font-size: 14px;' + + 'line-height: 18px;' + + 'text-decoration: none;' + + 'pointer-events: none;' + + 'visibility: hidden;' + + 'opacity: 0;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-bottom .telegram-passport-tooltip {' + + 'margin-top: 32px;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-top .telegram-passport-tooltip {' + + 'margin-bottom: 32px;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-left .telegram-passport-tooltip {' + + 'margin-right: 32px;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-right .telegram-passport-tooltip {' + + 'margin-left: 32px;' + + '}' + + '.telegram-passport-tooltip:hover {' + + 'color: #fff;' + + 'text-decoration: none;' + + '}' + + '.telegram-passport-tooltip-shown {' + + 'transition: all .2s ease;' + + 'pointer-events: auto;' + + 'visibility: visible;' + + 'opacity: 1;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-bottom .telegram-passport-tooltip-shown {' + + 'margin-top: 16px;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-top .telegram-passport-tooltip-shown {' + + 'margin-bottom: 16px;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-left .telegram-passport-tooltip-shown {' + + 'margin-right: 16px;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-right .telegram-passport-tooltip-shown {' + + 'margin-left: 16px;' + + '}' + + '.telegram-passport-button-icon {' + + 'display: inline-block;' + + 'vertical-align: top;' + + "background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAAsCAYAAAFZD3u2AAAAAXNSR0IArs4c6QAAB+FJREFUaAXVWllsVFUYPndm2qG0Q4EipaWspSJbQRYxDWIUHyBqAgYTjUsTNBqN+qAJLg8+ugTlQeITARNQNERcXlyesAxVhOKSSGhLVyi0dDqdznTWznL9/ts5t2fuNrfTEvFP/p5//89/z52z3TJmArIsOyWtDkKZyxxEgE+SkOBMm5/rxlsSxpPpTFPrEJEqKJ4S4PfOgBSMp1QvkqmMSJCryOto6HuUsFwDwbvkRQDZb0rcLEM2JFRklFP1zJaQ0wm1t+FEmjxzQPUcioyxbPcHcyzsMOhXzhNyaZ1gMAeyYVF+visgskp2CYY0CHNzNGD42GxfWaFVKY4u9D1HQ2NGlkYO2QibdJFIgB5I3/zRLx/xXlUCgM8BQyc7QkQ5YceOerBZTGnpJBr2DkXHOK9zguIcV/JW+2IrTlDu5QZie7bdL1/oCogiorupvzpIpzMpit7ji+h0EBTxTG9yLRkTRuLq75GrlFZXj7fNf4ocMplMjqHI6JxIQE40uGZANurPghgRjjb39YI/IspAv6zhx1lv+/ALR73XJuYHiHlWQ4fpFCLRazwZb6ccH4FKgD/xgFbtpJIh0ENAw5eFksSS6Zs0cCawxTQZHA6aOOWIfaOJGCVoxltuBZRImd5gdAH0ZtPMGsVVf5T1DMUUaUVZ0QyLiYl7vkoETYkz0NJkSa0ptPaH2WAooerXLPSwirJilbcisjM/o2k0DsMSrTE68dZfvcH3Q8JqRzYNK+Ywl9P056INQ/wXXJizSnEhb1ta5KJImX+MeAw+W1sziy2cbfkAuKva8qpIYJmMDM60Dn2ICX8/ree+USUviVljQ03G6ZhYYhWh/k8HktVxcd5kZEhv20BojIUTKSxhLLRv2+JyHgCPeznoTs5rWhom/VquMdKxX52/8YNOqBEg8TtADsc06lvPIvMuYBdw9y3JhsDzgBeBIvRPazJEPiRG19AHppwMAZ8EpjSBjdjqgpIh0lJgh1HEdCYTTiTTOtWkEsHbATyuiyIIWroDcsfNsCCZIG0lg/lLEy7GVCiaDNBv8XogZmwgy17TZPBYDxww8xTlv17xK1uckYi6SxPVnN5DydQZBFI3+K+Bj5AiHwwEE+n2gbCT7LYun83cRQpp6MbnRxeS7ITFj4ZWxsK0t93vxNFEib6tbi5zONQ+G3tkpbSeKRtrS6ussnMwwq4HaEUaBxuLJhnGUNlMImhh+ogIK0hl5DSdL3giKsRmIgr7CY+t1o8Cl0L4LXADV1L7T1+IDUeSqsjtcrCttXQwsg2VqEw5n6nJRFckrh1LpU+c6xy5R5TPKnGxDROri6gypfnLQQaGybgn/XY4XTXbzeoqyzhruxWTWW4mYKgma+kJ2k4gGDYJtPlGn4wk5ribG8eSGXb07DUW1myAuN6kPSjKLR8jGfJH2eGLqn53LSjFLkt3IFb1nBAfIcksH6PiJEkj3Jm3SFwDupTzdtu8yTIOtk4M5nI6NzY2LLqOXkezPT8v6gU6ItAKmTfZA3UVfdxJcjh3NzYs/JPz1CLhVjS7RFmWzhkvA72xyHvZt+mz5qvmpxC44bdJ6516ujWO9D+VorC1wAPAG0AtdN/2ZaHHxcA9wO+Algs09BzO3laFoVfVwP3AS7yHBbaP/WeFocPbgIeBwQI7b+bWQ0Xp7ianu1Jk9yDmXmAjcDsw78QPGw7pgeDYSOdguKIap91ldyjbGK4za5VZazJJzAKpchSxEgwV8AyQFoVCINHti2WuDUeV+4QlFSVsyTxbBVEu2vXNwlSdLGjEUAD50baWingUSPvoggG3jLGOwah7IBin9cdNF/2rqz1snsfeDYuQ+BAVRXzeEUMR82H3FJCKWA+cFsA3jVhbf7hE3IwWYzO6rsbDSt0FPW/qVzUKU87RORFQBK22VMATwEltd2GfF+LJTKK1f9QdiikXrerVFW166Q6saHLXU9p8X/KiSEGHl9fRfqy1mi5+NJ5KY2Sc0TH9/U5VuZutqCyl7ct0pNuMOBd5IBqxnCMDV0ylDUSTcnt/WEqkMhRGdxCtQzFVk7zTy9OfM2JRZKs+KowcfSB6Gkiv4b3ASQFdrdJxFPcehn4uHBvX4PdTXjL+ccPQqHDhbhT2veiuFiYKRRoFrwD/eBbVkwx4uuuQenDIMKlFCTOz2KlMCFY3CIph4X+6UFSt1j1vYVoH4k93d89wJDzj1+tGBpDRZfiqqjLbNxUmYeyIX0Fhn2oNCyqMgjRd9jdg6mnWBqSLii3LrO94tD5T4OlMWo7ClGlWjFNwYRTklzbfYUmWnhcD0ux3Izj+KaMev6mNS8qZY3pmPTENpz9AUW9zRmynVNjJkyedC+p3RGUmq1uEUDzNBkcnvtFQsmL8mwJdoC21vzUS+2hFz0dhPiODKRVGAZs6g3UsmWznwUeiSTYkXG1xObUYuEsP11e9ON/jOgx2lagrgD6Oop4188t7N2DmyOX315ZfcUoO9XXAtY8O0IFBR5F0J77YrK2cVdQMfjWQHiotLSGdgz2B5d3DlEeM+oAlQfK2DffglVzcN5Jg+OcWpWsIHmdOaee+hkVNVn2FPy1u7wHfANrp02k8lwetYtoJYuWv6n7+e6C0pNjV3zEU9eCGOc0kx77n7qs5phrYJFDkAph+Dtxh4kJPrRaF9Zrob38xiqwHngLSf3TQh3X6YGXr++q/M6e7wZMmuzIAAAAASUVORK5CYII=') no-repeat;" + + 'background-size: 27px 22px;' + + 'width: 27px;' + + 'height: 22px;' + + 'margin: 0 15px -2px -5px;' + + '}' + + '.telegram-passport-tooltip:before {' + + "content: '';" + + 'display: inline-block;' + + 'position: absolute;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-bottom .telegram-passport-tooltip:before {' + + 'left: 50%;' + + 'top: 0;' + + 'border: 10px solid;' + + 'border-radius: 4px 0 0;' + + 'border-color: #949494 transparent transparent #949494;' + + 'transform: rotateZ(45deg) translate3d(-3px,5px,0);' + + 'transform-origin: 100% 0;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-top .telegram-passport-tooltip:before {' + + 'left: 50%;' + + 'bottom: 0;' + + 'border: 10px solid;' + + 'border-radius: 0 0 4px;' + + 'border-color: transparent #949494 #949494 transparent;' + + 'transform: rotateZ(45deg) translate3d(-11px,9px,0);' + + 'transform-origin: 0 100%;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-left .telegram-passport-tooltip:before {' + + 'top: 50%;' + + 'right: 0;' + + 'border: 8px solid;' + + 'border-radius: 0 2px 0 0;' + + 'border-color: #949494 #949494 transparent transparent;' + + 'transform: rotateZ(45deg) translate3d(4px,-3.5px,0);' + + 'transform-origin: 100% 0;' + + '}' + + '.telegram-passport-tooltip-wrap.tooltip-right .telegram-passport-tooltip:before {' + + 'top: 50%;' + + 'left: 0;' + + 'border: 8px solid;' + + 'border-radius: 0 0 0 2px;' + + 'border-color: transparent transparent #949494 #949494;' + + 'transform: rotateZ(45deg) translate3d(-15px,-7.5px,0);' + + 'transform-origin: 0 100%;' + + '}'; + var tooltipClass = tooltipForce ? 'telegram-passport-tooltip telegram-passport-tooltip-shown' : 'telegram-passport-tooltip'; + var btnHtml = '' + + '' + + '
' + + ''; + var btnContEl = document.createElement('div'); + btnContEl.className = 'telegram-passport'; + btnContEl.innerHTML = btnHtml; + contEl.appendChild(btnContEl); + var buttonEl = btnContEl.getElementsByTagName('button')[0]; + var tooltipEl = btnContEl.getElementsByTagName('a')[0]; + addEvent(buttonEl, 'click', function(e) { + preventDefault(e); + var options = isFunction(authDataOrFunc) ? authDataOrFunc() : authDataOrFunc; + options = options || {}; + var tooltipToggle = function(show) { + if (show) { + tooltipEl.classList.add('telegram-passport-tooltip-shown'); + } else { + tooltipEl.classList.remove('telegram-passport-tooltip-shown'); + } + }; + passportAuth(options, !tooltipForce ? tooltipToggle : null); + }); + } + + if (!window.Telegram) { + window.Telegram = {}; + } + window.Telegram.Passport = { + auth: passportAuth, + createAuthButton: createAuthButton, + }; +})(window); diff --git a/data/core.telegram.org/method/auth.checkPhone b/data/core.telegram.org/method/auth.checkPhone new file mode 100644 index 0000000000..491df9a75e --- /dev/null +++ b/data/core.telegram.org/method/auth.checkPhone @@ -0,0 +1,176 @@ + + + + + auth.checkPhone + + + + + + + + + + + + + +
+ +
+
+
+ +

auth.checkPhone

+ +

Returns information on whether the passed phone number was registered.

+

+
 Method schema is available as of layer 78. Switch »

+

Parameters

+ + + + + + + + + + + + + + + +
NameTypeDescription
phone_numberstringPhone number in the international format
+

Result

+

The method returns an auth.CheckedPhone type object with information on whether an account with such a phone number has already been registered, as well as whether invitations were sent to this number (using the auth.sendInvites method).

+

Query example

+
(auth.checkPhone "79123413132")
+=
+(auth.checkedPhone
+  phone_registered:(boolFalse)
+  phone_invited:(boolFalse)
+)
+

Possible errors

+ + + + + + + + + + + + + + + + + + + + +
CodeTypeDescription
400PHONE_NUMBER_BANNEDThe provided phone number is banned from telegram
400PHONE_NUMBER_INVALIDInvalid phone number
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/method/auth.sendCall b/data/core.telegram.org/method/auth.sendCall new file mode 100644 index 0000000000..e1f9dae2b9 --- /dev/null +++ b/data/core.telegram.org/method/auth.sendCall @@ -0,0 +1,175 @@ + + + + + auth.sendCall + + + + + + + + + + + + + +
+ +
+
+
+ +

auth.sendCall

+ +

Makes a voice call to the passed phone number. A robot will repeat the confirmation code from a previously sent SMS message.

+

{scheme}

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
phone_numberstringPhone number in the international format
phone_code_hashstringSMS-message ID
+

Result

+

Bool

+

Query example

+
(auth.sendCall "79991234567" "2dc02d2cda9e615c84")
+=
+(boolTrue)
+
+03c51564 3939370b 33323139 37363534 63643212 32643230 39616463 35313665 00343863 64e1a61b
+=
+997275b5
+

Possible errors

+ + + + + + + + + + + + + + + + + + + + + + + + + +
CodeTypeDescription
400PHONE_NUMBER_INVALIDInvalid phone number
400PHONE_CODE_HASH_EMPTYphone_code_hash was not sent
400PHONE_CODE_EXPIREDSMS expired
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/method/auth.sendInvites b/data/core.telegram.org/method/auth.sendInvites new file mode 100644 index 0000000000..cc47046287 --- /dev/null +++ b/data/core.telegram.org/method/auth.sendInvites @@ -0,0 +1,157 @@ + + + + + auth.sendInvites + + + + + + + + + + + + + +
+ +
+
+
+ +

auth.sendInvites

+ +

Saves information that the current user sent SMS-messages with invitations to its unregistered contacts.

+

{scheme}

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
phone_numbersVector<string>List of phone numbers of message recipients in the international format
messagestringMessage text
+

Result

+

Bool

+

Possible errors

+ + + + + + + + + + + + + + + +
CodeTypeDescription
400MESSAGE_EMPTYThe provided message is empty
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/method/auth.sendSms b/data/core.telegram.org/method/auth.sendSms new file mode 100644 index 0000000000..50abafa875 --- /dev/null +++ b/data/core.telegram.org/method/auth.sendSms @@ -0,0 +1,167 @@ + + + + + auth.sendSms + + + + + + + + + + + + + +
+ +
+
+
+ +

auth.sendSms

+ +

Forces sending an SMS message to the specified phone number. Use this method if auth.sentAppCode was returned as a response to auth.sendCode, but the user can't reach the device with Telegram.

+

{scheme}

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
phone_numberstringPhone number in international format
phone_code_hashstringSMS-message ID
+

Result

+

Bool

+

Possible errors

+ + + + + + + + + + + + + + + + + + + + + + + + + +
CodeTypeDescription
400PHONE_NUMBER_INVALIDInvalid phone number
400PHONE_CODE_HASH_EMPTYphone_code_hash was not sent
400PHONE_CODE_EXPIREDSMS expired
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/method/help.getProxyData b/data/core.telegram.org/method/help.getProxyData new file mode 100644 index 0000000000..c43da0ed70 --- /dev/null +++ b/data/core.telegram.org/method/help.getProxyData @@ -0,0 +1,132 @@ + + + + + help.getProxyData + + + + + + + + + + + + + +
+ +
+
+
+ +

help.getProxyData

+ + + +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/method/messages.forwardMessage b/data/core.telegram.org/method/messages.forwardMessage new file mode 100644 index 0000000000..51c03bf885 --- /dev/null +++ b/data/core.telegram.org/method/messages.forwardMessage @@ -0,0 +1,177 @@ + + + + + messages.forwardMessage + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.forwardMessage

+ +

Forwards single messages.

+

{scheme}

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
peerInputPeerUser or chat where a message will be forwarded
idintForwarded message ID
random_idlongUnique client message ID required to prevent message resending
+

Result

+

messages.StatedMessage

+

Possible errors

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeTypeDescription
400CHAT_ID_INVALIDThe provided chat id is invalid
400MESSAGE_ID_INVALIDThe provided message id is invalid
400PEER_ID_INVALIDThe provided peer id is invalid
400YOU_BLOCKED_USERYou blocked this user
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/method/messages.getMessageReactionsList b/data/core.telegram.org/method/messages.getMessageReactionsList new file mode 100644 index 0000000000..a7cd0225a1 --- /dev/null +++ b/data/core.telegram.org/method/messages.getMessageReactionsList @@ -0,0 +1,178 @@ + + + + + messages.getMessageReactionsList + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.getMessageReactionsList

+ +

Get full message reaction list

+

+
 Method schema is available as of layer 135. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
peerInputPeerPeer
idintMessage ID
reactionflags.0?stringGet only reactions of this type (UTF8 emoji)
offsetflags.1?stringOffset (typically taken from the next_offset field of the returned MessageReactionsList)
limitintMaximum number of results to return, see pagination
+

Result

+

MessageReactionsList

+

Bots can use this method

+

Related pages

+

MessageReactionsList

+

List of message reactions

+

Pagination in the API

+

How to fetch results from large lists of objects.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/method/messages.getMessagesReactions b/data/core.telegram.org/method/messages.getMessagesReactions new file mode 100644 index 0000000000..58119d44fd --- /dev/null +++ b/data/core.telegram.org/method/messages.getMessagesReactions @@ -0,0 +1,153 @@ + + + + + messages.getMessagesReactions + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.getMessagesReactions

+ + + +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/method/messages.searchGifs b/data/core.telegram.org/method/messages.searchGifs new file mode 100644 index 0000000000..b57a14a06b --- /dev/null +++ b/data/core.telegram.org/method/messages.searchGifs @@ -0,0 +1,172 @@ + + + + + messages.searchGifs + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.searchGifs

+ +

Search for GIFs

+

+
 Method schema is available as of layer 114. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
qstringText query
offsetintOffset for pagination »
+

Result

+

messages.FoundGifs

+

Possible errors

+ + + + + + + + + + + + + + + +
CodeTypeDescription
400SEARCH_QUERY_EMPTYThe search query is empty
+

Related pages

+

Pagination in the API

+

How to fetch results from large lists of objects.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/method/messages.sendBroadcast b/data/core.telegram.org/method/messages.sendBroadcast new file mode 100644 index 0000000000..503ca35f2c --- /dev/null +++ b/data/core.telegram.org/method/messages.sendBroadcast @@ -0,0 +1,145 @@ + + + + + messages.sendBroadcast + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.sendBroadcast

+ +

Sends multiple messages to contacts.

+

{scheme}

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
contactsVector<InputUser>List of user ID to whom a message will be sent
messagestringMessage text
mediaInputMediaMessage media-contents
+

Result

+

messages.StatedMessages

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/method/messages.sendReaction b/data/core.telegram.org/method/messages.sendReaction new file mode 100644 index 0000000000..836b132baa --- /dev/null +++ b/data/core.telegram.org/method/messages.sendReaction @@ -0,0 +1,185 @@ + + + + + messages.sendReaction + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.sendReaction

+ +

Send reaction to message

+

+
 Method schema is available as of layer 135. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
peerInputPeerPeer
msg_idintMessage ID to react to
reactionflags.0?stringReaction (a UTF8 emoji)
+

Result

+

Updates

+

Possible errors

+ + + + + + + + + + + + + + + + + + + + +
CodeTypeDescription
400MESSAGE_ID_INVALIDThe provided message id is invalid
400REACTION_EMPTYEmpty reaction provided
+

Bots can use this method

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL-abstract-types.html b/data/core.telegram.org/mtproto/TL-abstract-types.html new file mode 100644 index 0000000000..f9a65977e3 --- /dev/null +++ b/data/core.telegram.org/mtproto/TL-abstract-types.html @@ -0,0 +1,202 @@ + + + + + Binary serialization and abstract TL types + + + + + + + + + + + + + +
+ +
+
+
+ +

Binary serialization and abstract TL types

+ +

TL Language defines abstract data types in the spirit of a general theory of types (more accurately, Martin-Löf’s theories of dependent intuitionistic types) without specifying the values of these types should be represented in memory, when saved to disk, or transmitted over a network. In contrast, the article on binary serialization discusses the problem of effective serialization of values of abstract types. To this end, the concept of a concrete or serialized type has been defined as the sets of serializations of all possible values of the corresponding abstract type. In this case, the serializations take values in the set A of words in the alphabet A*, which consists of 2^32 characters -- 32-bit integers.

+

In order to use a TL schema (e.g. “program”) in the TL language to describe the serialization of values of abstract types, we should explain how the concrete type [T] (subset [T] of A^) is associated with the abstract type T (defined in TL), and how the values of the abstract type T correspond to the values of the concrete type [T] (i.e. the elements of [T]*).

+

Serialization is the process of constructing an element of [T] based on a value of the abstract type T. The reverse process is deserialization.

+

Values of the abstract type T may be represented in a different way. Typically, some sort of trees or graphs are used in memory or, if desired, a set of nodes may be used, each of which contains a certain tag (“node type”) and several pointers to other nodes and/or values of built-in primitive types such as int. However, for general discussions it is useful to write the values of abstract type T as a string, more specifically, an S-expression. Recall that an S-expression is either an atom (the value of a primitive type, for example, an integer or a string constant in quotation marks; or an identifier that corresponds to a built-in or defined function) or a space-delimited list of S-expressions ending in parentheses. In our case, we use S-expressions, the first element of which is a combinator identifier, while the remaining elements (the number of which depends on the combinator’s arity) are S-expressions representing elements of the chosen combinator’s fields (or parameters). Moreover, the type of the arguments’ S-expressions and the type of the S-expressions of the result (e.g. the associated expression) must match.

+

For example, for the schema

+
pair x:int y:int = Pair;
+pnil = PairList;
+pcons hd:Pair tl:PairList = PairList;
+

the following are examples of the abstract type PairList, written as S-expressions:

+
(pnil)
+(pcons (pair 2 3) (pcons (pair 9 4) (pnil)))
+

We usually write E : T (read "E of type T”) when we want to say that E is a value of type T. We assume there is a built-in type Type whose values are types. Thus, writing T : Type means that T is a type.

+

For example, we can write:

+
PairList : Type;
+(pcons (pair 2 3) (pcons (pair 9 4) (pnil))) : PairList;
+

Converting an abstract value to a serialized value, generally speaking, is straightforward (and, if desired, can be defined by induction):

+
    +
  • +

    It is the serialization of values n of the primitive type int (as a single-symbol word in the alphabet A)

    +
  • +
  • +

    The serialization of a string constant (a value of the primitive type string) is a sequence of the 32-bit numbers defined in Binary serialization.

    +
  • +
  • +

    The serialization of the S-expression (C E1 ... Er) : T, where C is a combinator with arity r with argument types T1, ..., Tr and result type T (e.g. C : T1->T2->...->Tr->T) is the concatenation of the combinator number C (a 32-bit number that unambiguously identifies the combinator, usually equal to the CRC-32 of the string of its TL description) and the serializations of the values E1 of type T1, E2 of type T2, ..., Er of type Tr.

    +
  • +
+

If we use [T] to denote the concrete type corresponding to the abstract T, and [E] to denote an element of [T] corresponding to the value E of type T, then the last rule may be written as:

+
    +
  • [T] is the combination, for each constructor of type C T1->T2->...->Tr->T (i.e. that returns a value of type T), of direct products {C} x [T1] x [T2] x ... x [Tr], where {C} is a single-element set consisting of the combinator number C. Because {C}<>{C'} when C<>C’, this defines a mutually single-valued mapping of the values of the abstract type T (written using S-expressions) to the set [T].
  • +
+

Values of the built-in clothed types Int and String and serialized as if they were defined using int x:int = Int; and string s:string = String;, i.e. the serialization of integer constant or a string is preceded by number of the int or string combinator (constructor). In S-expressions, this may be written as (int 5) or (string "Test").

+

However, what has been described above does not account for certain subtleties, such as the existence of naked types, or the difference between functions (active combinators whose application may be reduced, e.g. calculated) and constructors (passive combinators for which there are not and cannot be reduction rules). Furthermore, we have not explained how to handle polymorphic types and optional combinator parameters. We will attempt to explain this now.

+

Constants, surface values, and functional values

+

By dividing combinators into constructors and functions, we can introduce the following classes of expressions (values) of the abstract type T:

+
    +
  • +

    Constant expressions: for the types int and string, these are all integer/string constants; for T, these are all expressions like (C E1 ... Er) : T, where the combinator C : T1->T2->...->Tr->T is a constructor, and Ei : Ti is constant expressions of types Ti. In other words, a constant expression is an S-expression consisting of only constructors and constant of primitive types.

    +
  • +
  • +

    Surface expressions are expressions that outwardly contain a functional combinator whose arguments, however, are constant expressions of the appropriate types. In other words, the functional combinator is resolved only at the outer level. (This is not entirely true; see the full explanation below).

    +
  • +
  • +

    Functional expressions: These are expressions that may contain any combinators or constants at all levels.

    +
  • +
+

In practice, we most frequently need constant values (for storage and passing any data structures, in particular, responses to RPC queries) and surface expressions (for example, as RPC queries: then the functional combinator of the outer level is the name of the RPC function that we want to call, while its parameters are the arguments, which are constant values, for invoking the function). In some cases, arbitrary functional expressions are helpful (for example, it we want to remotely transmit the result of one RPC query to a different RPC query).

+

We will use c(T) to denote a subtype of the abstract type T, whose values are constant expressions of type T. Clearly, c(T) possesses approximately the same constructors as T itself (with the types of all arguments Ti replaced by c(Ti), but it does not have functional combinators.

+

Analogously, we will use f(T) to denote a subtype of T, whose values are surface expressions of type T. Clearly, the combinators of f(T) are essentially functional combinators of type T, but c() applies to the types of these combinators’ arguments: The combinator A : T1->...->Tr->T turns into A' : c(T1)->...->c(Tr)->f(T). (See the clarification of this rule below.)

+

Thus, we have defined two “functionals” c : Type -> Type and f : Type -> Type, such that forall T : Type, c(T) :- T and forall T : Type, f(T) :- T (writing T :- T' means that T is contained in T', or that T is a subtype of T').

+

We will assume that c and f are idempotent.

+

Naked types

+

From the perspective of abstract type theory, naked types (in contrast to built-in primitive types like int and string are unnecessary. However, they are extremely useful in practice.

+

Therefore, TL introduces the (partially defined) idempotent unary operator %, which turns a standard functional (e.g. an expression of type ...->Type or simply Type) into a different standard functional of the same type. If T is a type, then from an abstract theoretical point of view, %T is equivalent to c(T). In other words, the values of %T are the constant values of T. If T is a k-arity standard expression, then T : S1 -> ... -> Sk -> Type, where each Si=Type or #, then by definition %T is a k-arity standard expression with the same arity, which is defined by the equation (%T) a1 ... ak = % (T a1 ... ak).

+

When a constant value of type %T is serialized, it is first serialized as a value of type T (assuming that T is not already a naked type itself). Then the first character of the serialization is discarded (e.g. the name of the enclosing combinator). Therefore, %T is a only a valid type expression if there is not more than one constructor for %T. The expression %T, where T : S1 -> ... -> Sk -> Type, is valid, if for any choice of parameters a1 : S1, ... , ak : Sk, the type T a1 ... ak does not have more than one constructor. Using % in other instances is incorrect.

+

If for every value of the parameters a1 : S1, ..., ak : Sk, there is exactly one constructor C for T a1 ... ak, then TL allows writing C a1 ... ak instead of %T a1 ... ak or %(T a1 .. ak). In other words, in certain situations the identifier C is a synonym for %T. This is only allowed in the context of a type (when specifying the type of a combinator’s field or result).

+

Moreover, it is assumed that %Int = int and %String = string.

+

! modifier

+

In TL, the idempotent operator ! can modify any type, actually making surface values be allowed when its constant values are serialized. However, if T is a standard function like S1->..->Sr->Type, then !T is defined using the equation (!T) a1 ... ar = !(T a1 ... ar), for any a1:S1, ..., ar:Sr.

+

The ! operator is only allowed in a definition of the types of fields of functional combinators. It is usually used as a type prefix, for example:

+
set_timeout {X:Type} timeout:int f:!X = X;
+

In this case, the set_timeout “wrapper” is defined. It takes two explicit parameters: the integer timeout and a surface expression of type X. X : Type is itself an implicit parameter (it is not explicitly stated, rather it is inferred from the values of the other parameters and their types). A similar kind of wrapper may be helpful for modifying the action of RPC queries (which are surface expressions of various types). For example, suppose we have the function

+
factorial n:int = int;
+

then we can wrap the RPC query (factorial 100) as follows: (set_timeout 200 (factorial 100)). This expression is still a surface value of type int, which means it can be passed as an RPC query.

+

A consecutive pair of two computations is another example:

+
pair {X Y : Type} x:X y:Y = Pair X Y;  // constructor
+seq_pair {X Y : Type} x:!X y:!Y = Pair X Y; // functional wrapper for sequential computation
+par_pair {X Y : Type} x:!X y:!Y = Pair X Y; // functional wrapper for parallel computation
+

Now the RPC query (seq_pair (factorial 2) (factorial 3)) : Pair int int first calculates factorial 2, then factorial 3, and returns the pair (pair 2 6). In this case, the sequence of operations isn’t important, because they do not have side effects. It would have been just as well to use (par_pair (factorial 2) (factorial 3)). However, this is not always the case.

+

We can also define an analogy to a “comma” operation:

+
comma {X Y : Type} x:!X y:!Y = Y;
+

For example, this operation could first calculate x, then forget the result, calculate y, and return y.

+

Note that the semantics of the seq_pair, par_pair and comma wrappers are indeed defined where they are implemented (like the semantics of all other functional combinators), not by their TL declaration.

+

In principle, polymorphic wrappers like set_timeout can also be applied, for example, to “annotate” a RPC response’s constant values. For example, the server might return a response to a query together with the time it was calculated. However, a value of type !X must be constant, because that is what is expected as the enclosing expression’s value. In other words, set_timeout 239 E is a constant/surface value of type X if and only if E is such itself.

+

$ modifier

+

The idempotent modifier $ permits the use of arbitrary functional values of an appropriate type in contexts where only constants or surface values are usually allowed. It recursively transforms all combinators for all of the types involved, canceling the action of % and affixing $ to the parameter types and result of all combinators ($ is also added to the front of the transformed combinators). Moreover, built-in types are also transformed (in the final stage): $int = Int and $string = String.

+

This may be useful to create an RPC query that performs a “deep computation” of the expression passed to it:

+
compute {X:Type} expr:$X = X;
+

For example, now we can transmit the following as an RPC query:

+
(compute ($factorial ($factorial (int 3)))) : int
+

(Note that the three has become clothed; the combinator $factorial has type $int -> $int).

+

This is very powerful tool. It does not have to be implemented in very simple versions of TL. $ is not encountered in currently used TL schemas.

+

More on modifiers

+

In fact, at least in terms of its application to serialization, the TL language by default implies the c() modifier around all combinators’ parameter types and results, while ! and $ cancel it (more accurately, ! only cancels, and in some sense $ reverses the meaning). This is why there is no explicit c() modifier in TL and why it is assumed that all functions only accept constant values and return constant results, unless otherwise specified.

+

You may think that some functional combinators may have a type such as partial_factorial n:int = $int; and that the RPC query (partial_factorial 3) might then unexpectedly return ($product (int 3) ($product (int 2) ($product (int 1) (int 1)))) : $int ...

+

It is probably more correct to think about the ! modifier as follows. All types initially include only constant values (and only constructors). The ! modifier makes a new type (it’s twin) out of each type. This new type has no inherent constructors. Functional combinators differ from constructors in that ! is implicitly added in front of their result’s type. After this, the (local or remote) process of calculating the expression can be represented using the polymorphic function eval : !X -> X.

+

Optional combinator parameters and their values

+

See Optional combinator parameters and their values.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL-combinators.html b/data/core.telegram.org/mtproto/TL-combinators.html new file mode 100644 index 0000000000..8d7faee14f --- /dev/null +++ b/data/core.telegram.org/mtproto/TL-combinators.html @@ -0,0 +1,251 @@ + + + + + Formal description of TL combinators + + + + + + + + + + + + + +
+ +
+
+
+ +

Formal description of TL combinators

+ +

Formal declaration of TL combinators

+

Main article: Formal description of TL. See also TL Language.

+

Combinators in TL are declared as follows:

+
+

combinator-decl ::= full-combinator-id { opt-args } { args } = result-type ;
+full-combinator-id ::= lc-ident-full | _
+combinator-id ::= lc-ident-ns | _
+opt-args ::= { var-ident { var-ident } : [excl-mark] type-expr }
+args ::= var-ident-opt : [ conditional-arg-def ] [ ! ] type-term
+args ::= [ var-ident-opt : ] [ multiplicity *] [ { args } ]
+args ::= ( var-ident-opt { var-ident-opt } : [!] type-term )
+args ::= [ ! ] type-term
+multiplicity ::= nat-term
+var-ident-opt ::= var-ident | _
+conditional-arg-def ::= var-ident [ . nat-const ] ?
+result-type ::= boxed-type-ident { subexpr }
+result-type ::= boxed-type-ident < subexpr { , subexpr } >

+
+

We shall clarify what all this means.

+
    +
  • +

    A combinator identifier is either an identifier starting with a lowercase Latin letter (lc-ident), or a namespace identifier (also lc-ident) followed by a period and another lc-ident. Therefore, cons and lists.get are valid combinator identifiers.

    +
  • +
  • +

    A combinator has a name, also known as a number (not to be confused with the designation) -- a 32-bit number that unambiguously determines it. It is either calculated automatically (see below) or it is explicitly assigned in the declaration. To do this, a hash mark (#) and exactly 8 hexadecimal digits -- the combinator’s name -- are added to the identifier of the combinator being defined.

    +
  • +
  • +

    A combinator’s declaration begins with its identifier, to which its name (separated by a hash mark) may have been added.

    +
  • +
  • +

    After the combinator identifier comes the main part of the declaration, which consists of declarations of fields (or variables), including an indication of their types.

    +
  • +
  • +

    First come declarations of optional fields (of which there may be several or none at all). Then there are the declarations of the required fields (there may not be any of these either).

    +
  • +
  • +

    Any identifier that begins with an uppercase or lowercase letter and which does not contain references to a namespace can be a field (variable) identifier. Using uc-ident for identifiers of variable types and lc-indent for other variables is good practice.

    +
  • +
  • +

    Next a combinator declaration contains the equals sign (=) and the result type (it may be composite or appearing for the first time). The result type may be polymorphic and/or dependent; any fields of the defined constructor’s fields of type Type or # may be returned (as subexpressions).

    +
  • +
  • +

    A combinator declaration is terminated with a semicolon.

    +
  • +
+

In what follows, a constructor’s fields, variables, and arguments mean the same thing.

+

Optional field declarations

+
    +
  • +

    These have the form { field_1 ... field_k : type-expr }, where field_i is a variable (field) identifier that is unique within the scope of the combinator declaration, and type-expr is a type shared by all of the fields.

    +
  • +
  • +

    If k>1, this entry is functionally equivalent to { field_1 : type-expr } ... { field_k : type-expr }.

    +
  • +
  • +

    All optional fields must be explicitly named (using _ instead of field_i is not allowed).

    +
  • +
  • +

    Moreover, at present the names of all optional fields must share the combinator’s result type (possibly more than once) and themselves be of type # (i,e., nat) or Type. Therefore, if the exact result type is known, it is possible to determine the values of all of the combinator’s implicit parameters (possibly obtaining a contradiction of the form 2=3 in doing so, which means that the combinator is not allowed in the context).

    +
  • +
+

Required field declarations

+
    +
  • +

    These may have the form ( field_1 ... field_k : type-expr ), similar to an optional field declaration, but with parentheses. This entry is equivalent to ( field_1 : type-expr ) ... ( field_k : type-expr ), where the fields are defined one at a time.

    +
  • +
  • +

    The underscore sign (_) can be used as names of one or more fields (field_i), indicating that the field is anonymous (the exact name is unimportant).

    +
  • +
  • +

    One field may be declared without outer parentheses, like this: field_id : type-expr. Here, however, if type-expr is a complex type, parentheses may be necessary around type-expr (this is reflected in BNF).

    +
  • +
  • +

    Furthermore, one anonymous field may be declared using a type-expr entry, functionally equivalent to _ : type-expr.

    +
  • +
  • +

    Required field declarations follow one after another, separated by spaces (by any number of whitespace symbols, to be more precise).

    +
  • +
  • +

    The declared field’s type (type-expr) may use the declared combinator’s previously defined variables (fields) as subexpressions (i.e. parameter values). For example:

    +

    nil {X:Type} = List X; +cons {X:Type} hd:X tl:(list X) = List X; +typed_list (X:Type) (l : list X) = TypedList;

    +
  • +
+

Repetitions

+
    +
  • +

    These may only exist among required parameters. They have the form [ field-id : ] [ multiplicity * ] [ args ], where args has the same format as the combinator’s declaration of (several) required fields, except that all of the enclosing combinator’s previously declared fields may be used in the argument types.

    +
  • +
  • +

    The name of a field of an enclosing combinator that receives a repetition as a value may be specified (field-id), or bypassed, which is equivalent to using the underscore sign as a field-id.

    +
  • +
  • +

    The multiplicity field is an expression of the type # (nat), which can be a real constant, the name of a preceding field of type #, or an expression in the form ( c + v ), where c is a real constant and v is the name of a field of type #. The sense of the multiplicity field is to provide the length of the (repetition) vector, each element of which consists of values of the types enumerated in args.

    +
  • +
  • +

    The multiplicity field may be bypassed. In this case, the last preceding parameter of type # from the enclosing combinator is used (it must be).

    +
  • +
  • +

    Functionally, the repetition field-id : multiplicity * [ args ] is equivalent to the declaration of the single field ( field-id : %Tuple %AuxType multiplicity ), where aux_type is an auxiliary type with a new name defined as aux_type *args* = AuxType. If any of the enclosing type’s fields are used within args, they are added to the auxiliary constructor aux_type and to its AuxType result type as the first (optional) parameters.

    +
  • +
  • +

    If args consists of one anonymous field of type some-type, then some-type can be used directly instead of %AuxType.

    +
  • +
  • +

    If during implementation the repetitions are rewritten as indicated above, it is logical to use instead of aux_type and AuxType, some identifiers that contain the name of the outer combinator being defined and the repetition’s index number inside its definition.

    +
  • +
+

Example:

+
matrix {m n : #} a : m* [ n* [ double ] ] = Matrix m n;
+

is functionally equivalent to

+
aux_type {n : #} (_ : %Tuple double n) = AuxType n;
+matrix {m : #} {n : #} (a : %Tuple %(AuxType n) m) = Matrix m n;
+

Moreover, the built-in types Tuple and Vector could be defined as:

+
tnil {X : Type} = Tuple X 0;
+tcons {X : Type} {n : #} hd:X tl:%(Tuple X n) = Tuple X (S n);
+vector {X : Type} (n : #) (v : %(Tuple X n)) = Vector X;
+

Actually, the following equivalent entry is considered the definition of Vector (i.e. it is specifically this entry that is used to compute the name of the vector constructor and its partial applications):

+
vector {t : Type} # [ t ] = Vector t;
+

If we expand it using Tuple, we obtain the previous definition exactly.

+

Conditional fields

+

The construction

+
+

args ::= var-ident-opt : [ conditional-arg-def ] [ ! ] type-term
+conditional-arg-def ::= var-ident [ . nat-const ] ?

+
+

permits assigning fields which are only present if the value of a preceding mandatory or optional field of type # is not null (or if its chosen bit is not zero if the special binary bit-selection operator . is applied). +Example:

+
+

user {fields:#} id:int first_name:(fields.0?string) last_name:(fields.1?string) friends:(fields.2?%(Vector int)) = User fields;
+get_users req_fields:# ids:%(Vector int) = Vector %(User req_fields)

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL-dependent.html b/data/core.telegram.org/mtproto/TL-dependent.html new file mode 100644 index 0000000000..ceb88d2f1e --- /dev/null +++ b/data/core.telegram.org/mtproto/TL-dependent.html @@ -0,0 +1,236 @@ + + + + + TL-dependent + + + + + + + + + + + + + +
+ +
+
+
+ +

TL-dependent

+ +

Main article: TL Language.

+

In certain cases, types may depend not only on other types (polymorphism), but also on the parameters of another type (dependent types). The TL language provides very limited support for this functionality: dependence is only allowed on a natural parameter whose type is designated using # (alias nat, but this is private -- TL doesn’t currently support this synonym). Values of type # are serialized as 32-bit signed numbers from 0 to 2^31-1.

+

Example: integer tuples (vectors)

+

Suppose we want to use induction to define the types “one integer”, “two integers”, and “three integers”. We could try to define them as follows:

+
empty = Empty;
+single x:int = Single;
+pair x:int y:int = Pair;
+triple x:int y:int z:int = Triple;
+quadruple x:int y:int z:int t:int = Quadruple;
+...
+

or as:

+
empty = Empty;
+single x:int empty = Single;
+pair x:int y:single = Pair;
+triple x:int yz:pair = Triple;
+quadruple x:int yzt:triple = Quadruple;
+

or as:

+
tnil = Tuple0;
+tcons0 hd:int tl:Tuple0 = Tuple1;
+tcons1 hd:int tl:Tuple1 = Tuple2;
+tcons2 hd:int tl:Tuple2 = Tuple3;
+...
+tcons_n hd:int tl:Tuple_n = Tuple_(n+1)
+

The first two variations lead to the same serialization. For example, (2 3 9):%triple and (2 (3 9)):%triple serialize as three 32-bit numbers: 2 3 9. The last variation better emphasizes the inductive version of the definition, but it uses boxed types. This is good from a theoretical perspective, but it leads to “superfluous” constructor names in serialization.

+

Therefore, we will write %Type-Ident to indicate the bare type that corresponds to the boxed type Type-Ident with a single constructor. If this constructor is named constructor, then according to the definition %Type-Ident = %constructor. Now we can write our definition like this:

+
tnil = Tuple0;
+tcons_n hd:int tl:%Tuple_n = Tuple_(n+1)
+

If we now abstract n out of the name of the type name and make it like a parameter for a polymorphic (dependent, to be more exact) type, then something like the following can be written in a suitable functional language:

+
NewType Tuple (n : #) :=
+| tnil = Tuple 0
+| tcons n:# hd:int tl:%(Tuple n) = Tuple (S n)
+EndType;
+

In the TL language, it looks like this:

+
tnil = Tuple 0;
+tcons {n:#} hd:int tl:%(Tuple n) = Tuple (S n);
+

The function S : # -> # and the constant O : # (it is 0) are the function for the next natural number (S n = n + 1) and the constant null. Therefore, the type # (alias nat) behaves as if it were defined in TL using the constructors

+
O = nat;
+S nat = nat;
+

or, using syntax more typical of other functional languages,

+
NewType nat :=
+| O
+| S nat
+EndType;
+

Types of all defined combinators:

+
O : #
+S : # -> #
+Tuple : # -> Type
+tnil : Tuple 0
+tcons : forall n : #, int -> Tuple n -> Tuple (S n)
+

or

+
Tuple : forall n : #, Type;
+tcons : forall n : #, forall hd : int, forall tl : Tuple n, Tuple (S n)
+

Note that in this case the constructor tnil does not depend on the parameter n, while tcons does.

+

In an analogous manner, it is possible to define a complete binary tree of height h with strings in the leaf nodes:

+
tleaf value:string = BinTree 0;
+tnode {h:#} left:(BinTree h) right:(BinTree h) = BinTree (S h);
+

Or a random tree whose leaf nodes are all a distance of h from the root and whose nodes are all labeled with integers:

+
hleaf value:int = Tree 0;
+hnode {n:#} left:(Tree n) next:(Tree (S n)) = Tree (S n)
+hnil {n:#} = Tree (S n)
+

Another version:

+
hleaf' value:int = Tree' 0;
+hnode' {n:#} children:(list (Tree' n)) = Tree' (S n)
+

Polymorphic dependent types

+

Let us try to define a type Tuple X n whose values are n-tuples of type X values. In this way, Tuple will be simultaneously polymorphic and dependent:

+
Tuple : Type -> # -> Type;
+

In the familiar syntax of functional languages:

+
NewType Tuple {X : Type} {n : #} :=
+| vnil : Tuple X 0
+| vcons {n:#} hd:X tl:%(Tuple X n) : Tuple X (S n)
+EndType
+

or, in TL syntax,

+
vnil {X:Type} = Tuple X 0;
+vcons {X:Type} {n:#} tl:(%Tuple X n) = Tuple X S n
+

In the end we obtain terms for the following types:

+
vnil : forall X : Type, Tuple X 0
+vcons : forall X : Type, forall n : #, X -> Tuple X n -> Tuple X (S n)
+

or

+
vnil : forall X : Type, Tuple X 0
+vcons : forall X : Type, forall n : #, forall hd : X, forall tl : Tuple X n, Tuple X (S n)
+

Dependent sums

+

The Tuple we just defined differs from the built-in Vector type. Specifically, the Vector type formally depends on a single argument (a type), but our Tuple depends on two (a type and a number):

+
Tuple : Type -> # -> Type;
+Vector : Type -> Type;
+

The built-in Vector could be defined in terms of our Tuple using “summing across all n : #":

+
vector {X:Type} n:# v:(%Tuple X n) = Vector X;
+

Nevertheless, our Tuple has its advantages. For example, we can define data types such as:

+
matrix_10x10 a:(%Tuple (%Tuple double 10) 10) = Matrix_10x10;
+

In any event, remember that during calculation of the matrix_10x10 combinator’s number, all parentheses must be removed and the CRC32 of the string matrix_10x10 a:%Tuple %Tuple double 10 10 = Matrix_10x10 must be computed.

+

Moreover, we can define arbitrarily-sized matrices:

+
matrix {X:Type} m:# n:# a:(%Tuple (%Tuple X m) n) = Matrix X;
+

In this case using vector would result in storing the length of a row (m) in each row, e.g. n times.

+

Note that the serializations of values of type %Tuple X n and vector X (also known as %vector X and %Vector X) nearly match when n > 0: in both cases we obtain a single 32-bit number (equal to n-1 or n depending on the version) followed by the serializations of n objects of type X. (This is slightly untrue: values of type %Tuple X n can only be serialized if n is a constant or value known from one of the preceding fields of the enclosing entry; but then this n won’t be serialized explicitly anywhere).

+

Special syntax for repetitions

+

In view of the importance of the construction presented above, it is built into the TL language in the following manner. A substructure in the form of [ array-field-name ":" ] [ nat-ident "" ] "[" field-descr ... "]” may be used in the declaration of any combinator, where nat-ident* is the name of any previously encountered field of type # (if it is not explicitly indicated, the most recent is used). In abstract, this substructure is equivalent to:

+
aux_type *field-descr* ... = AuxType;
+*current_constructor* ... [ *array-field-name* ":" ] (%Tuple aux_type *nat-ident*)
+

For example, 10x10 matrices, vectors, and arbitrary matrices may be defined in the following way:

+
matrix {X:Type} m:# n:# a:n*[ m*[ X ] ] = Matrix X;
+matrix_10x10 a:10*[ 10*[ double ]] = Matrix_10x10;
+vector {X:Type} # [ X ] = Vector X;
+

We have already encountered the last version as a “definition” of the “built-in type” Vector.

+

Of course, several fields, as complex as desired, may be within the repeating part. Furthermore, besides using n as a repeat counter, one may use expressions of the form (n+const) and (const+n), where const is a small nonnegative constant, which are shorthand for S (S ( ... (S n) ... )):

+
repeat_np1 n:# a:(S n)*[ key:string value:string ] = Dictionary;
+

To calculate the CRC32 these expressions are converted to expressions of the form (const+X) without internal spaces. Additionally, the * in this case is not set off by spaces on the left and right.

+

Serialization of dependent types

+

Serialization of dependent types and polymorphic types is not a fundamental challenge: we have combinators with non-zero arity with Type values. For example, the type Tuple double 10 : Type serializes to 'Tuple' '%double' 10. Note that at present in practice there is virtually no need to serialize types, whether dependent or not.

+

Optional combinator parameters in TL

+

Optional combinator parameters in TL must possess the following properties:

+
    +
  • +

    Optional parameters must be precisely ythe combinator’s first several arguments;

    +
  • +
  • +

    The value of any optional parameter must be entirely determined by the combinator’s result type.

    +
  • +
+

For example, in cons {X:Type} hd:X tl:(list X) = list X the parameter X may be made optional, because it is located at the very beginning of the argument list and is unambiguously determined by the list X result type. Similarly, in tcons {X:Type} {n:#} hd:X tl:(%Tuple X n) = Tuple X (S n) the values of X and n are completely determined based on the Tuple X (S n) result type, therefore they made be made optional parameters.

+

It usually makes sense to move all of a constructor’s arguments satisfying the second condition to the beginning of the list, arrange them in the order they appear in the result type’s parameters, and make them optional. Given such an approach, the full version of a constructor is rarely needed -- only when we want to transmit the value of the polymorphic or dependent type as a value of type Object. In all other cases, the type of the expected value from the context is already known, which means that all optional parameters can be recovered during decomposition.

+

See also Optional combinator parameters and their values.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL-formal.html b/data/core.telegram.org/mtproto/TL-formal.html new file mode 100644 index 0000000000..5c7e52adea --- /dev/null +++ b/data/core.telegram.org/mtproto/TL-formal.html @@ -0,0 +1,319 @@ + + + + + TL-formal + + + + + + + + + + + + + +
+ +
+
+
+ +

TL-formal

+ +

See also TL Language. +For the syntax of declaring combinators, see in article Formal declaration of TL combinators. +For the syntax of patterns, see in article Formal declaration of TL patterns.

+

Tokens

+

Comments are the same as in C/C++. They are removed by a lexical parser (for example, being replaced by a single space). Whitespace separates tokens. Except for string constants, tokens cannot contain spaces.

+

Character classes:

+
+

lc-letter ::= a | b | ... | z
+uc-letter ::= A | B | ... | Z
+digit ::= 0 | 1 | ... | 9
+hex-digit ::= digit | a | b | c | d | e | f
+underscore ::= _
+letter ::= lc-letter | uc-letter
+ident-char ::= letter | digit | underscore

+
+

Simple identifiers and keywords:

+
+

lc-ident ::= lc-letter { ident-char }
+uc-ident ::= uc-letter { ident-char }
+namespace-ident ::= lc-ident
+lc-ident-ns ::= [ namespace-ident . ] lc-ident
+uc-ident-ns ::= [ namespace-ident . ] uc-ident
+lc-ident-full ::= lc-ident-ns [ # hex-digit *8 ]

+
+

Tokens:

+
+

underscore ::= _
+colon ::= :
+semicolon ::= ;
+open-par ::= (
+close-par ::= )
+open-bracket ::= [
+close-bracket ::= ]
+open-brace ::= {
+close-brace ::= }
+triple-minus ::= ---
+nat-const ::= digit { digit }
+lc-ident-full
+lc-ident
+uc-ident-ns
+equals ::= =
+hash ::= #
+question-mark ::= ?
+percent ::= %
+plus ::= +
+langle ::= <
+rangle ::= >
+comma ::= ,
+dot ::= .
+asterisk ::= *
+excl-mark ::= !
+Final-kw ::= Final
+New-kw ::= New
+Empty-kw ::= Empty

+
+

Final is a reserved keyword, e.g. a special token. Words like Type are not keywords, rather they are identifiers with preset values.

+

Tokens consisting of one or more constant symbols shall be hereafter denoted using terms in quotation marks (for example, --- replaces triple-minus).

+

Syntax

+

General syntax of a TL program

+

Syntactically, a TL program consists of a stream of tokens (separated by spaces, which are ignored at this stage). General program structure:

+
+

TL-program ::= constr-declarations { --- functions --- fun-declarations | --- types --- constr-declarations }

+
+

Here the constructor- and function declarations are nearly identical in their syntax (they are both combinators):

+
+

constr-declarations ::= { declaration }
+fun-declarations ::= { declaration }

+
+

There are various declarations:

+
+

declaration ::= combinator-decl | partial-app-decl | final-decl

+
+

Before explaining how declarations of combinators, partial applications, and type finalization are given, we will introduce additional syntactical categories:

+

Syntactical categories and constructions

+

The concept of an expression (expr) is important. There are type expressions (type-expr) and numeric expressions (nat-expr). However, they are defined the same way. Their correctness as type- or numeric expressions is checked when the type of the analyzed expression is checked.

+
+

type-expr ::= expr
+nat-expr ::= expr
+expr ::= { subexpr }
+subexpr ::= term | nat-const + subexpr | subexpr + nat-const
+term ::= ( expr ) | type-ident | var-ident | nat-const | % term | type-ident < expr { , expr } >
+type-ident ::= boxed-type-ident | lc-ident-ns | #
+boxed-type-ident ::= uc-ident-ns
+var-ident ::= lc-ident | uc-ident
+type-term ::= term
+nat-term ::= term

+
+

Note that writing E = E_1 E_2 ... E_n in the expression for expr means applying the function E_1 to the argument E_2, applying the result to E_3, etc. Specifically, E_1 E_2 E_3 = (E_1 E_2) E_3. A solitary # is included in type-ident, because it is actually the identifier for a built-in type (# alias nat).

+

The expression E<E_1,...,E_n> is syntactic sugar for (E (E_1) ... (E_n)), i.e. both expressions are transformed into the same internal representation.

+

Combinator declarations

+
+

combinator-decl ::= full-combinator-id { opt-args } { args } = result-type ;
+full-combinator-id ::= lc-ident-full | _
+combinator-id ::= lc-ident-ns | _
+opt-args ::= { var-ident { var-ident } : [excl-mark] type-expr }
+args ::= var-ident-opt : [ conditional-def ] [ ! ] type-term
+args ::= [ var-ident-opt : ] [ multiplicity *] [ { args } ]
+args ::= ( var-ident-opt { var-ident-opt } : [!] type-term )
+args ::= [ ! ] type-term
+multiplicity ::= nat-term
+var-ident-opt ::= var-ident | _
+conditional-def ::= var-ident [ . nat-const ] ?
+result-type ::= boxed-type-ident { subexpr }
+result-type ::= boxed-type-ident < subexpr { , subexpr } >

+
+

See Formal declaration of TL combinators for a description of what exactly this means. Here we will only note that when declaring the type of a combinator’s next argument, only the names of previously arranged (more to the left) arguments of the same combinator may be used as variables, but when declaring the result type you can use all of its parameters (of type Type and #).

+

Note that the names of combinators declared in this way may be used in TL itself only as the corresponding bare types. The only combinators that appear in declarations are built-in: O : # and S : # -> #.

+

There are also “pseudo-declarations” that are allowed only to declare built-in types (such as int ? = Int;):

+
+

builtin-combinator-decl ::= full-combinator-id ? = boxed-type-ident ;

+
+

Partial applications (patterns)

+
+

partial-app-decl ::= partial-type-app-decl | partial-comb-app-decl
+partial-type-app-decl ::= boxed-type-ident subexpr { subexpr } ; | boxed-type-ident < expr { , expr } > ;
+partial-comb-app-decl ::= combinator-id subexpr { subexpr } ;

+
+

See Formal declaration of TL patterns.

+

Type finalization

+
+

final-decl ::= New boxed-type-ident ; | Final boxed-type-ident ; | Empty boxed-type-ident ;

+
+

This type of declaration means that there must not be any constructor for the indicated type: before the declaration for New and after the declaration for Final. The keyword Empty enables both effects.

+

Predefined identifiers

+

Nearly all predefined identifiers may be given using the following schema (usually located in common.tl):

+
+

/////
+//
+// Common Types
+//
+/////

+

// Built-in types
+int ? = Int;
+long ? = Long;
+double ? = Double;
+string ? = String;

+

// Boolean emulation
+boolFalse = Bool;
+boolTrue = Bool;

+

// Boolean for diagonal queries
+boolStat statTrue:int statFalse:int statUnknown:int = BoolStat;

+

// Vector
+vector {t:Type} # [t] = Vector t;
+tuple {t:Type} {n:#} [t] = Tuple t n;
+vectorTotal {t:Type} total_count:int vector:%(Vector t) = VectorTotal t;

+

/////
+//
+// Result- (Maybe-) types
+//
+/////

+

resultFalse {t:Type} = Maybe t;
+resultTrue {t:Type} result:t = Maybe t;

+

pair {X:Type} {Y:Type} a:X b:Y = Pair X Y;
+map {X:Type} {Y:Type} key:X value:Y = Map X Y;

+

Empty False;
+true = True;

+

unit = Unit;

+
+
    +
  • +

    Predefined identifier Type: This type signifies the type of all types. It is usually used to specify the types of optional parameters in the constructors of polymorphic types. If strongly desired, it can be used in its own right, but this is very rarely needed in practice.

    +
  • +
  • +

    Identifier #: This type is used to specify a special type of nonnegative integers in the range from 0 to 2^31-1; its main purpose is the same as that of Type. There are two built-in constructors: O : # and S : # -> # (“null” and “next number”, respectively), which work as if # was defined using the schema

    +
  • +
+
+

O = #;
+S # = #;

+
+
    +
  • +

    Identifier Tuple: Type -> # -> Type denotes a set of the specified number of values of the indicated type. In other words, Tuple X n means “a set of n values of type X".

    +
  • +
  • +

    The typeBool, with two constructors boolTrue and boolFalse, is used to transmit Boolean values.

    +
  • +
  • +

    The constructor-less type False may be used instead of undeclared or invalid types in the construction of a TL schema, because any attempt to (de)serialize a value of type False will produce an error. Usage Example:

    +
  • +
+
+

user {flags:#} id:flags.0?string first_name:flags.1?string last_name:flags.2?string reserved3:flags.3?False reserved4:flags.4?False = User flags;
+user_present {flags:#} info:%(User flags) = UserInfo flags;
+user_absent {flags:#} = UserInfo flags;
+getUser flags:# id:int = !UserInfo flags;

+
+

In the future, bits 3 and 4 in the flags field may be used to transmit new fields after changing the names and types of the reserved3 and reserved4 fields. This will change the user constructor’s number, but this isn’t too important, since the User flags type is only used as a bare type. Transmitting bits 3 or 4 in the flags field in a getUser query before these fields have actually been defined will lead to an error in the (de)serialization of the request.

+
    +
  • The type True with a single null constructor true plays a role similar to the void type in C/C++. It is especially useful as a bare type %True, alias true, because its serialization has zero length. For example, the first_name:flags.1?string constructor used above is in fact shorthand for (the as-yet unsupported) alternative-type general constructor first_name:(flags.1?string:true).
  • +
+

When directly used in a conditional field it may simply indicate the presence (absence) of a certain parameter with void type. +If the conditional field exists, the associated parameter will not be populated; the conditional field simply exists and the existance value can be used to perform certain operations, example:

+
user {flags:#} id:flags.0?string first_name:flags.1?string last_name:flags.2?string bot:flags.3?true reserved4:flags.4?False = User flags;
+

If bit 3 of the flags parameter isn't set, the user is a normal user. +If bit 3 of the flags parameter is set, this indicates that the specified user is a bot: however, during deserialization, the bot parameter must not be assigned any value, since true is actually a void type.

+
    +
  • The typeUnit with a single null constructor Unit is similar to the previous type.
  • +
+

ANTLR definition

+

An ANLTR definition of TL grammar can be found here ».

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL-optargs.html b/data/core.telegram.org/mtproto/TL-optargs.html new file mode 100644 index 0000000000..8b90107553 --- /dev/null +++ b/data/core.telegram.org/mtproto/TL-optargs.html @@ -0,0 +1,151 @@ + + + + + Optional combinator parameters and their values + + + + + + + + + + + + + +
+ +
+
+
+ +

Optional combinator parameters and their values

+ +

TL Language makes it possible to declare a combinator’s first few parameters optional. Subsequently, they are almost never required to be explicitly stated. This is directly related to another important property of TL: polymorphism.

+

All optional parameters are typically required to be part of the result type (at least once).

+

A (sub)expression may be serialized/deserialized in one of two ways:

+
    +
  • +

    The result type is known (for example, we’re parsing the response to a previously sent RPC query and therefore know the value of some type is expected). In this case, the result type may be used to determine the values of the combinator’s implicit parameters.

    +
  • +
  • +

    The result type is not known. It is determined as a result of (de)serialization (for example, we are serializing an RPC query). In this case, it is necessary to explicitly specify (and serialize) all of the combinator’s optional parameters by using the full version of the combinator.

    +
  • +
+

We will assume that the functional combinator only differs from the constructor in that before its result type the ! modifier is implicitly added, and the (remote or local) computation of a functional expression may be presented as the execution of some polymorphic function eval : !X -> X.

+

Moreover, the unknown result type is obviously usually (but not always) bound to the serialization of an expression whose type has been modified by !.

+

We can formulate the following rules. Let there be some constructor

+
C {a1:T1} ... {am:Tm} b1:U1 ... bn:Un = T;
+

Some of its arguments or its result may be marked with the ! modifier (We consider a functional combinator to be a constructor whose result type has been modified by an implicit !).

+

The following conditions must hold:

+
    +
  • +

    Each type T1, ..., Tm, U1, ..., Un, and T may depend on parameters of type Type or #, which have been declared to the left of the use of the given type.

    +
  • +
  • +

    The types of implicit parameters T1, ..., Tm may not be modified by !.

    +
  • +
  • +

    Only implicit parameters of type Type or # are allowed. In other words, Ti is either a Type or a #. (Unlike the previous rule, this rule may be relaxed in the future.)

    +
  • +
  • +

    Each implicit parameter a1, ..., am must be used at least once -- either within one of the Ui types that have a !, or in the result type T, if it does not have an explicit or implicit !.

    +
  • +
  • +

    If an implicit parameter ai is not used in the result type, or if the result type has a !, then its first (leftmost) usage must be within a type Uj that is modified by !.

    +
  • +
+

The idea is this: we assume that during (de)serialization of a value of a type modified by ! that we do not know this type in advance and we will find out what it is only based on the result of the (de)serialization; Conversely, we assume that during (de)serialization of a value of a type that is not modified by ! that we know this type in advance. In this case, complying with the rules stated above lets us always compute the values of all implicit parameters -- either from the (previously known) result type or from the type of one of the bj:!Uj parameters (which was obtained during the serialization process).

+

In fact, ! denotes the direction in which type information is flowing. By default, the result type is the source of information about types (and their parameters), while argument types are the recipients of that information. The use of ! reverses the direction of information flow, making the result type the recipient and the argument type the source of type information.

+

See also Binary serialization and abstract TL types and Polymorphism in TL.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL-patterns.html b/data/core.telegram.org/mtproto/TL-patterns.html new file mode 100644 index 0000000000..96d9d025f3 --- /dev/null +++ b/data/core.telegram.org/mtproto/TL-patterns.html @@ -0,0 +1,129 @@ + + + + + TL-patterns + + + + + + + + + + + + + +
+ +
+
+
+ +

TL-patterns

+ +
+

partial-app-decl ::= partial-type-app-decl | partial-comb-app-decl
+partial-type-app-decl ::= boxed-type-ident subexpr { subexpr } ; | boxed-type-ident < expr { , expr } > ;
+partial-comb-app-decl ::= combinator-id subexpr { subexpr } ;

+
+

According to the original design, templates must be used to replace concrete values in the first few or all of the optional arguments of a constructor or polymorphic type. For example, if Tuple int 10 is used frequently, you can declare a template for it, which will cause the appropriate constructors to be generated automatically. When using such a constructor there may be nowhere to pass an int type or the tuple size 10. Similarly, it was originally planned to declared templates for Vector int, Vector string, etc. in order to generate constructors for each vector type being used type. These constructors would make it possible during deserialization to determine what kind of array is being transmitted.

+

Templates are not used now. Instead, the same universal constructors (for example, vector {t:Type} [t] = Vector t) are used with the values of the optional parameters being inferred from the type of the result (if we already know from the schema that in this location there must be a Vector int during deserialization, we understand that we will see the universal vector constructor in which t is equal to int).

+

This approach is better in that it is not necessary to define Vector SomeType templates in advance for all possible types in order to generate their own constructors for each of these cases. Nevertheless, there is a drawback. If someone wants to transmit the serialization of a value of the clothed type Vector int as a serialization of a value of type Object, a problem arises during serialization: after seeing the universal vector constructor and then reading the vector length, we cannot determine what type of values should be expected next.

+

In theory, this problem can be solved by using the full form of the constructor (@vector) corresponding to vector (it is automatically defined and is different in that all of the optional parameters become required), or by defining

+
+

object X:Type X = TypedObject

+
+

and passing the object type explicitly. Type serialization is required in both cases.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL-polymorph.html b/data/core.telegram.org/mtproto/TL-polymorph.html new file mode 100644 index 0000000000..325780780c --- /dev/null +++ b/data/core.telegram.org/mtproto/TL-polymorph.html @@ -0,0 +1,170 @@ + + + + + Polymorphism in TL + + + + + + + + + + + + + +
+ +
+
+
+ +

Polymorphism in TL

+ +

It should be noted that in the TL schema of the overwhelming majority of API calls the use of polymorphic types is restricted to the Vector type. Nevertheless, having a view of the big picture is still helpful.

+

Ordinary inductive types

+

For example, let us consider the IntList, which is defined as follows:

+
int_cons hd:int tl:IntList = IntList;
+int_nil = IntList;
+

The “int_cons” and “int_nil” constructors as well as the “IntList” type itself are expressions of the following types (writing A : X means that A is an expression of type X):

+
IntList : Type;
+int_cons : int -> IntList -> IntList;
+int_nil : IntList;
+

The keyword Type is used to denote the type of all types. Note that Type is not Object (Object is the type of all terms). +Here is alternative syntax that could be used in some other functional programming language (but not in TL):

+
NewType IntList :=
+| int_cons hd:int tl:IntList
+| int_nil
+EndType
+

Polymorphic type

+

TL supports the following version (curly brackets indicate optional fields, see below):

+
cons {X:Type} hd:X tl:(List X) = List X;
+nil {X:Type} = List X
+

Here is an alternative formulation in other functional languages with dependent types:

+
NewType List {X:Type} :=
+| cons {X:Type} hd:X tl:(List X)
+| nil {X:Type}
+EndType
+

In any event, these variations are equivalent to one another from the point of view of the formal theory of types and lead to the definition of the following terms:

+
List : Type -> Type;
+cons : forall (X:Type), X -> List X -> List X;
+nil : forall (X:Type), X -> List X;
+

In each case, remember that writing “A -> B” is shorthand for “forall (x : A), B” for any variable x not entering into A and B. For example, the “cons” type could be written as follows:

+
cons : forall (X:Type), forall (hd : X), forall (tl : List X), List X
+

or more compactly:

+
cons : forall (X : Type) (hd : X) (tl : List X), List X
+

See Calculus of constructions. Examples of functional languages with dependent types, which support similar constructions are Coq and Agda.

+

In this case, the entry after a universal quantifier proves to be more content-related than that after an arrow, because the name of a variable bound by the quantifier is used to transmit the name of the corresponding field in the constructor, even if this variable is not used anywhere as it pertains to the expression under the quantifier. Structurally, all of these entries of the “cons” type are equivalent.

+

Serialization of types (values of type Type)

+

As we can see, to serialize a value of type List X, which has been obtained by applying the combinator “cons X:Type hd:X tl:(List X) = List X”, we need to:

+
    +
  1. serialize the name of the “cons” combinator into a 32-bit number;
  2. +
  3. serialize X (as a type, i.e. as a value of type Type) if X is a required parameter;
  4. +
  5. serialize the head of the list (hd) as a value of type X;
  6. +
  7. serialize the tail of the list as a value of the polymorphic type List X.
  8. +
+

In the first step, the natural question is which string exactly will be used to calculate the CRC32. It is proposed to take "cons X:Type hd:X tl:List X = List X” without the terminating semicolon and without any parentheses (closed type expressions are unambiguously reconstructed based on their construction’s prefix).

+

In the last step, we recursively resolve the very same problem of serializing a value of type List X; we will consider it resolved based on the assumption of induction in the construction of the value being serialized. We will similarly consider the third step understandable (induction in the construction of the value being serialized).

+

We still need to describe how to transmit (serialize) types, e.g. values of type Type. Types in TL schemas currently appear only as constructors’ optional parameters and are therefore never serialized explicitly. Rather, their values are inferred from the previously known type of the value being serialized.

+

For completeness we will describe how it would be possible to serialize types (values of type Type). However, keep in mind that for now this information is not useful. See Type serialization.

+

Optional arguments in polymorphic constructors

+

It was stated above that any subset of (the first few) parameters of any constructor can be identified as optional (by enclosing their declarations in curly brackets), but this is not actually entirely accurate. First, these optional parameters can only be of type Type or # (natural numbers). Second, optional parameters must share the return value’s type, otherwise their value cannot be determined.

+

Note that @'''constr-id''' means the constructor’s “full form” (in which all optional parameters become required), while '''constr-id'’ denotes its abbreviated form (without the optional arguments). If there are no optional arguments, then these two forms are the same. Constructors’ full forms are never used at present.

+

Bare polymorphic types

+

There is a small problem: if we want to serialize the value of the bare type ‘%pair string int’ or ‘%pair string Y’ (which in TL is usually denoted simply as “pair”, though the form “%Pair” is preferable), we cannot simultaneously use both the full constructor @pair and the partial pair, because the constructor’s name will not be serialized. Therefore, we must differentiate the bare types %@pair (type X, type Y, value x:X, and value y:Y are serialized) and %pair (only x:X and y:Y are serialized; types X and Y are known from the context). In practice, we nearly almost always need the bare type %pair, and this is precisely what “pair” means in the type’s context in TL. Therefore,

+
record name:string map:(List (pair int string)) = Record;
+

will be serialized approximately like we want it to be (the serialization of list elements will consist of the serialization of int and the serialization of string, without any additional headers, types, or combinator names). +Incidentally, when calculating the “record” combinator’s name 'record' in the example given above, the CRC32 of record name:string map:List pair int string = Record will be computed.

+

Also note that a more precise description of this type would be

+
record name:string map:(List %(Pair int string)) = Record
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL-tl.html b/data/core.telegram.org/mtproto/TL-tl.html new file mode 100644 index 0000000000..2e4624be35 --- /dev/null +++ b/data/core.telegram.org/mtproto/TL-tl.html @@ -0,0 +1,308 @@ + + + + + TL schema for serialization of TL schemas + + + + + + + + + + + + + +
+ +
+
+
+ +

TL schema for serialization of TL schemas

+ +

If necessary, a TL schema can be serialized in binary form. Here, this serialization format is defined by a TL schema (usually stored in the file tl.tl). This can be useful, for example, to make it possible to write a parser one time for converting a TL schema from text form (stored in the file something.tl) to binary form (stored in the file something.tlo). All other programs (for example, auto-generators of TL-(de)serializers for various programming languages) only need to know how to read .tlo files, which only requires generating an automatic deserializer according to the schema presented below.

+

First, a fragment of the file common.tl with certain required built-in types:

+
/////
+//
+// Common Types (source file common.tl, only necessary definitions included)
+//
+/////
+
+// Built-in types
+int ? = Int;
+long ? = Long;
+double ? = Double;
+string ? = String;
+
+// Boolean emulation
+boolFalse = Bool;
+boolTrue = Bool;
+
+// Vector
+vector {t:Type} # [t] = Vector t;
+tuple {t:Type} {n:#} [t] = Tuple t n;
+vectorTotal {t:Type} total_count:int vector:%(Vector t) = VectorTotal t;
+
+Empty False;
+true = True;
+

Next, properly, comes tl.tl itself. Note that the declaration for a fairly complex data type required only twenty lines in TL. This demonstrates the expressiveness and compactness of the TL language.

+
/////
+//
+// Serialized binary TL-schema in TL format, source file tl.tl
+//
+/////
+tls.schema_v2 version:int date:int types_num:# types:types_num*[tls.Type] 
+
+    constructor_num:# constructors:constructor_num*[tls.Combinator] 
+    functions_num:# functions:functions_num*[tls.Combinator] = tls.Schema;
+tls.type name:int id:string constructors_num:int flags:int arity:int params_type:long = tls.Type;
+
+tls.combinator name:int id:string type_name:int left:tls.CombinatorLeft right:tls.CombinatorRight = tls.Combinator;
+tls.combinatorLeftBuiltin = tls.CombinatorLeft;
+tls.combinatorLeft args_num:# args:args_num*[tls.Arg] = tls.CombinatorLeft;
+tls.combinatorRight value:tls.TypeExpr = tls.CombinatorRight;
+
+tls.arg id:string flags:# var_num:flags.1?int exist_var_num:flags.2?int exist_var_bit:flags.2?int type:tls.TypeExpr = tls.Arg;
+
+tls.exprType _:tls.TypeExpr = tls.Expr;
+
+tls.exprNat _:tls.NatExpr = tls.Expr;
+tls.natConst value:int = tls.NatExpr;
+
+tls.natVar dif:int var_num:int = tls.NatExpr;
+tls.typeVar var_num:int flags:int = tls.TypeExpr;
+
+tls.array multiplicity:tls.NatExpr args_num:# args:args_num*[tls.Arg] = tls.TypeExpr;
+tls.typeExpr name:int flags:int children_num:# children:children_num*[tls.Expr] = tls.TypeExpr;
+

Remarks

+

Schema serialization (version 2) always begins with the index number of the tls.schema_v2 constructor for tls.Schema. +Because the CRC32 of the string

+
tls.schema_v2 version:int date:int types_num:# types:types_num*[ tls.Type ] constructor_num:# constructors:constructor_num*[ tls.Combinator ] functions_num:# functions:functions_num*[ tls.Combinator ] = tls.Schema
+

is 0x3a2f9be2, this constant is in fact the magic number for tlo files in the current version’s format. +If the format is extended in the future (for example, if TL’s additional features are supported), then a tls.schema_v3 constructor with a different number will appear.

+

Example

+

If one adds declarations for the used built-in types (like int ? = Int;) from the file common.tl before tl.tl and serialize the resulting schema, the following binary data is obtained (tl.tlo):

+
+

0000: 3a2f9be2 00000000 51fec698 00000015 12eb4386 70659eff 00002301 00000000
+0020: 00000000 00000000 00000000 00000000 12eb4386 250be282 6f6f4204 0000006c
+0040: 00000002 02000010 00000000 00000000 00000000 12eb4386 2210c154 756f4406
+0060: 00656c62 00000001 02000000 00000000 00000000 00000000 12eb4386 00000000
+0080: 6c614605 00006573 00000000 00000401 00000000 00000000 00000000 12eb4386
+00a0: a8509bda 746e4903 00000001 02000001 00000000 00000000 00000000 12eb4386
+00c0: 22076cba 6e6f4c04 00000067 00000001 02000001 00000000 00000000 00000000
+00e0: 12eb4386 b5286e24 72745306 00676e69 00000001 02000001 00000000 00000000
+0100: 00000000 12eb4386 3fedd339 75725404 00000065 00000001 02000000 00000000
+0120: 00000000 00000000 12eb4386 9770768a 70755405 0000656c 00000001 02000000
+0140: 00000002 00000002 00000000 12eb4386 2cecf817 70795404 00000065 00000000
+0160: 00000000 00000000 00000000 00000000 12eb4386 1cb5c415 63655606 00726f74
+0180: 00000001 02000008 00000001 00000000 00000000 12eb4386 10133f47 6365560b
+01a0: 54726f74 6c61746f 00000001 02000000 00000001 00000000 00000000 12eb4386
+01c0: 29dfe61b 736c7407 6772412e 00000001 02000000 00000000 00000000 00000000
+01e0: 12eb4386 5c0a1ed5 736c740e 6d6f432e 616e6962 00726f74 00000001 02000000
+0200: 00000000 00000000 00000000 12eb4386 8133d9ba 736c7412 6d6f432e 616e6962
+0220: 4c726f74 00746665 00000002 02000010 00000000 00000000 00000000 12eb4386
+0240: 2c064372 736c7413 6d6f432e 616e6962 52726f74 74686769 00000001 02000000
+0260: 00000000 00000000 00000000 12eb4386 307d41a0 736c7408 7078452e 00000072
+0280: 00000002 02000010 00000000 00000000 00000000 12eb4386 c2635441 736c740b
+02a0: 74614e2e 72707845 00000002 02000010 00000000 00000000 00000000 12eb4386
+02c0: 3a2f9be2 736c740a 6863532e 00616d65 00000001 02000000 00000000 00000000
+02e0: 00000000 12eb4386 12eb4386 736c7408 7079542e 00000065 00000001 02000000
+0300: 00000000 00000000 00000000 12eb4386 193fd378 736c740c 7079542e 70784565
+0320: 00000072 00000003 02000010 00000000 00000000 00000000 00000018 5c0a1ed5
+0340: bc799737 6f6f6209 6c61466c 00006573 250be282 4c12c6d9 00000000 2c064372
+0360: c1863d08 250be282 00000000 00000000 5c0a1ed5 997275b5 6f6f6208 7572546c
+0380: 00000065 250be282 4c12c6d9 00000000 2c064372 c1863d08 250be282 00000000
+03a0: 00000000 5c0a1ed5 2210c154 756f6406 00656c62 2210c154 cd211f63 2c064372
+03c0: c1863d08 2210c154 00000000 00000000 5c0a1ed5 a8509bda 746e6903 a8509bda
+03e0: cd211f63 2c064372 c1863d08 a8509bda 00000000 00000000 5c0a1ed5 22076cba
+0400: 6e6f6c04 00000067 22076cba cd211f63 2c064372 c1863d08 22076cba 00000000
+0420: 00000000 5c0a1ed5 b5286e24 72747306 00676e69 b5286e24 cd211f63 2c064372
+0440: c1863d08 b5286e24 00000000 00000000 5c0a1ed5 3fedd339 75727404 00000065
+0460: 3fedd339 4c12c6d9 00000000 2c064372 c1863d08 3fedd339 00000000 00000000
+0480: 5c0a1ed5 9770768a 70757405 0000656c 9770768a 4c12c6d9 00000003 29dfe61b
+04a0: 00007401 00020005 00000000 c1863d08 2cecf817 00000000 00000000 29dfe61b
+04c0: 00006e01 00020005 00000001 c1863d08 70659eff 00000000 00000000 29dfe61b
+04e0: 00000000 00000000 d9fb20de 4e8a14f0 00000000 00000001 00000001 29dfe61b
+0500: 00000000 00000000 0142ceae 00000000 00000000 2c064372 c1863d08 9770768a
+0520: 00000000 00000002 ecc9da78 0142ceae 00000000 00000000 dcb49bd8 4e8a14f0
+0540: 00000000 00000001 5c0a1ed5 1cb5c415 63657606 00726f74 1cb5c415 4c12c6d9
+0560: 00000003 29dfe61b 00007401 00020005 00000000 c1863d08 2cecf817 00000000
+0580: 00000000 29dfe61b 00000000 00000004 00000001 c1863d08 70659eff 00000000
+05a0: 00000000 29dfe61b 00000000 00000000 d9fb20de 4e8a14f0 00000000 00000001
+05c0: 00000001 29dfe61b 00000000 00000000 0142ceae 00000000 00000000 2c064372
+05e0: c1863d08 1cb5c415 00000000 00000001 ecc9da78 0142ceae 00000000 00000000
+0600: 5c0a1ed5 10133f47 6365760b 54726f74 6c61746f 10133f47 4c12c6d9 00000003
+0620: 29dfe61b 00007401 00020005 00000000 c1863d08 2cecf817 00000000 00000000
+0640: 29dfe61b 746f740b 635f6c61 746e756f 00000000 c1863d08 a8509bda 00000001
+0660: 00000000 29dfe61b 63657606 00726f74 00000000 c1863d08 1cb5c415 00000001
+0680: 00000001 ecc9da78 0142ceae 00000000 00000000 2c064372 c1863d08 10133f47
+06a0: 00000000 00000001 ecc9da78 0142ceae 00000000 00000000 5c0a1ed5 29dfe61b
+06c0: 736c7407 6772612e 29dfe61b 4c12c6d9 00000006 29dfe61b 00646902 00000000
+06e0: c1863d08 b5286e24 00000001 00000000 29dfe61b 616c6605 00007367 00000004
+0700: 00000000 c1863d08 70659eff 00000000 00000000 29dfe61b 72617607 6d756e5f
+0720: 00000002 00000000 00000001 c1863d08 a8509bda 00000001 00000000 29dfe61b
+0740: 6978650d 765f7473 6e5f7261 00006d75 00000002 00000000 00000002 c1863d08
+0760: a8509bda 00000001 00000000 29dfe61b 6978650d 765f7473 625f7261 00007469
+0780: 00000002 00000000 00000002 c1863d08 a8509bda 00000001 00000000 29dfe61b
+07a0: 70797404 00000065 00000000 c1863d08 193fd378 00000000 00000000 2c064372
+07c0: c1863d08 29dfe61b 00000000 00000000 5c0a1ed5 5c0a1ed5 736c740e 6d6f632e
+07e0: 616e6962 00726f74 5c0a1ed5 4c12c6d9 00000005 29dfe61b 6d616e04 00000065
+0800: 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b 00646902 00000000
+0820: c1863d08 b5286e24 00000001 00000000 29dfe61b 70797409 616e5f65 0000656d
+0840: 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b 66656c04 00000074
+0860: 00000000 c1863d08 8133d9ba 00000000 00000000 29dfe61b 67697205 00007468
+0880: 00000000 c1863d08 2c064372 00000000 00000000 2c064372 c1863d08 5c0a1ed5
+08a0: 00000000 00000000 5c0a1ed5 cd211f63 736c7419 6d6f632e 616e6962 4c726f74
+08c0: 42746665 746c6975 00006e69 8133d9ba 4c12c6d9 00000000 2c064372 c1863d08
+08e0: 8133d9ba 00000000 00000000 5c0a1ed5 4c12c6d9 736c7412 6d6f632e 616e6962
+0900: 4c726f74 00746665 8133d9ba 4c12c6d9 00000002 29dfe61b 67726108 756e5f73
+0920: 0000006d 00000004 00000000 c1863d08 70659eff 00000000 00000000 29dfe61b
+0940: 67726104 00000073 00000000 d9fb20de 4e8a14f0 00000000 00000000 00000001
+0960: 29dfe61b 00000000 00000000 c1863d08 29dfe61b 00000000 00000000 2c064372
+0980: c1863d08 8133d9ba 00000000 00000000 5c0a1ed5 2c064372 736c7413 6d6f632e
+09a0: 616e6962 52726f74 74686769 2c064372 4c12c6d9 00000001 29dfe61b 6c617605
+09c0: 00006575 00000000 c1863d08 193fd378 00000000 00000000 2c064372 c1863d08
+09e0: 2c064372 00000000 00000000 5c0a1ed5 ecc9da78 736c740c 7078652e 70795472
+0a00: 00000065 307d41a0 4c12c6d9 00000001 29dfe61b 00000000 00000000 c1863d08
+0a20: 193fd378 00000000 00000000 2c064372 c1863d08 307d41a0 00000000 00000000
+0a40: 5c0a1ed5 dcb49bd8 736c740b 7078652e 74614e72 307d41a0 4c12c6d9 00000001
+0a60: 29dfe61b 00000000 00000000 c1863d08 c2635441 00000000 00000000 2c064372
+0a80: c1863d08 307d41a0 00000000 00000000 5c0a1ed5 8ce940b1 736c740c 74616e2e
+0aa0: 736e6f43 00000074 c2635441 4c12c6d9 00000001 29dfe61b 6c617605 00006575
+0ac0: 00000000 c1863d08 a8509bda 00000001 00000000 2c064372 c1863d08 c2635441
+0ae0: 00000000 00000000 5c0a1ed5 4e8a14f0 736c740a 74616e2e 00726156 c2635441
+0b00: 4c12c6d9 00000002 29dfe61b 66696403 00000000 c1863d08 a8509bda 00000001
+0b20: 00000000 29dfe61b 72617607 6d756e5f 00000000 c1863d08 a8509bda 00000001
+0b40: 00000000 2c064372 c1863d08 c2635441 00000000 00000000 5c0a1ed5 3a2f9be2
+0b60: 736c740d 6863732e 5f616d65 00003276 3a2f9be2 4c12c6d9 00000008 29dfe61b
+0b80: 72657607 6e6f6973 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b
+0ba0: 74616404 00000065 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b
+0bc0: 70797409 6e5f7365 00006d75 00000004 00000000 c1863d08 70659eff 00000000
+0be0: 00000000 29dfe61b 70797405 00007365 00000000 d9fb20de 4e8a14f0 00000000
+0c00: 00000000 00000001 29dfe61b 00000000 00000000 c1863d08 12eb4386 00000000
+0c20: 00000000 29dfe61b 6e6f630f 75727473 726f7463 6d756e5f 00000004 00000001
+0c40: c1863d08 70659eff 00000000 00000000 29dfe61b 6e6f630c 75727473 726f7463
+0c60: 00000073 00000000 d9fb20de 4e8a14f0 00000000 00000001 00000001 29dfe61b
+0c80: 00000000 00000000 c1863d08 5c0a1ed5 00000000 00000000 29dfe61b 6e75660d
+0ca0: 6f697463 6e5f736e 00006d75 00000004 00000002 c1863d08 70659eff 00000000
+0cc0: 00000000 29dfe61b 6e756609 6f697463 0000736e 00000000 d9fb20de 4e8a14f0
+0ce0: 00000000 00000002 00000001 29dfe61b 00000000 00000000 c1863d08 5c0a1ed5
+0d00: 00000000 00000000 2c064372 c1863d08 3a2f9be2 00000000 00000000 5c0a1ed5
+0d20: 12eb4386 736c7408 7079742e 00000065 12eb4386 4c12c6d9 00000006 29dfe61b
+0d40: 6d616e04 00000065 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b
+0d60: 00646902 00000000 c1863d08 b5286e24 00000001 00000000 29dfe61b 6e6f6310
+0d80: 75727473 726f7463 756e5f73 0000006d 00000000 c1863d08 a8509bda 00000001
+0da0: 00000000 29dfe61b 616c6605 00007367 00000000 c1863d08 a8509bda 00000001
+0dc0: 00000000 29dfe61b 69726105 00007974 00000000 c1863d08 a8509bda 00000001
+0de0: 00000000 29dfe61b 7261700b 5f736d61 65707974 00000000 c1863d08 22076cba
+0e00: 00000001 00000000 2c064372 c1863d08 12eb4386 00000000 00000000 5c0a1ed5
+0e20: 0142ceae 736c740b 7079742e 72615665 193fd378 4c12c6d9 00000002 29dfe61b
+0e40: 72617607 6d756e5f 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b
+0e60: 616c6605 00007367 00000000 c1863d08 a8509bda 00000001 00000000 2c064372
+0e80: c1863d08 193fd378 00000000 00000000 5c0a1ed5 d9fb20de 736c7409 7272612e
+0ea0: 00007961 193fd378 4c12c6d9 00000003 29dfe61b 6c756d0c 6c706974 74696369
+0ec0: 00000079 00000000 c1863d08 c2635441 00000000 00000000 29dfe61b 67726108
+0ee0: 756e5f73 0000006d 00000004 00000000 c1863d08 70659eff 00000000 00000000
+0f00: 29dfe61b 67726104 00000073 00000000 d9fb20de 4e8a14f0 00000000 00000000
+0f20: 00000001 29dfe61b 00000000 00000000 c1863d08 29dfe61b 00000000 00000000
+0f40: 2c064372 c1863d08 193fd378 00000000 00000000 5c0a1ed5 c1863d08 736c740c
+0f60: 7079742e 70784565 00000072 193fd378 4c12c6d9 00000004 29dfe61b 6d616e04
+0f80: 00000065 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b 616c6605
+0fa0: 00007367 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b 6968630c
+0fc0: 6572646c 756e5f6e 0000006d 00000004 00000000 c1863d08 70659eff 00000000
+0fe0: 00000000 29dfe61b 69686308 6572646c 0000006e 00000000 d9fb20de 4e8a14f0
+1000: 00000000 00000000 00000001 29dfe61b 00000000 00000000 c1863d08 307d41a0
+1020: 00000000 00000000 2c064372 c1863d08 193fd378 00000000 00000000 00000000

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL-types.html b/data/core.telegram.org/mtproto/TL-types.html new file mode 100644 index 0000000000..cdab6154d1 --- /dev/null +++ b/data/core.telegram.org/mtproto/TL-types.html @@ -0,0 +1,124 @@ + + + + + Type serialization + + + + + + + + + + + + + +
+ +
+
+
+ +

Type serialization

+ +

See Polymorphism in TL and TL Language.

+

It remains to describe how types, e.g. values of type Type, are transmitted (serialized). In general, there is nothing unexpected going on here: we have type constructors of various arities (for example, List is an arity-1 constructor, but IntList is a 0-arity constructor); and if we know that a 32-bit “name” is assigned to each type constructor, there are no further questions -- values of type Type are serialized exactly like values of any other recursive type with a defined set of constructors of differing arity.

+

How can a 32-bit “name” be assigned to a type (a type constructor, to be more exact) such as List or IntList? +It is proposed to use the sum of the names of all of its constructors, plus the CRC32 of the string with the designation of the type's name and all of its parameters such as “IntList = Type” or “List X:Type = Type”. This way, the List constructor’s “name” is the sum of the CRC32s of the three strings "List X:Type = Type", "cons X:Type hd:X tl:List X = List X", and "nil X:Type = List X". +For “bare” types (which, formally speaking, are subtypes of the corresponding “boxed” type), the situation is somewhat more complicated; the logical negation of the corresponding constructor’s name is used. For built-in bareand boxed types (for example, int and Int), a pseudo-declaration is used (for example, int ? = Int").

+
    +
  • This description is somewhat outdated and may be updated in the future. Specifically, how to treat the ! modifier has not been explained.*
  • +
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL.html b/data/core.telegram.org/mtproto/TL.html new file mode 100644 index 0000000000..0cf369d9df --- /dev/null +++ b/data/core.telegram.org/mtproto/TL.html @@ -0,0 +1,210 @@ + + + + + TL Language + + + + + + + + + + + + + +
+ +
+
+
+ +

TL Language

+ +

TL (Type Language) serves to describe the used system of types, constructors, and existing functions. In fact, the combinator description format presented in Binary Data Serialization is used.

+

See also:

+ +

Advanced topics:

+ +

Overview

+

A TL program usually consists of two sections separated by keyword ---functions---. The first section consists of declarations of built-in types and aggregate types (i.e. their constructors). The second section consists of the declared functions, i.e. functional combinators.

+

Actually, both the first and second sections consist of combinator declarations, each of which ends with a semicolon. However, the first section contains only constructors, while the second section only involves functions. Each combinator is declared using a “combinator declaration” in the format explained above. However, the combinator number and field names may be explicitly assigned.

+

If additional type declarations are required after functions have been declared, the keyword (section divider) ---types--- is used. Furthermore, a functional combinator may be declared in the type section if its result type begins with an exclamation point (in fact, when the function section is interpreted, this exclamation point is added automatically).

+

To explicitly define 32-bit names of combinators, a hash mark (#) is added immediately after the combinator’s name, followed by 8 hexadecimal digits.

+

Namespaces

+

Composite constructions like <namespace_identifier>.<constructor_identifier> and <namespace_identifier>.<Type_identifier> can be used as constructor- or type identifiers. The portion of the identifier to the left of the period is called the namespace. Moreover, the rule about a first uppercase letter in type identifiers and lowercase letter in constructor identifiers applies to the part of the construction after the period. For example, auth.Message would be a type, while auth.std_message would be a constructor.

+

Namespaces do not require a special declaration.

+

Comments

+

Comments are the same as in C++.

+

Example

+
// built-in types
+int#a8509bda ? = Int;
+long ? = Long;
+double ? = Double;
+string ? = String;
+null = Null;
+
+vector {t:Type} # [ t ] = Vector t;
+coupleInt {alpha:Type} int alpha = CoupleInt<alpha>;
+coupleStr {gamma:Type} string gamma = CoupleStr gamma;  
+/* The name of the type variable is irrelevant: "gamma" could be replaced with "alpha"; 
+   However, the combinator number will depend on the specific choice. */
+
+intHash {alpha:Type} vector<coupleInt<alpha>> = IntHash<alpha>;
+strHash {alpha:Type} (vector (coupleStr alpha)) = StrHash alpha;
+intSortedHash {alpha:Type} intHash<alpha> = IntSortedHash<alpha>;
+strSortedHash {alpha:Type} (strHash alpha) = StrSortedHash alpha;
+
+// custom types
+pair x:Object y:Object = Pair;
+triple x:Object y:Object z:Object = Triple;
+
+user#d23c81a3 id:int first_name:string last_name:string = User;
+no_user#c67599d1 id:int = User;
+group id:int title:string last_name:string = Group;
+no_group = Group;
+
+---functions---
+
+// Maybe some built-in arithmetic functions; inverse quotes make "identifiers" out of arbitrary non-alphanumeric strings
+`+` Int Int = Int;
+`-` Int Int = Int;
+`+` Double Double = Double;
+// ...
+
+// API functions (aka RPC functions)
+getUser#b0f732d5 int = User;
+getUsers#2d84d5f5 (Vector int) = Vector User;
+

In this case, the user constructor has been explicitly assigned a number (0xd23c81a3); In fact, this was not necessary, since this value is the CRC32 of the string "user id:int first_name:string last_name:string = User", which would have been used by default.

+

Special constructors are not required for Vector int, Vector User, Vector Object, etc. -- the same universal constructor can be used everywhere:

+
vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+

Note that when the getUsers (Vector int) = Vector User; constructor number is calculated, the CRC32 of the string "getUsers Vector int = Vector User” is computed (from which all parentheses have been removed).

+

Notation T0<T1,T2,...,Tn> is syntactic sugar for (T0 (T1) (T2) ... (Tn)). For example, Vector<User> and (Vector User) are entirely interchangeable.

+

Example of an RPC query

+

Suppose we want to call getUsers([2,3,4]). This query will be serialized into a sequence of 32-bit integers as follows:

+
0x2d84d5f5 0x1cb5c415 0x3 0x2 0x3 0x4
+

Please note that TL serialization yields sequences of 32-bit integers. When it has to be embedded into a byte stream, for example a network packet, each 32-bit integer is represented by four bytes in little-endian order. In this way the above query corresponds to the following byte stream:

+
F5 D5 84 2D 15 C4 B5 1C 03 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00
+

The response might look something like this:

+
0x1cb5c415 0x3 0xd23c81a3 0x2 0x74655005 0x00007265 0x72615006 0x72656b 0xc67599d1 0x3 0xd23c81a3 0x4 0x686f4a04 0x6e 0x656f4403
+

This roughly corresponds to

+
[{"id":2,"first_name":"Peter", "last_name":"Parker"},{},{"id":4,"first_name":"John","last_name":"Doe"}]
+

Note that in both cases the same universal constructor vector#1cb5c415 is used: in the request to serialize the value of type Vector int, and in the serialization of the value of type Vector User in the response. There is no ambiguity because in both cases the type of the value being (de)serialized is known before its (de)serialization begins. For example, after receiving the query, the server sees that the first part is 0x2d84d5f5, which corresponds to the combinator getUsers#2d84d5f5 (Vector int) = Vector User. Thus, it is understood that what follows will be a value of type Vector int. After receiving the response to this query, the client knows that it must receive a value of type Vector User and it deserializes the response accordingly.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/auth_key.html b/data/core.telegram.org/mtproto/auth_key.html new file mode 100644 index 0000000000..6bd90d0a10 --- /dev/null +++ b/data/core.telegram.org/mtproto/auth_key.html @@ -0,0 +1,253 @@ + + + + + Creating an Authorization Key + + + + + + + + + + + + + +
+ +
+
+
+ +

Creating an Authorization Key

+ +

The query format is described using Binary Data Serialization and the TL Language. All large numbers are transmitted as strings containing the required sequence of bytes in big endian order. Hash functions, such as SHA1, return strings (of 20 bytes) which can also be interpreted as big endian numbers. Small numbers (int, long, int128, int256) are normally little endian; however, if they are part of SHA1, the bytes are not rearranged. This way, if long x is the 64 lower-order bits of SHA1 of string s, then the final 8 bytes of 20-byte string SHA1(s) are taken and interpreted as a 64-bit integer.

+

Prior to sending off unencrypted messages (required in this instance to generate an authorization key), the client must undergo (p,q) authorization as follows.

+

DH exchange initiation

+
    +
  1. +

    Client sends query to server

    +

    req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;

    +
  2. +
+

or (deprecated)

+
req_pq#60469778 nonce:int128 = ResPQ;
+

The value of nonce is selected randomly by the client (random number) and identifies the client within this communication. Following this step, it is known to all.

+
    +
  1. +

    Server sends response of the form

    +

    resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector long = ResPQ;

    +
  2. +
+

Here, string pq is a representation of a natural number (in binary big endian format). This number is the product of two different odd prime numbers. Normally, pq is less than or equal to 2^63-1. The value of server_nonce is selected randomly by the server; following this step, it is known to all.

+

server_public_key_fingerprints is a list of public RSA key fingerprints (64 lower-order bits of SHA1 (server_public_key); the public key is represented as a bare type rsa_public_key n:string e:string = RSAPublicKey, where, as usual, n and е are numbers in big endian format serialized as strings of bytes, following which SHA1 is computed) received by the server. Because of compatibility issues with older clients, only one public key fingerprint is returned as a result to deprecated req_pq query; an answer to req_pq_multi may contain more than one fingerprint.

+

All subsequent messages contain the pair (nonce, server_nonce) both in the plain-text, and the encrypted portions which makes it possible to identify a “temporary session” — one run of the key generation protocol described on this page that uses the same (nonce, server_nonce) pair. An intruder could not create a parallel session with the server with the same parameters and reuse parts of server- or client-encrypted messages for its own purposes in such a parallel session, because a different server_nonce would be selected by the server for any new “temporary session”.

+

Proof of work

+
    +
  1. Client decomposes pq into prime factors such that p < q.
  2. +
+

This starts a round of Diffie-Hellman key exchanges.

+

Presenting proof of work; Server authentication

+
    +
  1. +

    Client sends query to server

    +

    req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params

    +
  2. +
+

Here, encrypted_data is obtained as follows:

+
    +
  • +

    new_nonce := another (good) random number generated by the client; after this query, it is known to both client and server;

    +
  • +
  • +

    data := a serialization of

    +
    p_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data
    +

    or of

    +
    p_q_inner_data_temp#3c6a84d4 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data;
    +
  • +
  • +

    data_with_hash := SHA1(data) + data + (any random bytes); such that the length equals 255 bytes;

    +
  • +
  • +

    encrypted_data := RSA (data_with_hash, server_public_key); a 255-byte long number (big endian) is raised to the requisite power over the requisite modulus, and the result is stored as a 256-byte number.

    +
  • +
+

Someone might intercept the query and replace it with their own, independently decomposing pq into factors instead of the client. The only field that it makes sense to modify is new_nonce which would be the one an intruder would have to re-generate (because an intruder cannot decrypt the encrypted data sent by the client). Since all subsequent messages are encrypted using new_nonce or contain new_nonce_hash, they will not be processed by the client (an intruder would not be able to make it look as though they had been generated by the server because they would not contain new_nonce). Therefore, this intercept will only result in the intruder’s completing the authorization key generation protocol in place of the client and creating a new key (that has nothing to do with the client); however, the same effect could be achieved simply by creating a new key in one's own name.

+

An alternative form of inner data (p_q_inner_data_temp) is used to create temporary keys, that are only stored in the server RAM and are discarded after at most expires_in seconds. The server is free to discard its copy earlier. In all other respects the temporary key generation protocol is the same. After a temporary key is created, the client usually binds it to its principal authorisation key by means of the auth.bindTempAuthKey method, and uses it for all client-server communication until it expires; then a new temporary key is generated. Thus Perfect Forward Secrecy (PFS) in client-server communication is achieved. Read more about PFS »

+
    +
  1. +

    Server responds in one of two ways:

    +

    server_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params; +server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;

    +
  2. +
+

Here, encrypted_answer is obtained as follows:

+
    +
  • +

    new_nonce_hash := 128 lower-order bits of SHA1 (new_nonce);

    +
  • +
  • +

    answer := serialization

    +
      server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;
    +
  • +
  • +

    answer_with_hash := SHA1(answer) + answer + (0-15 random bytes); such that the length be divisible by 16;

    +
  • +
  • +

    tmp_aes_key := SHA1(new_nonce + server_nonce) + substr (SHA1(server_nonce + new_nonce), 0, 12);

    +
  • +
  • +

    tmp_aes_iv := substr (SHA1(server_nonce + new_nonce), 12, 8) + SHA1(new_nonce + new_nonce) + substr (new_nonce, 0, 4);

    +
  • +
  • +

    encrypted_answer := AES256_ige_encrypt (answer_with_hash, tmp_aes_key, tmp_aes_iv); here, tmp_aes_key is a 256-bit key, and tmp_aes_iv is a 256-bit initialization vector. The same as in all the other instances that use AES encryption, the encrypted data is padded with random bytes to a length divisible by 16 immediately prior to encryption.

    +
  • +
+

Following this step, new_nonce is still known to client and server only. The client is certain that it is the server that responded and that the response was generated specifically in response to client query req_DH_params, since the response data are encrypted using new_nonce.

+

Client is expected to check whether p = dh_prime 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 not to repeat lengthy computations in future.

+

If the verification takes too long time (which is the case for older mobile devices), one might initially run only 15 Miller--Rabin iterations for verifying primeness of p and (p - 1)/2 with error probability not exceeding one billionth, and do more iterations later in the background.

+

Another optimization is to embed into the client application code a small table with some known "good" couples (g,p) (or just known safe primes p, since the condition on g is easily verified during execution), checked during code generation phase, so as to avoid doing such verification during runtime altogether. Server changes these values rarely, thus one usually has to put the current value of server's dh_prime into such a table. For example, current value of dh_prime equals (in big-endian byte order)

+
C7 1C AE B9 C6 B1 C9 04 8E 6C 52 2F 70 F1 3F 73 98 0D 40 23 8E 3E 21 C1 49 34 D0 37 56 3D 93 0F 48 19 8A 0A A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E 0A C9 25 13 95 43 AE D4 4C CE 7C 37 20 FD 51 F6 94 58 70 5A C6 8C D4 FE 6B 6B 13 AB DC 97 46 51 29 69 32 84 54 F1 8F AF 8C 59 5F 64 24 77 FE 96 BB 2A 94 1D 5B CD 1D 4A C8 CC 49 88 07 08 FA 9B 37 8E 3C 4F 3A 90 60 BE E6 7C F9 A4 A4 A6 95 81 10 51 90 7E 16 27 53 B5 6B 0F 6B 41 0D BA 74 D8 A8 4B 2A 14 B3 14 4E 0E F1 28 47 54 FD 17 ED 95 0D 59 65 B4 B9 DD 46 58 2D B1 17 8D 16 9C 6B C4 65 B0 D6 FF 9C A3 92 8F EF 5B 9A E4 E4 18 FC 15 E8 3E BE A0 F8 7F A9 FF 5E ED 70 05 0D ED 28 49 F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6 35 B1 05 EE 2E 4E 15 D0 4B 24 54 BF 6F 4F AD F0 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B
+
    +
  1. +

    Client computes random 2048-bit number b (using a sufficient amount of entropy) and sends the server a message

    +

    set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;

    +
  2. +
+

Here, encrypted_data is obtained thus:

+
    +
  • +

    g_b := pow(g, b) mod dh_prime;

    +
  • +
  • +

    data := serialization

    +
      client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data
    +
  • +
  • +

    data_with_hash := SHA1(data) + data + (0-15 random bytes); such that length be divisible by 16;

    +
  • +
  • +

    encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);

    +
  • +
+

The retry_id field is equal to zero at the time of the first attempt; otherwise, it is equal to auth_key_aux_hash from the previous failed attempt (see Item 9).

+
    +
  1. +

    Thereafter, auth_key equals pow(g, {ab}) mod dh_prime; on the server, it is computed as pow(g_b, a) mod dh_prime, and on the client as (g_a)^b mod dh_prime.

    +
  2. +
  3. +

    auth_key_hash is computed := 64 lower-order bits of SHA1 (auth_key). The server checks whether there already is another key with the same auth_key_hash and responds in one of the following ways.

    +
  4. +
+

DH key exchange complete

+
    +
  1. +

    Server responds in one of three ways:

    +

    dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer; +dh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer; +dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;

    +
  2. +
+
    +
  • new_nonce_hash1, new_nonce_hash2, and new_nonce_hash3 are obtained as the 128 lower-order bits of SHA1 of the byte string derived from the new_nonce string by adding a single byte with the value of 1, 2, or 3, and followed by another 8 bytes with auth_key_aux_hash. Different values are required to prevent an intruder from changing server response dh_gen_ok into dh_gen_retry.
  • +
  • auth_key_aux_hash is the 64 higher-order bits of SHA1(auth_key). It must not be confused with auth_key_hash.
  • +
+

In the other case, the client goes to Item 6) generating a new b. +In the first case, the client and the server have negotiated auth_key, following which they forget all other temporary data, and the client creates another encrypted session using auth_key. At the same time, server_salt is initially set to substr(new_nonce, 0, 8) XOR substr(server_nonce, 0, 8). If required, the client stores the difference between server_time received in 5) and its local time, to be able always to have a good approximation of server time which is required to generate correct message identifiers.

+

IMPORTANT: Apart from the conditions on the Diffie-Hellman prime dh_prime and generator g, both sides are to check that g, g_a and g_b are greater than 1 and less than dh_prime - 1. We recommend checking that g_a and g_b are between 2^{2048-64} and dh_prime - 2^{2048-64} as well.

+

Error Handling (Lost Queries and Responses)

+

If the client fails to receive any response to its query from the server within a certain time interval, it may simply re-send the query. If the server has already sent a response to this query (exactly the same request and not just similar: all the parameters during the repeat request must take on the same values) but it did not get to the client, the server will simply re-send the same response. The server remembers the response for up to 10 minutes after having received the query in 1). If the server has already forgotten the response or the requisite temporary data, the client will have to start from the beginning.

+

The server may consider that if the client has already sent in the next query using the data from the previous server response to the specific client, the response is known to have been received by the client and may be forgotten by the server.

+

Usage Example

+

An example of a complete list of queries required to generate an authorization key is shown on a separate page.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/description.html b/data/core.telegram.org/mtproto/description.html new file mode 100644 index 0000000000..fa86561d5c --- /dev/null +++ b/data/core.telegram.org/mtproto/description.html @@ -0,0 +1,238 @@ + + + + + Mobile Protocol: Detailed Description + + + + + + + + + + + + + +
+ +
+
+
+ +

Mobile Protocol: Detailed Description

+ +
+ +
+

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 describes the basic layer of the MTProto protocol version 2.0 (Cloud chats, server-client encryption). 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;
  • +
  • msg_key depends not only on the message to be encrypted, but on a portion of auth_key as well;
  • +
  • 12..1024 padding bytes are used instead of 0..15 padding bytes in v.1.0.
  • +
+

See also: MTProto 2.0: Secret Chats, end-to-end encryption

+

Protocol description

+

Before a message (or a multipart message) is transmitted over a network using a transport protocol, it is encrypted in a certain way, and an external header is added at the top of the message that consists of a 64-bit key identifier auth_key_id (that uniquely identifies an authorization key for the server as well as the user) and a 128-bit message key msg_key.

+

The authorization key auth_key combined with the message key msg_key define an actual 256-bit key aes_key and a 256-bit initialization vector aes_iv, which are used to encrypt the message using AES-256 encryption in infinite garble extension (IGE) mode. Note that the initial part of the message to be encrypted contains variable data (session, message ID, sequence number, server salt) that obviously influences the message key (and thus the AES key and iv). In MTProto 2.0, the message key is defined as the 128 middle bits of the SHA-256 of the message body (including session, message ID, padding, etc.) prepended by 32 bytes taken from the authorization key. In the older MTProto 1.0, the message key was computed as the lower 128 bits of SHA-1 of the message body, excluding the padding bytes.

+

Multipart messages are encrypted as a single message.

+ +
+

Got questions about this setup? — Check out the Advanced FAQ!

+
+
Note 1
+

Each plaintext message to be encrypted in MTProto always contains the following data to be checked upon decryption in order to make the system robust against known problems with the components:

+
    +
  • server salt (64-Bit)
  • +
  • session id
  • +
  • message sequence number
  • +
  • message length
  • +
  • time
  • +
+
Note 2
+

Telegram's End-to-end encrypted Secret Chats are using an additional layer of encryption on top of the described above. See Secret Chats, End-to-End encryption for details.

+

Terminology

+

Authorization Key (auth_key)

+

A 2048-bit key shared by the client device and the server, created upon user registration directly on the client device by exchanging Diffie-Hellman keys, and never transmitted over a network. Each authorization key is user-specific. There is nothing that prevents a user from having several keys (that correspond to “permanent sessions” on different devices), and some of these may be locked forever in the event the device is lost. See also Creating an Authorization Key.

+

Server Key

+

A 2048-bit RSA key used by the server digitally to sign its own messages while registration is underway and the authorization key is being generated. The application has a built-in public server key which can be used to verify a signature but cannot be used to sign messages. A private server key is stored on the server and changed very infrequently.

+

Key Identifier (auth_key_id)

+

The 64 lower-order bits of the SHA1 hash of the authorization key are used to indicate which particular key was used to encrypt a message. Keys must be uniquely defined by the 64 lower-order bits of their SHA1, and in the event of a collision, an authorization key is regenerated. A zero key identifier means that encryption is not used which is permissible for a limited set of message types used during registration to generate an authorization key in a Diffie-Hellman exchange. For MTProto 2.0, SHA1 is still used here, because auth_key_id should identify the authorization key used independently of the protocol version.

+

Session

+

A (random) 64-bit number generated by the client to distinguish between individual sessions (for example, between different instances of the application, created with the same authorization key). The session in conjunction with the key identifier corresponds to an application instance. The server can maintain session state. Under no circumstances can a message meant for one session be sent into a different session. The server may unilaterally forget any client sessions; clients should be able to handle this.

+

Server Salt

+

A (random) 64-bit number periodically (say, every 24 hours) changed (separately for each session) at the request of the server. All subsequent messages must contain the new salt (although, messages with the old salt are still accepted for a further 300 seconds). Required to protect against replay attacks and certain tricks associated with adjusting the client clock to a moment in the distant future.

+

Message Identifier (msg_id)

+

A (time-dependent) 64-bit number used uniquely to identify a message within a session. Client message identifiers are divisible by 4, server message identifiers modulo 4 yield 1 if the message is a response to a client message, and 3 otherwise. Client message identifiers must increase monotonically (within a single session), the same as server message identifiers, and must approximately equal unixtime*2^32. This way, a message identifier points to the approximate moment in time the message was created. A message is rejected over 300 seconds after it is created or 30 seconds before it is created (this is needed to protect from replay attacks). In this situation, it must be re-sent with a different identifier (or placed in a container with a higher identifier). The identifier of a message container must be strictly greater than those of its nested messages.

+

Important: to counter replay-attacks the lower 32 bits of msg_id passed by the client must not be empty and must present a fractional part of the time point when the message was created.

+

Content-related Message

+

A message requiring an explicit acknowledgment. These include all the user and many service messages, virtually all with the exception of containers and acknowledgments.

+

Message Sequence Number (msg_seqno)

+

A 32-bit number equal to twice the number of “content-related” messages (those requiring acknowledgment, and in particular those that are not containers) created by the sender prior to this message and subsequently incremented by one if the current message is a content-related message. A container is always generated after its entire contents; therefore, its sequence number is greater than or equal to the sequence numbers of the messages contained in it.

+

Message Key (msg_key)

+

In MTProto 2.0, the middle 128 bits of the SHA-256 hash of the message to be encrypted (including the internal header and the padding bytes for MTProto 2.0), prepended by a 32-byte fragment of the authorization key.

+

In MTProto 1.0, message key was defined differently, as the lower 128 bits of the SHA-1 hash of the message to be encrypted, with padding bytes excluded from the computation of the hash. Authorization key was not involved in this computation.

+

Internal (cryptographic) Header

+

A header (16 bytes) added before a message or a container before it is all encrypted together. Consists of the server salt (64 bits) and the session (64 bits).

+

External (cryptographic) Header

+

A header (24 bytes) added before an encrypted message or a container. Consists of the key identifier auth_key_id (64 bits) and the message key msg_key (128 bits).

+

Payload

+

External header + encrypted message or container.

+

Defining AES Key and Initialization Vector

+

The 2048-bit authorization key (auth_key) and the 128-bit message key (msg_key) are used to compute a 256-bit AES key (aes_key) and a 256-bit initialization vector (aes_iv) which are subsequently used to encrypt the part of the message to be encrypted (i. e. everything with the exception of the external header that is added later) with AES-256 in infinite garble extension (IGE) mode.

+

For MTProto 2.0, the algorithm for computing aes_key and aes_iv from auth_key and msg_key is as follows.

+
    +
  • msg_key_large = SHA256 (substr (auth_key, 88+x, 32) + plaintext + random_padding);
  • +
  • msg_key = substr (msg_key_large, 8, 16);
  • +
  • sha256_a = SHA256 (msg_key + substr (auth_key, x, 36));
  • +
  • sha256_b = SHA256 (substr (auth_key, 40+x, 36) + msg_key);
  • +
  • aes_key = substr (sha256_a, 0, 8) + substr (sha256_b, 8, 16) + substr (sha256_a, 24, 8);
  • +
  • aes_iv = substr (sha256_b, 0, 8) + substr (sha256_a, 8, 16) + substr (sha256_b, 24, 8);
  • +
+

where x = 0 for messages from client to server and x = 8 for those from server to client.

+

For the obsolete MTProto 1.0, msg_key, aes_key, and aes_iv were computed differently (see this document for reference).

+

The lower-order 1024 bits of auth_key are not involved in the computation. They may (together with the remaining bits or separately) be used on the client device to encrypt the local copy of the data received from the server. The 512 lower-order bits of auth_key are not stored on the server; therefore, if the client device uses them to encrypt local data and the user loses the key or the password, data decryption of local data is impossible (even if data from the server could be obtained).

+

In MTProto 1.0, when AES was used to encrypt a block of data of a length not divisible by 16 bytes, the data was padded with 0 to 15 random padding bytes random_padding to a length divisible by 16 bytes prior to encryption. In MTProto 2.0, this padding is taken into account when computing msg_key. Note that MTProto 2.0 requires from 12 to 1024 bytes of padding, still subject to the condition that the resulting message length be divisible by 16 bytes.

+

Using MTProto 2.0 instead of MTProto 1.0

+

A client may either use only MTProto 2.0 or only MTProto 1.0 in the same TCP connection. The server detects the protocol used by the first message received from the client, and then uses the same encryption for its messages, and expects the client to use the same encryption henceforth. We recommend using MTProto 2.0; MTProto 1.0 is deprecated and supported for backward compatibility only.

+

Important Checks

+

When an encrypted message is received, it must be checked that msg_key is in fact equal to the 128 middle bits of the SHA-256 of the decrypted data with a 32-byte fragment of auth_key prepended to it, and that msg_id has even parity for messages from client to server, and odd parity for messages from server to client.

+

In addition, the identifiers (msg_id) of the last N messages received from the other side must be stored, and if a message comes in with msg_id lower than all or equal to any of the stored values, the message is to be ignored. Otherwise, the new message msg_id is added to the set, and, if the number of stored msg_id values is greater than N, the oldest (i. e. the lowest) is forgotten.

+

On top of this, msg_id values that belong over 30 seconds in the future or over 300 seconds in the past are to be ignored. This is especially important for the server. The client would also find this useful (to protect from a replay attack), but only if it is certain of its time (for example, if its time has been synchronized with that of the server).

+

Certain client-to-server service messages containing data sent by the client to the server (for example, msg_id of a recent client query) may, nonetheless, be processed on the client even if the time appears to be “incorrect”. This is especially true of messages to change server_salt and notifications of invalid client time. See Mobile Protocol: Service Messages.

+

Storing an Authorization Key on a Client Device

+

It may be suggested to users concerned with security that they password protect the authorization key in approximately the same way as in ssh. This can be accomplished by prepending the value of cryptographic hash function, such as SHA-256, of the key to the front of the key, following which the entire string is encrypted using AES in CBC mode and a key equal to the user’s (text) password. When the user inputs the password, the stored protected password is decrypted and verified by checking the SHA-256 value. From the user’s standpoint, this is practically the same as using an application or a website password.

+

Unencrypted Messages

+

Special plain-text messages may be used to create an authorization key as well as to perform a time synchronization. They begin with auth_key_id = 0 (64 bits) which means that there is no auth_key. This is followed directly by the message body in serialized format without internal or external headers. A message identifier (64 bits) and body length in bytes (32 bytes) are added before the message body.

+

Only a very limited number of messages of special types can be transmitted as plain text.

+

Schematic Presentation of Messages

+

Encrypted Message

+ + + + +
auth_key_id
int64
msg_key
int128
encrypted_data
bytes
+

Encrypted Message: encrypted_data

+

Contains the cypher text for the following data:

+ + + + + + + + +
salt
int64
session_id
int64
message_id
int64
seq_no
int32
message_data_length
int32
message_data
bytes
padding12..1024
bytes
+

Unencrypted Message

+ + + + + +
auth_key_id = 0
int64
message_id
int64
message_data_length
int32
message_data
bytes
+

MTProto 2.0 uses 12..1024 padding bytes, instead of the 0..15 used in MTProto 1.0

+

Creating an Authorization Key

+

An authorization key is normally created once for every user during the application installation process immediately prior to registration. Registration itself, in actuality, occurs after the authorization key is created. However, a user may be prompted to complete the registration form while the authorization key is being generated in the background. Intervals between user key strokes may be used as a source of entropy in the generation of high-quality random numbers required for the creation of an authorization key.

+

See Creating an Authorization Key.

+

During the creation of the authorization key, the client obtains its server salt (to be used with the new key for all communication in the near future). The client then creates an encrypted session using the newly generated key, and subsequent communication occurs within that session (including the transmission of the user's registration information and phone number validation) unless the client creates a new session. The client is free to create new or additional sessions at any time by choosing a new random session_id.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/mtproto/description_v1.html b/data/core.telegram.org/mtproto/description_v1.html new file mode 100644 index 0000000000..b6e33c590b --- /dev/null +++ b/data/core.telegram.org/mtproto/description_v1.html @@ -0,0 +1,205 @@ + + + + + Mobile Protocol: Detailed Description (v.1.0, DEPRECATED) + + + + + + + + + + + + + +
+ +
+
+
+ +

Mobile Protocol: Detailed Description (v.1.0, DEPRECATED)

+ +
+

This document describes MTProto v.1.0, its status is DEPRECATED. +For information on encryption used in up-to-date Telegram clients, kindly see this document.

+
+

Prior to a message (or a multipart message) being transmitted over a network using a transport protocol, it is encrypted in a certain way, and an external header is added at the top of the message which is: a 64-bit key identifier (that uniquely identifies an authorization key for the server as well as the user) and a 128-bit message key.

+

A user key together with the message key define an actual 256-bit key and a 256-bit initialization vector, which is what encrypts the message using AES-256 encryption with infinite garble extension (IGE). Note that the initial part of the message to be encrypted contains variable data (session, message ID, sequence number, server salt) that obviously influences the message key (and thus the AES key and iv). The message key is defined as the 128 lower-order bits of the SHA1 of the message body (including session, message ID, etc.) Multipart messages are encrypted as a single message.

+ +

Terminology

+

Authorization Key

+

a 2048-bit key shared by the client device and the server, created upon user registration directly on the client device be exchanging Diffie-Hellman keys, and never transmitted over a network. Each authorization key is user-specific. There is nothing that prevents a user from having several keys (that correspond to “permanent sessions” on different devices), and some of these may be locked forever in the event the device is lost. See also Creating an Authorization Key.

+

Server Key

+

a 2048-bit RSA key used by the server digitally to sign its own messages while registration is underway and the authorization key is being generated. The application has a built-in public server key which can be used to verify a signature but cannot be used to sign messages. A private server key is stored on the server and changed very infrequently.

+

Key Identifier

+

The 64 lower-order bits of the SHA1 hash of the authorization key are used to indicate which particular key was used to encrypt a message. Keys must be uniquely defined by the 64 lower-order bits of their SHA1, and in the event of a collision, an authorization key is regenerated. A zero key identifier means that encryption is not used which is permissible for a limited set of message types used during registration to generate an authorization key based on a Diffie-Hellman exchange.

+

Session

+

a (random) 64-bit number generated by the client to distinguish between individual sessions (for example, between different instances of the application, created with the same authorization key). The session in conjunction with the key identifier corresponds to an application instance. The server can maintain session state. Under no circumstances can a message meant for one session be sent into a different session. The server may unilaterally forget any client sessions; clients should be able to handle this.

+

Server Salt

+

a (random) 64-bit number periodically (say, every 24 hours) changed (separately for each session) at the request of the server. All subsequent messages must contain the new salt (although, messages with the old salt are still accepted for a further 300 seconds). Required to protect against replay attacks and certain tricks associated with adjusting the client clock to a moment in the distant future.

+

Message Identifier (msg_id)

+

a (time-dependent) 64-bit number used uniquely to identify a message within a session. Client message identifiers are divisible by 4, server message identifiers modulo 4 yield 1 if the message is a response to a client message, and 3 otherwise. Client message identifiers must increase monotonically (within a single session), the same as server message identifiers, and must approximately equal unixtime*2^32. This way, a message identifier points to the approximate moment in time the message was created. A message is rejected over 300 seconds after it is created or 30 seconds before it is created (this is needed to protect from replay attacks). In this situation, it must be re-sent with a different identifier (or placed in a container with a higher identifier). The identifier of a message container must be strictly greater than those of its nested messages.

+

Important: to counter replay-attacks the lower 32 bits of msg_id passed by the client must not be empty and must present a fractional part of the time point when the message was created. At some point in the nearest future the server will start ignoring messages, in which the lower 32 bits of msg_id contain too many zeroes.

+

Content-related Message

+

A message requiring an explicit acknowledgment. These include all the user and many service messages, virtually all with the exception of containers and acknowledgments.

+

Message Sequence Number (msg_seqno)

+

a 32-bit number equal to twice the number of “content-related” messages (those requiring acknowledgment, and in particular those that are not containers) created by the sender prior to this message and subsequently incremented by one if the current message is a content-related message. A container is always generated after its entire contents; therefore, its sequence number is greater than or equal to the sequence numbers of the messages contained in it.

+

Message Key

+

The lower-order 128 bits of the SHA1 hash of the part of the message to be encrypted (including the internal header and excluding the alignment bytes).

+

Internal (cryptographic) Header

+

A header (16 bytes) added before a message or a container before it is all encrypted together. Consists of the server salt (64 bits) and the session (64 bits).

+

External (cryptographic) Header

+

A header (24 bytes) added before an encrypted message or a container. Consists of a key identifier (64 bits) and a message key (128 bits).

+

Payload

+

External header + encrypted message or container.

+

Defining AES Key and Initialization Vector

+

The 2048-bit authorization key (auth_key) and the 128-bit message key (msg_key) are used to compute a 256-bit AES key (aes_key) and a 256-bit initialization vector (aes_iv) which are subsequently used to encrypt the part of the message to be encrypted (i. e. everything with the exception of the external header which is added later) with AES-256 in infinite garble extension (IGE) mode.

+

The algorithm for computing aes_key and aes_iv from auth_key and msg_key is as follows:

+
    +
  • msg_key = substr (SHA1 (plaintext), 4, 16);
  • +
  • sha1_a = SHA1 (msg_key + substr (auth_key, x, 32));
  • +
  • sha1_b = SHA1 (substr (auth_key, 32+x, 16) + msg_key + substr (auth_key, 48+x, 16));
  • +
  • sha1_с = SHA1 (substr (auth_key, 64+x, 32) + msg_key);
  • +
  • sha1_d = SHA1 (msg_key + substr (auth_key, 96+x, 32));
  • +
  • aes_key = substr (sha1_a, 0, 8) + substr (sha1_b, 8, 12) + substr (sha1_c, 4, 12);
  • +
  • aes_iv = substr (sha1_a, 8, 12) + substr (sha1_b, 0, 8) + substr (sha1_c, 16, 4) + substr (sha1_d, 0, 8);
  • +
+

where x = 0 for messages from client to server and x = 8 for those from server to client.

+

The lower-order 1024 bits of auth_key are not involved in the computation. They may (together with the remaining bits or separately) be used on the client device to encrypt the local copy of the data received from the server. The 512 lower-order bits of auth_key are not stored on the server; therefore, if the client device uses them to encrypt local data and the user loses the key or the password, data decryption of local data is impossible (even if data from the server could be obtained).

+

When AES is used to encrypt a block of data of a length not divisible by 16 bytes, the data is padded with random bytes to the smallest length divisible by 16 bytes immediately prior to being encrypted.

+

Important Tests

+

When an encrypted message is received, it must be checked that msg_key is in fact equal to the 128 lower-order bits of the SHA1 hash of the previously encrypted portion, and that msg_id has even parity for messages from client to server, and odd parity for messages from server to client.

+

In addition, the identifiers (msg_id) of the last N messages received from the other side must be stored, and if a message comes in with msg_id lower than all or equal to any of the stored values, the message is to be ignored. Otherwise, the new message msg_id is added to the set, and, if the number of stored msg_id values is greater than N, the oldest (i. e. the lowest) is forgotten.

+

In addition, msg_id values that belong over 30 seconds in the future or over 300 seconds in the past are to be ignored. This is especially important for the server. The client would also find this useful (to protect from a replay attack), but only if it is certain of its time (for example, if its time has been synchronized with that of the server).

+

Certain client-to-server service messages containing data sent by the client to the server (for example, msg_id of a recent client query) may, nonetheless, be processed on the client even if the time appears to be “incorrect”. This is especially true of messages to change server_salt and notifications of invalid client time. See Mobile Protocol: Service Messages.

+

Storing an Authorization Key on a Client Device

+

It may be suggested to users concerned with security that they password protect the authorization key in approximately the same way as in ssh. This is accomplished by adding the SHA1 of the key to the front of the key, following which the entire string is encrypted using AES in CBC mode and a key equal to the user’s (text) password. When the user inputs the password, the stored protected password is decrypted and verified by being compared with SHA1. From the user’s standpoint, this is practically the same as using an application or a website password.

+

Unencrypted Messages

+

Special plain-text messages may be used to create an authorization key as well as to perform a time synchronization. They begin with auth_key_id = 0 (64 bits) which means that there is no auth_key. This is followed directly by the message body in serialized format without internal or external headers. A message identifier (64 bits) and body length in bytes (32 bytes) are added before the message body.

+

Only a very limited number of messages of special types can be transmitted as plain text.

+

Schematic Presentation of Messages

+

Encrypted Message

+ + + + +
auth_key_id
int64
msg_key
int128
encrypted_data
bytes
+

Encrypted Message: encrypted_data

+

Contains the cypher text for the following data:

+ + + + + + + + +
salt
int64
session_id
int64
message_id
int64
seq_no
int32
message_data_length
int32
message_data
bytes
padding 0..15
bytes
+

Unencrypted Message

+ + + + + +
auth_key_id = 0
int64
message_id
int64
message_data_length
int32
message_data
bytes
+

Creating an Authorization Key

+

An authorization key is normally created once for every user during the application installation process immediately prior to registration. Registration itself, in actuality, occurs after the authorization key is created. However, a user may be prompted to complete the registration form while the authorization key is being generated in the background. Intervals between user key strokes may be used as a source of entropy in the generation of high-quality random numbers required for the creation of an authorization key.

+

See Creating an Authorization Key.

+

During the creation of the authorization key, the client obtains its server salt (to be used with the new key for all communication in the near future). The client then creates an encrypted session using the newly generated key, and subsequent communication occurs within that session (including the transmission of the user's registration information and phone number validation) unless the client creates a new session. The client is free to create new or additional sessions at any time by choosing a new random session_id.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/mtproto-transports.html b/data/core.telegram.org/mtproto/mtproto-transports.html new file mode 100644 index 0000000000..ce1c53bcb7 --- /dev/null +++ b/data/core.telegram.org/mtproto/mtproto-transports.html @@ -0,0 +1,293 @@ + + + + + MTProto transports + + + + + + + + + + + + + +
+ +
+
+
+ +

MTProto transports

+ +
+ +

Here's a list of MTProto transport protocols (see the ISO/OSI recap for a full explanation):

+ +

The server recognizes these different protocols (and distinguishes them from HTTP, too) by the header. +Additionally, the following transport features can be used:

+ +

Example implementations for these protocols can be seen in tdlib and MadelineProto.

+

Abridged

+

The lightest protocol available.

+
    +
  • Overhead: Very small
  • +
  • Minimum envelope length: 1 byte
  • +
  • Maximum envelope length: 4 bytes
  • +
+

Payload structure:

+
+-+----...----+
+|l|  payload  |
++-+----...----+
+OR
+
++-+---+----...----+
+|h|len|  payload  +
++-+---+----...----+
+

Before sending anything into the underlying socket (see transports), the client must first send 0xef as the first byte (the server will not send 0xef as the first byte in the first reply).
+Then, payloads are wrapped in the following envelope:

+
    +
  • Length: payload length, divided by four, and encoded as a single byte, only if the resulting packet length is a value between 0x01..0x7e.
  • +
  • Payload: the MTProto payload
  • +
+

If the packet length divided by four is bigger than or equal to 127 (>= 0x7f), the following envelope must be used, instead:

+
    +
  • Header: A single byte of value 0x7f
  • +
  • Length: payload length, divided by four, and encoded as 3 length bytes (little endian)
  • +
  • Payload: the MTProto payload
  • +
+

Intermediate

+

In case 4-byte data alignment is needed, an intermediate version of the original protocol may be used.

+
    +
  • Overhead: small
  • +
  • Minimum envelope length: 4 bytes
  • +
  • Maximum envelope length: 4 bytes
  • +
+

Payload structure:

+
+----+----...----+
++len.+  payload  +
++----+----...----+
+

Before sending anything into the underlying socket (see transports), the client must first send 0xeeeeeeee as the first int (four bytes, the server will not send 0xeeeeeeee as the first int in the first reply).
+Then, payloads are wrapped in the following envelope:

+
    +
  • Length: payload length encoded as 4 length bytes (little endian)
  • +
  • Payload: the MTProto payload
  • +
+

Padded intermediate

+

Padded version of the intermediate protocol, to use with obfuscation enabled to bypass ISP blocks.

+
    +
  • Overhead: small-medium
  • +
  • Minimum envelope length: random
  • +
  • Maximum envelope length: random
  • +
+

Before sending anything into the underlying socket (see transports), the client must first send 0xdddddddd as the first int (four bytes, the server will not send 0xdddddddd as the first int in the first reply).
+Then, payloads are wrapped in the following envelope:

+
+----+----...----+----...----+
+|tlen|  payload  |  padding  |
++----+----...----+----...----+
+

Envelope description:

+
    +
  • Total length: payload+padding length encoded as 4 length bytes (little endian)
  • +
  • Payload: the MTProto payload
  • +
  • Padding: A random padding string of length 0-15
  • +
+

Full

+

The basic MTProto transport protocol

+
    +
  • Overhead: medium
  • +
  • Minimum envelope length: 12 bytes (length+seqno+crc)
  • +
  • Maximum envelope length: 12 bytes (length+seqno+crc)
  • +
+

Payload structure:

+
+----+----+----...----+----+
+|len.|seq.|  payload  |crc.|
++----+----+----...----+----+
+

Envelope description:

+
    +
  • Length: length+seqno+payload+crc length encoded as 4 length bytes (little endian, the length of the length field must be included, too)
  • +
  • Seqno: the TCP sequence number for this TCP connection (different from the MTProto sequence number): the first packet sent is numbered 0, the next one 1, etc.
  • +
  • payload: MTProto payload
  • +
  • crc: 4 CRC32 bytes computed using length, sequence number, and payload together.
  • +
+

Transport features

+

Additionally, the following transport features can be used:

+

Quick ack

+

These MTProto transport protocols have support for quick acknowledgment. +In this case, the client sets the highest-order length bit in the query packet, and the server responds with a special 4 bytes as a separate packet. +They are the 32 higher-order bits of SHA256 of the encrypted portion of the packet prepended by 32 bytes from the authorization key (the same hash as computed for verifying the message key), with the most significant bit set to make clear that this is not the length of a regular server response packet; if the abridged version is used, bswap is applied to these four bytes.

+

Transport errors

+

In the event of a transport error (missing auth key, transport flood, etc.), the server may send a packet with a signed little-endian number of 4 bytes, whose absolute value contains the error code (the error itself is actually negative).

+

For example, error Code 403 corresponds to situations where the corresponding HTTP error would have been returned by the HTTP protocol.

+

Error 404 (auth key not found) is returned when the specified auth key ID cannot be found by the DC.

+

Error 429 (transport flood) is returned when too many transport connections are established to the same IP in a too short lapse of time, or if any of the container/service message limits are reached.

+

Transport obfuscation

+

Transport obfuscation is required to use the websocket transports.

+

Transport obfuscation to prevent ISP blocks is implemented using the following protocol, situated under the MTProto transport in the ISO/OSI stack, see the recap; this means that the payload is first wrapped in the MTProto transport envelope (all transports are supported), and then obfuscated:

+

Prior to establishing the connection (and eventually sending the protocol header of a specific MTProto transport), a 64-byte (512-bit) random initialization payload is generated. +During the generation process, special care must be taken in order to avoid a situation where that the first int (first four bytes) of the random string are equal to one of the known protocol identifiers (see above).
+In particular, the first four bytes must not be equal to 0xdddddddd (padded intermediate), 0xeeeeeeee (intermediate), POST, GET, HEAD, or any of the HTTP methods that are accepted by the MTProto servers.
+The first byte must also not be equal to 0xef (abridged). +Bytes 4-8 must also not be equal to 0x00000000, since that would indicate use of the full transport with the initial TCP sequence number (0).

+

The protocol identifier, if present, must be inserted in the initialization payload at byte offset 56: if its length is less than 4, it must be padded using the protocol identifier itself, to make its length 4 (0xef => 0xefefefef): the standalone protocol identifier must be not be sent aftwerwards.

+

This protocol is also (but not exclusively) used when connecting to MTProxies: only in this case, the DC ID in a specially encoded form must also be inserted in the initialization payload at offset 60. +The encoding simply consist of the DC ID in two-byte signed little-endian form; 10000 has to be added to the DC ID to connect to the test servers; it has to be made negative if the DC we're connecting to is a media (not CDN) DC.

+

Next, a secondary initialization payload is generated by reversing the primary intialization payload.

+

Two keys are extracted from both initialization payloads, using bytes at offsets 8-40: the key extracted from the primary payload is used as encryption key, the key extracted from the secondary payload is used as decryption key.

+

Two IVs are extracted from both initialization payloads, using bytes at offsets 40-56: the IV extracted from the primary payload is used as encryption IV, the IV extracted from the secondary payload is used as decryption IV.

+

Only if using MTProxy, the secret is used to provide connection with the MTProxy server. +The secret is a 16-byte string, usually distributed in its hexadecimal form along with the MTProxy host and port.

+

Often, a 17-byte version of the secret can be found: this simply indicates that the client should use a specific MTProto transport (based on the first byte, usually it's 0xdd, to indicate that the padded intermediate protocol should be used 0xdddddddd; however, clients should default to the padded intermediate transport whenever an additional byte in the secret is encountered).

+

The extracted encryption and decryption keys must be concatenated with the secret (the first byte of which should be ignored if it's the 17-byte version), and the SHA256 hash of such string should be used as encryption/decryption key.

+

The obtained encryption and decryption key/IV pairs must then be used with AES-256-CTR to encrypt and decrypt all outgoing and incoming payloads.

+

The first thing that must be encrypted using the encryption key is the initialization payload itself. +Then bytes 56-64 of the encrypted initialization payload are substituted in the original initialization payload: this is the part that contains the constant MTProto transport protocol identifier and the DC ID (only for MTProxies).

+

The final initialization payload must then be sent in the socket as first 64 bytes after the TCP handshake.

+

Example pseudocode for the generation of an MTProxy connection payload (media DC 4) using the obfuscated padded intermediate transport. +Warning: do not use the specified proxy secret in any MTProxy exposed on the internet.

+
protocol := 0xdddddddd
+dc := 0xfcff
+
+while 1:
+    init := (56 random bytes) + protocol + dc + (2 random bytes)
+
+    if init[0] == 0xef:
+      continue
+
+    first_int := substr(init, 0, 4)
+    if first_int == 0x44414548 || first_int == 0x54534f50 || first_int == 0x20544547 || first_int == 0x4954504f || first_int == 0x02010316 || first_int == 0xdddddddd || first_int == 0xeeeeeeee:
+      continue
+
+    second_int := substr(init, 0, 4)
+    if second_int == 0x00000000:
+      continue
+
+    break
+
+initRev := strrev(init)
+
+encryptKey := substr(init, 8, 32)
+encryptIV := substr(init, 40, 16)
+
+decryptKey := substr(initRev, 8, 32)
+decryptIV := substr(initRev, 40, 16)
+
+secret := substr(0xdd99999999999999999999999999999999, 1, 16)
+
+encryptKey = SHA256(encryptKey + secret)
+decryptKey = SHA256(decryptKey + secret)
+
+encryptedInit := CTR(encryptKey, encryptIV, init)
+
+finalInit := substr(init, 0, 56) + substr(encryptedInit, 56, 8)
+
+write(finalInit)
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/mtproto/samples-auth_key.html b/data/core.telegram.org/mtproto/samples-auth_key.html new file mode 100644 index 0000000000..afbab15cfe --- /dev/null +++ b/data/core.telegram.org/mtproto/samples-auth_key.html @@ -0,0 +1,749 @@ + + + + + samples-auth_key + + + + + + + + + + + + + +
+ +
+
+
+ +

samples-auth_key

+ +

In the examples below, the transport headers are omitted:

+
+

If a payload (packet) needs to be transmitted from server to client or from client to server, it is encapsulated as follows: 4 bytes are added at the front (to include the length, the sequence number, and CRC32; always divisible by 4) and 4 bytes with the packet sequence number for this TCP connection (the first packet sent is numbered 0, the next one 1, etc.), and 4 CRC32 bytes at the end (length, sequence number, and payload together).

+

There is an abridged version of the same protocol: if the client sends 0xef as the first byte (important: only prior to the very first data packet), then packet length is encoded by a single byte (0x01-0x7e = data length divided by 4; or 0x7f followed by 3 bytes (little endian) divided into 4) followed by the data themselves (sequence number and CRC32 not added). In this case, server responses have the same form (although the server does not send 0xefas the first byte).

+
+

Detailed documentation on creating authorization keys is available here ».

+

1. Request for (p,q) Authorization

+
req_pq#60469778 nonce:int128 = ResPQ
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterOffset, Length in bytesValueDescription
auth_key_id0, 80Since message is in plain text
message_id8, 851e57ac42770964aExact unixtime * 2^32
message_length16, 420Message body length
%(req_pq)20, 460469778req_pq constructor number from TL schema
nonce24, 163E0549828CCA27E966B301A48FECE2FCRandom number
+

The header is 20 bytes long, the message body is 20 bytes long, and the entire message is 40 bytes in length.

+
0000 | 00 00 00 00 00 00 00 00 4A 96 70 27 C4 7A E5 51
+0010 | 14 00 00 00 78 97 46 60 3E 05 49 82 8C CA 27 E9
+0020 | 66 B3 01 A4 8F EC E2 FC
+

2. A response from the server has been received with the following content:

+
0000 | 00 00 00 00 00 00 00 00 01 C8 83 1E C9 7A E5 51
+0010 | 40 00 00 00 63 24 16 05 3E 05 49 82 8C CA 27 E9
+0020 | 66 B3 01 A4 8F EC E2 FC A5 CF 4D 33 F4 A1 1E A8
+0030 | 77 BA 4A A5 73 90 73 30 08 17 ED 48 94 1A 08 F9
+0040 | 81 00 00 00 15 C4 B5 1C 01 00 00 00 21 6B E8 6C
+0050 | 02 2B B4 C3
+
Response decomposition using the following formula:
+
resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector long = ResPQ 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterOffset, Length in bytesValueDescription
auth_key_id0, 80Since message is in plain text
message_id8, 851E57AC91E83C801Server message ID
message_length16, 464Message body length
%(resPQ)20, 405162463resPQ constructor number from TL schema
nonce24, 163E0549828CCA27E966B301A48FECE2FCValue generated by client in Step 1
server_nonce40, 16A5CF4D33F4A11EA877BA4AA573907330Server-generated random number
pq56, 1217ED48941A08F981Single-byte prefix denoting length, an 8-byte string, and three bytes of padding
%(Vector long)68, 41cb5c415Vector long constructor number from TL schema
count72, 41Number of elements in key fingerprint list
fingerprints[]76, 8c3b42b026ce86b2164 lower-order bits of SHA1 (server_public_key)
+

The server_public_key public key has been selected whose fingerprint corresponds to the only one received from the server: c3b42b026ce86b21.

+

3. Pq = 17ED48941A08F981 decomposed into 2 prime cofactors:

+
p = 494C553B
+q = 53911073
+

4. encrypted_data Generation

+
p_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterOffset, Length in bytesValueDescription
%(p_q_inner_data)0, 483c95aecp_q_inner_data constructor number from TL schema
pq4, 1217ED48941A08F981Single-byte prefix denoting length, 8-byte string, and three bytes of padding
p16, 8494C553BFirst prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding
q24, 853911073Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding
nonce32, 163E0549828CCA27E966B301A48FECE2FCValue generated by client in Step 1
server_nonce48, 16A5CF4D33F4A11EA877BA4AA573907330Value received from server in Step 2
new_nonce64, 32311C85DB234AA2640AFC4A76A735CF5B 1F0FD68BD17FA181E1229AD867CC024DClient-generated random number
+

The serialization of P_Q_inner_data produces some string data. This is followed by encrypted_data:

+
SHA1 (data) = DB761C27718A2305044F71F2AD951629D78B2449
+RSA (data_with_hash, server_public_key) = 7BB0100A523161904D9C69FA04BC60DECFC5DD74B99995C768EB60D8716E2109BAF2D4601DAB6B09610DC11067BB89021E09471FCFA52DBD0F23204AD8CA8B012BF40A112F44695AB6C266955386114EF5211E6372227ADBD34995D3E0E5FF02EC63A43F9926878962F7C570E6A6E78BF8366AF917A5272675C46064BE62E3E202EFA8B1ADFB1C32A898C2987BE27B5F31D57C9BB963ABCB734B16F652CEDB4293CBB7C878A3A3FFAC9DBEA9DF7C67BC9E9508E111C78FC46E057F5C65ADE381D91FEE430A6B576A99BDF8551FDB1BE2B57069B1A45730618F27427E8A04720B4971EF4A9215983D68F2830C3EAA6E40385562F970D38A05C9F1246DC33438E6
+

The length of the final string was 256 bytes.

+
Request to Start Diffie-Hellman Key Exchange
+
req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterOffset, Length in bytesValueDescription
auth_key_id0, 80Since message is in plain text
message_id8, 851e57ac917717a27Exact unixtime * 2^32
message_length16, 4320Message body length
%(req_DH_params)20, 4d712e4bereq_DH_params constructor number from TL schema
nonce24, 163E0549828CCA27E966B301A48FECE2FCValue generated by client in Step 1
server_nonce40, 16A5CF4D33F4A11EA877BA4AA573907330Value received from server in Step 2
p56, 8494C553BFirst prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding
q64, 853911073Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding
public_key_fingerprint72, 8c3b42b026ce86b21Fingerprint of public key used
encrypted_data80, 260See aboveSee “Generation of encrypted_data"
+
0000 | 00 00 00 00 00 00 00 00 27 7A 71 17 C9 7A E5 51
+0010 | 40 01 00 00 BE E4 12 D7 3E 05 49 82 8C CA 27 E9
+0020 | 66 B3 01 A4 8F EC E2 FC A5 CF 4D 33 F4 A1 1E A8
+0030 | 77 BA 4A A5 73 90 73 30 04 49 4C 55 3B 00 00 00
+0040 | 04 53 91 10 73 00 00 00 21 6B E8 6C 02 2B B4 C3
+0050 | FE 00 01 00 7B B0 10 0A 52 31 61 90 4D 9C 69 FA
+0060 | 04 BC 60 DE CF C5 DD 74 B9 99 95 C7 68 EB 60 D8
+0070 | 71 6E 21 09 BA F2 D4 60 1D AB 6B 09 61 0D C1 10
+0080 | 67 BB 89 02 1E 09 47 1F CF A5 2D BD 0F 23 20 4A
+0090 | D8 CA 8B 01 2B F4 0A 11 2F 44 69 5A B6 C2 66 95
+00A0 | 53 86 11 4E F5 21 1E 63 72 22 7A DB D3 49 95 D3
+00B0 | E0 E5 FF 02 EC 63 A4 3F 99 26 87 89 62 F7 C5 70
+00C0 | E6 A6 E7 8B F8 36 6A F9 17 A5 27 26 75 C4 60 64
+00D0 | BE 62 E3 E2 02 EF A8 B1 AD FB 1C 32 A8 98 C2 98
+00E0 | 7B E2 7B 5F 31 D5 7C 9B B9 63 AB CB 73 4B 16 F6
+00F0 | 52 CE DB 42 93 CB B7 C8 78 A3 A3 FF AC 9D BE A9
+0100 | DF 7C 67 BC 9E 95 08 E1 11 C7 8F C4 6E 05 7F 5C
+0110 | 65 AD E3 81 D9 1F EE 43 0A 6B 57 6A 99 BD F8 55
+0120 | 1F DB 1B E2 B5 70 69 B1 A4 57 30 61 8F 27 42 7E
+0130 | 8A 04 72 0B 49 71 EF 4A 92 15 98 3D 68 F2 83 0C
+0140 | 3E AA 6E 40 38 55 62 F9 70 D3 8A 05 C9 F1 24 6D
+0150 | C3 34 38 E6
+

5. A response from the server has been received with the following content:

+
0000 | 00 00 00 00 00 00 00 00 01 54 43 36 CB 7A E5 51
+0010 | 78 02 00 00 5C 07 E8 D0 3E 05 49 82 8C CA 27 E9
+0020 | 66 B3 01 A4 8F EC E2 FC A5 CF 4D 33 F4 A1 1E A8
+0030 | 77 BA 4A A5 73 90 73 30 FE 50 02 00 28 A9 2F E2
+0040 | 01 73 B3 47 A8 BB 32 4B 5F AB 26 67 C9 A8 BB CE
+0050 | 64 68 D5 B5 09 A4 CB DD C1 86 24 0A C9 12 CF 70
+0060 | 06 AF 89 26 DE 60 6A 2E 74 C0 49 3C AA 57 74 1E
+0070 | 6C 82 45 1F 54 D3 E0 68 F5 CC C4 9B 44 44 12 4B
+0080 | 96 66 FF B4 05 AA B5 64 A3 D0 1E 67 F6 E9 12 86
+0090 | 7C 8D 20 D9 88 27 07 DC 33 0B 17 B4 E0 DD 57 CB
+00A0 | 53 BF AA FA 9E F5 BE 76 AE 6C 1B 9B 6C 51 E2 D6
+00B0 | 50 2A 47 C8 83 09 5C 46 C8 1E 3B E2 5F 62 42 7B
+00C0 | 58 54 88 BB 3B F2 39 21 3B F4 8E B8 FE 34 C9 A0
+00D0 | 26 CC 84 13 93 40 43 97 4D B0 35 56 63 30 38 39
+00E0 | 2C EC B5 1F 94 82 4E 14 0B 98 63 77 30 A4 BE 79
+00F0 | A8 F9 DA FA 39 BA E8 1E 10 95 84 9E A4 C8 34 67
+0100 | C9 2A 3A 17 D9 97 81 7C 8A 7A C6 1C 3F F4 14 DA
+0110 | 37 B7 D6 6E 94 9C 0A EC 85 8F 04 82 24 21 0F CC
+0120 | 61 F1 1C 3A 91 0B 43 1C CB D1 04 CC CC 8D C6 D2
+0130 | 9D 4A 5D 13 3B E6 39 A4 C3 2B BF F1 53 E6 3A CA
+0140 | 3A C5 2F 2E 47 09 B8 AE 01 84 4B 14 2C 1E E8 9D
+0150 | 07 5D 64 F6 9A 39 9F EB 04 E6 56 FE 36 75 A6 F8
+0160 | F4 12 07 8F 3D 0B 58 DA 15 31 1C 1A 9F 8E 53 B3
+0170 | CD 6B B5 57 2C 29 49 04 B7 26 D0 BE 33 7E 2E 21
+0180 | 97 7D A2 6D D6 E3 32 70 25 1C 2C A2 9D FC C7 02
+0190 | 27 F0 75 5F 84 CF DA 9A C4 B8 DD 5F 84 F1 D1 EB
+01A0 | 36 BA 45 CD DC 70 44 4D 8C 21 3E 4B D8 F6 3B 8A
+01B0 | B9 5A 2D 0B 41 80 DC 91 28 3D C0 63 AC FB 92 D6
+01C0 | A4 E4 07 CD E7 C8 C6 96 89 F7 7A 00 74 41 D4 A6
+01D0 | A8 38 4B 66 65 02 D9 B7 7F C6 8B 5B 43 CC 60 7E
+01E0 | 60 A1 46 22 3E 11 0F CB 43 BC 3C 94 2E F9 81 93
+01F0 | 0C DC 4A 1D 31 0C 0B 64 D5 E5 5D 30 8D 86 32 51
+0200 | AB 90 50 2C 3E 46 CC 59 9E 88 6A 92 7C DA 96 3B
+0210 | 9E B1 6C E6 26 03 B6 85 29 EE 98 F9 F5 20 64 19
+0220 | E0 3F B4 58 EC 4B D9 45 4A A8 F6 BA 77 75 73 CC
+0230 | 54 B3 28 89 5B 1D F2 5E AD 9F B4 CD 51 98 EE 02
+0240 | 2B 2B 81 F3 88 D2 81 D5 E5 BC 58 01 07 CA 01 A5
+0250 | 06 65 C3 2B 55 27 15 F3 35 FD 76 26 4F AD 00 DD
+0260 | D5 AE 45 B9 48 32 AC 79 CE 7C 51 1D 19 4B C4 2B
+0270 | 70 EF A8 50 BB 15 C2 01 2C 52 15 CA BF E9 7C E6
+0280 | 6B 8D 87 34 D0 EE 75 9A 63 8A F0 13
+
Response decomposition using the following formula:
+
server_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;
+server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterOffset, Length in bytesValueDescription
auth_key_id0, 80Since message is in plain text
message_id8, 851E57ACB36435401Exact unixtime * 2^32
message_length16, 4632Message body length
%(server_DH_params_ok)20, 4d0e8075cserver_DH_params_ok constructor number from TL schema
nonce24, 163E0549828CCA27E966B301A48FECE2FCValue generated by client in Step 1
server_nonce40, 16A5CF4D33F4A11EA877BA4AA573907330Value received from server in Step 2
encrypted_answer56, 596See belowSee “Decomposition of encrypted_answer"
+
Conversion of encrypted_answer into answer:
+
encrypted_answer = 28A92FE20173B347A8BB324B5FAB2667C9A8BBCE6468D5B509A4CBDDC186240AC912CF7006AF8926DE606A2E74C0493CAA57741E6C82451F54D3E068F5CCC49B4444124B9666FFB405AAB564A3D01E67F6E912867C8D20D9882707DC330B17B4E0DD57CB53BFAAFA9EF5BE76AE6C1B9B6C51E2D6502A47C883095C46C81E3BE25F62427B585488BB3BF239213BF48EB8FE34C9A026CC8413934043974DB03556633038392CECB51F94824E140B98637730A4BE79A8F9DAFA39BAE81E1095849EA4C83467C92A3A17D997817C8A7AC61C3FF414DA37B7D66E949C0AEC858F048224210FCC61F11C3A910B431CCBD104CCCC8DC6D29D4A5D133BE639A4C32BBFF153E63ACA3AC52F2E4709B8AE01844B142C1EE89D075D64F69A399FEB04E656FE3675A6F8F412078F3D0B58DA15311C1A9F8E53B3CD6BB5572C294904B726D0BE337E2E21977DA26DD6E33270251C2CA29DFCC70227F0755F84CFDA9AC4B8DD5F84F1D1EB36BA45CDDC70444D8C213E4BD8F63B8AB95A2D0B4180DC91283DC063ACFB92D6A4E407CDE7C8C69689F77A007441D4A6A8384B666502D9B77FC68B5B43CC607E60A146223E110FCB43BC3C942EF981930CDC4A1D310C0B64D5E55D308D863251AB90502C3E46CC599E886A927CDA963B9EB16CE62603B68529EE98F9F5206419E03FB458EC4BD9454AA8F6BA777573CC54B328895B1DF25EAD9FB4CD5198EE022B2B81F388D281D5E5BC580107CA01A50665C32B552715F335FD76264FAD00DDD5AE45B94832AC79CE7C511D194BC42B70EFA850BB15C2012C5215CABFE97CE66B8D8734D0EE759A638AF013
+tmp_aes_key = F011280887C7BB01DF0FC4E17830E0B91FBB8BE4B2267CB985AE25F33B527253
+tmp_aes_iv = 3212D579EE35452ED23E0D0C92841AA7D31B2E9BDEF2151E80D15860311C85DB
+answer = BA0D89B53E0549828CCA27E966B301A48FECE2FCA5CF4D33F4A11EA877BA4AA57390733002000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100262AABA621CC4DF587DC94CF8252258C0B9337DFB47545A49CDD5C9B8EAE7236C6CADC40B24E88590F1CC2CC762EBF1CF11DCC0B393CAAD6CEE4EE5848001C73ACBB1D127E4CB93072AA3D1C8151B6FB6AA6124B7CD782EAF981BDCFCE9D7A00E423BD9D194E8AF78EF6501F415522E44522281C79D906DDB79C72E9C63D83FB2A940FF779DFB5F2FD786FB4AD71C9F08CF48758E534E9815F634F1E3A80A5E1C2AF210C5AB762755AD4B2126DFA61A77FA9DA967D65DFD0AFB5CDF26C4D4E1A88B180F4E0D0B45BA1484F95CB2712B50BF3F5968D9D55C99C0FB9FB67BFF56D7D4481B634514FBA3488C4CDA2FC0659990E8E868B28632875A9AA703BCDCE8FCB7AE551
+
Server_DH_inner_data decomposition using the following formula:
+
server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterOffset, Length in bytesValueDescription
%(server_DH_inner_data)0, 4b5890dbaserver_DH_inner_data constructor number from TL schema
nonce4, 163E0549828CCA27E966B301A48FECE2FCValue generated by client in Step 1
server_nonce20, 16A5CF4D33F4A11EA877BA4AA573907330Value received from server in Step 2
g36, 42Value received from server in Step 2
dh_prime40, 260C71CAEB9C6B1C9048E6C522F70F13F73 980D40238E3E21C14934D037563D930F 48198A0AA7C14058229493D22530F4DB FA336F6E0AC925139543AED44CCE7C37 20FD51F69458705AC68CD4FE6B6B13AB DC9746512969328454F18FAF8C595F64 2477FE96BB2A941D5BCD1D4AC8CC4988 0708FA9B378E3C4F3A9060BEE67CF9A4 A4A695811051907E162753B56B0F6B41 0DBA74D8A84B2A14B3144E0EF1284754 FD17ED950D5965B4B9DD46582DB1178D 169C6BC465B0D6FF9CA3928FEF5B9AE4 E418FC15E83EBEA0F87FA9FF5EED7005 0DED2849F47BF959D956850CE929851F 0D8115F635B105EE2E4E15D04B2454BF 6F4FADF034B10403119CD8E3B92FCC5B
g_a300, 260262AABA621CC4DF587DC94CF8252258C 0B9337DFB47545A49CDD5C9B8EAE7236 C6CADC40B24E88590F1CC2CC762EBF1C F11DCC0B393CAAD6CEE4EE5848001C73 ACBB1D127E4CB93072AA3D1C8151B6FB 6AA6124B7CD782EAF981BDCFCE9D7A00 E423BD9D194E8AF78EF6501F415522E4 4522281C79D906DDB79C72E9C63D83FB 2A940FF779DFB5F2FD786FB4AD71C9F0 8CF48758E534E9815F634F1E3A80A5E1 C2AF210C5AB762755AD4B2126DFA61A7 7FA9DA967D65DFD0AFB5CDF26C4D4E1A 88B180F4E0D0B45BA1484F95CB2712B5 0BF3F5968D9D55C99C0FB9FB67BFF56D 7D4481B634514FBA3488C4CDA2FC0659 990E8E868B28632875A9AA703BCDCE8F
server_time560, 41373993675Server time
+

6. Random number b is computed:

+
b = 6F620AFA575C9233EB4C014110A7BCAF49464F798A18A0981FEA1E05E8DA67D9681E0FD6DF0EDF0272AE3492451A84502F2EFC0DA18741A5FB80BD82296919A70FAA6D07CBBBCA2037EA7D3E327B61D585ED3373EE0553A91CBD29B01FA9A89D479CA53D57BDE3A76FBD922A923A0A38B922C1D0701F53FF52D7EA9217080163A64901E766EB6A0F20BC391B64B9D1DD2CD13A7D0C946A3A7DF8CEC9E2236446F646C42CFE2B60A2A8D776E56C8D7519B08B88ED0970E10D12A8C9E355D765F2B7BBB7B4CA9360083435523CB0D57D2B106FD14F94B4EEE79D8AC131CA56AD389C84FE279716F8124A543337FB9EA3D988EC5FA63D90A4BA3970E7A39E5C0DE5
+
Generation of encrypted_data
+
client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterOffset, Length in bytesValueDescription
%(client_DH_inner_data)0, 46643b654client_DH_inner_data constructor number from TL schema
nonce4, 163E0549828CCA27E966B301A48FECE2FCValue generated by client in Step 1
server_nonce20, 16A5CF4D33F4A11EA877BA4AA573907330Value received from server in Step 2
retry_id36, 80First attempt
g_b44, 26073700E7BFC7AEEC828EB8E0DCC04D09A 0DD56A1B4B35F72F0B55FCE7DB7EBB72 D7C33C5D4AA59E1C74D09B01AE536B31 8CFED436AFDB15FE9EB4C70D7F0CB14E 46DBBDE9053A64304361EB358A9BB32E 9D5C2843FE87248B89C3F066A7D5876D 61657ACC52B0D81CD683B2A0FA93E8AD AB20377877F3BC3369BBF57B10F5B589 E65A9C27490F30A0C70FFCFD3453F5B3 79C1B9727A573CFFDCA8D23C721B135B 92E529B1CDD2F7ABD4F34DAC4BE1EEAF 60993DDE8ED45890E4F47C26F2C0B2E0 37BB502739C8824F2A99E2B1E7E41658 3417CC79A8807A4BDAC6A5E9805D4F61 86C37D66F6988C9F9C752896F3D34D25 529263FAF2670A09B2A59CE35264511Fg^b mod dh_prime
+

The serialization of Client_DH_Inner_Data produces some string data. This is followed by encrypted_data:

+
data_with_hash := SHA1(data) + data + (0-15 random bytes); such that the length be divisible by 16;
+AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv) = 928A4957D0463B525C1CC48AABAA030A256BE5C746792C84CA4C5A0DF60AC799048D98A38A8480EDCF082214DFC79DCB9EE34E206513E2B3BC1504CFE6C9ADA46BF9A03CA74F192EAF8C278454ADABC795A566615462D31817382984039505F71CB33A41E2527A4B1AC05107872FED8E3ABCEE1518AE965B0ED3AED7F67479155BDA8E4C286B64CDF123EC748CF289B1DB02D1907B562DF462D8582BA6F0A3022DC2D3504D69D1BA48B677E3A830BFAFD67584C8AA24E1344A8904E305F9587C92EF964F0083F50F61EAB4A393EAA33C9270294AEDC7732891D4EA1599F52311D74469D2112F4EDF3F342E93C8E87E812DC3989BAECFE6740A46077524C75093F5A5405736DE8937BB6E42C9A0DCF22CA53227D462BCCC2CFE94B6FE86AB7FBFA395021F66661AF7C0024CA2986CA03F3476905407D1EA9C010B763258DB1AA2CC7826D91334EFC1FDC665B67FE45ED0
+

The length of the final string was 336 bytes.

+
Request
+
set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterOffset, Length in bytesValueDescription
auth_key_id0, 80Since message is in plain text
message_id8, 851e57acd2aa32c6dExact unixtime * 2^32
message_length16, 4376Message body length
%(set_client_DH_params)20, 4f5045f1fset_client_DH_params constructor number from TL schema
nonce24, 163E0549828CCA27E966B301A48FECE2FCValue generated by client in Step 1
server_nonce40, 16A5CF4D33F4A11EA877BA4AA573907330Value received from server in Step 2
encrypted_data56, 340See aboveSee “Generation of encrypted_data"
+
0000 | 00 00 00 00 00 00 00 00 6D 2C A3 2A CD 7A E5 51
+0010 | 78 01 00 00 1F 5F 04 F5 3E 05 49 82 8C CA 27 E9
+0020 | 66 B3 01 A4 8F EC E2 FC A5 CF 4D 33 F4 A1 1E A8
+0030 | 77 BA 4A A5 73 90 73 30 FE 50 01 00 92 8A 49 57
+0040 | D0 46 3B 52 5C 1C C4 8A AB AA 03 0A 25 6B E5 C7
+0050 | 46 79 2C 84 CA 4C 5A 0D F6 0A C7 99 04 8D 98 A3
+0060 | 8A 84 80 ED CF 08 22 14 DF C7 9D CB 9E E3 4E 20
+0070 | 65 13 E2 B3 BC 15 04 CF E6 C9 AD A4 6B F9 A0 3C
+0080 | A7 4F 19 2E AF 8C 27 84 54 AD AB C7 95 A5 66 61
+0090 | 54 62 D3 18 17 38 29 84 03 95 05 F7 1C B3 3A 41
+00A0 | E2 52 7A 4B 1A C0 51 07 87 2F ED 8E 3A BC EE 15
+00B0 | 18 AE 96 5B 0E D3 AE D7 F6 74 79 15 5B DA 8E 4C
+00C0 | 28 6B 64 CD F1 23 EC 74 8C F2 89 B1 DB 02 D1 90
+00D0 | 7B 56 2D F4 62 D8 58 2B A6 F0 A3 02 2D C2 D3 50
+00E0 | 4D 69 D1 BA 48 B6 77 E3 A8 30 BF AF D6 75 84 C8
+00F0 | AA 24 E1 34 4A 89 04 E3 05 F9 58 7C 92 EF 96 4F
+0100 | 00 83 F5 0F 61 EA B4 A3 93 EA A3 3C 92 70 29 4A
+0110 | ED C7 73 28 91 D4 EA 15 99 F5 23 11 D7 44 69 D2
+0120 | 11 2F 4E DF 3F 34 2E 93 C8 E8 7E 81 2D C3 98 9B
+0130 | AE CF E6 74 0A 46 07 75 24 C7 50 93 F5 A5 40 57
+0140 | 36 DE 89 37 BB 6E 42 C9 A0 DC F2 2C A5 32 27 D4
+0150 | 62 BC CC 2C FE 94 B6 FE 86 AB 7F BF A3 95 02 1F
+0160 | 66 66 1A F7 C0 02 4C A2 98 6C A0 3F 34 76 90 54
+0170 | 07 D1 EA 9C 01 0B 76 32 58 DB 1A A2 CC 78 26 D9
+0180 | 13 34 EF C1 FD C6 65 B6 7F E4 5E D0
+

7. Computing auth_key using formula g^{ab} mod dh_prime:

+
auth_key = AB96E207C631300986F30EF97DF55E179E63C112675F0CE502EE76D74BBEE6CBD1E95772818881E9F2FF54BD52C258787474F6A7BEA61EABE49D1D01D55F64FC07BC31685716EC8FB46FEACF9502E42CFD6B9F45A08E90AA5C2B5933AC767CBE1CD50D8E64F89727CA4A1A5D32C0DB80A9FCDBDDD4F8D5A1E774198F1A4299F927C484FEEC395F29647E43C3243986F93609E23538C21871DF50E00070B3B6A8FA9BC15628E8B43FF977409A61CEEC5A21CF7DFB5A4CC28F5257BC30CD8F2FB92FBF21E28924065F50E0BBD5E11A420300E2C136B80E9826C6C5609B5371B7850AA628323B6422F3A94F6DFDE4C3DC1EA60F7E11EE63122B3F39CBD1A8430157
+

8. The server verifies that auth_key_hash is unique.

+

The key is unique.

+

9. A response from the server has been received with the following content:

+
0000 | 00 00 00 00 00 00 00 00 01 30 AA C5 CE 7A E5 51
+0010 | 34 00 00 00 34 F7 CB 3B 3E 05 49 82 8C CA 27 E9
+0020 | 66 B3 01 A4 8F EC E2 FC A5 CF 4D 33 F4 A1 1E A8
+0030 | 77 BA 4A A5 73 90 73 30 CC EB C0 21 72 66 E1 ED
+0040 | EC 7F B0 A0 EE D6 C2 20
+

Set_client_DH_params_answer decomposition using the following formula:

+
dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;
+dh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;
+dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterOffset, Length in bytesValueDescription
%(dh_gen_ok)0, 43bcbf734dh_gen_ok constructor number from TL schema
nonce4, 163E0549828CCA27E966B301A48FECE2FCValue generated by client in Step 1
server_nonce20, 16A5CF4D33F4A11EA877BA4AA573907330Value received from server in Step 2
new_nonce_hash136, 16CCEBC0217266E1EDEC7FB0A0EED6C220
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/security_guidelines.html b/data/core.telegram.org/mtproto/security_guidelines.html new file mode 100644 index 0000000000..5e5a44b579 --- /dev/null +++ b/data/core.telegram.org/mtproto/security_guidelines.html @@ -0,0 +1,177 @@ + + + + + Security Guidelines for Client Developers + + + + + + + + + + + + + +
+ +
+
+
+ +

Security Guidelines for Client Developers

+ +
+ +

See also:

+

+ +

While MTProto is designed to be a reasonably fast and secure protocol, its advantages can be easily negated by careless implementation. We collected some security guidelines for client software developers on this page. All Telegram clients are required to comply.

+
+

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.

+
+

Diffie-Hellman key exchange

+

We use DH key exchange in two cases:

+ +

In both cases, there are some verifications to be done whenever DH is used:

+

Validation of DH parameters

+

Client is expected to check whether p = dh_prime 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 not to repeat lengthy computations in future.

+

If the verification takes too long (which is the case for older mobile devices), one might initially run only 15 Miller--Rabin iterations (use parameter 30 in Java) for verifying primeness of p and (p - 1)/2 with error probability not exceeding one billionth, and do more iterations in the background later.

+

Another way to optimize this is to embed into the client application code a small table with some known "good" couples (g,p) (or just known safe primes p, since the condition on g is easily verified during execution), checked during code generation phase, so as to avoid doing such verification during runtime altogether. The server rarely changes these values, thus one usually needs to put the current value of server's dh_prime into such a table. For example, the current value of dh_prime equals (in big-endian byte order)

+
C7 1C AE B9 C6 B1 C9 04 8E 6C 52 2F 70 F1 3F 73 98 0D 40 23 8E 3E 21 C1 49 34 D0 37 56 3D 93 0F 48 19 8A 0A A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E 0A C9 25 13 95 43 AE D4 4C CE 7C 37 20 FD 51 F6 94 58 70 5A C6 8C D4 FE 6B 6B 13 AB DC 97 46 51 29 69 32 84 54 F1 8F AF 8C 59 5F 64 24 77 FE 96 BB 2A 94 1D 5B CD 1D 4A C8 CC 49 88 07 08 FA 9B 37 8E 3C 4F 3A 90 60 BE E6 7C F9 A4 A4 A6 95 81 10 51 90 7E 16 27 53 B5 6B 0F 6B 41 0D BA 74 D8 A8 4B 2A 14 B3 14 4E 0E F1 28 47 54 FD 17 ED 95 0D 59 65 B4 B9 DD 46 58 2D B1 17 8D 16 9C 6B C4 65 B0 D6 FF 9C A3 92 8F EF 5B 9A E4 E4 18 FC 15 E8 3E BE A0 F8 7F A9 FF 5E ED 70 05 0D ED 28 49 F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6 35 B1 05 EE 2E 4E 15 D0 4B 24 54 BF 6F 4F AD F0 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B
+

g_a and g_b validation

+

Apart from the conditions on the Diffie-Hellman prime dh_prime and generator g, both sides are to check that g, g_a and g_b are greater than 1 and less than dh_prime - 1. We recommend checking that g_a and g_b are between 2^{2048-64} and dh_prime - 2^{2048-64} as well.

+

Checking SHA1 hash values during key generation

+

Once the client receives a server_DH_params_ok answer in step 5) of the Authorization Key generation protocol and decrypts it obtaining answer_with_hash, it MUST check that

+
answer_with_hash := SHA1(answer) + answer + (0-15 random bytes)
+

In other words, the first 20 bytes of answer_with_hash must be equal to SHA1 of the remainder of the decrypted message without the padding random bytes.

+

Checking nonce, server_nonce and new_nonce fields

+

When the client receives and/or decrypts server messages during creation of Authorization Key, and these messages contain some nonce fields already known to the client from messages previously obtained during the same run of the protocol, the client is to check that these fields indeed contain the values previosly known.

+

Using secure pseudorandom number generator to create DH secret parameters a and b

+

Client must use a cryptographically secure PRNG to generate secret exponents a or b for DH key exchange. For secret chats, the client might request some entropy (random bytes) from the server while invoking messages.getDhConfig and feed these random bytes into its PRNG (for example, by PRNG_seed if OpenSSL library is used), but never using these "random" bytes by themselves or replacing by them the local PRNG seed. One should mix bytes received from server into local PRNG seed.

+

MTProto Encrypted Messages

+

Some important checks are to be done while sending and especially receiving encrypted MTProto messages.

+

Checking SHA256 hash value of msg_key

+

msg_key is used not only to compute the AES key and IV to decrypt the received message. After decryption, the client MUST check that msg_key is indeed equal to SHA256 of the plaintext obtained as the result of decryption (including the final 12...1024 padding bytes), prepended with 32 bytes taken from the auth_key, as explained in MTProto 2.0 Description.

+

If an error is encountered before this check could be performed, the client must perform the msg_key check anyway before returning any result. Note that the response to any error encountered before the msg_key check must be the same as the response to a failed msg_key check.

+

Checking message length

+

The client must check that the length of the message or container obtained from the decrypted message (computed from its length field) does not exceed the total size of the plaintext, and that the difference (i.e. the length of the random padding) lies in the range from 12 to 1024 bytes.

+

The length should be always divisible by 4 and non-negative. On no account the client is to access data past the end of the decryption buffer containing the plaintext message.

+

Checking session_id

+

The client is to check that the session_id field in the decrypted message indeed equals to that of an active session created by the client.

+

Checking msg_id

+

The client must check that msg_id has even parity for messages from client to server, and odd parity for messages from server to client.

+

In addition, the identifiers (msg_id) of the last N messages received from the other side must be stored, and if a message comes in with an msg_id lower than all or equal to any of the stored values, that message is to be ignored. Otherwise, the new message msg_id is added to the set, and, if the number of stored msg_id values is greater than N, the oldest (i. e. the lowest) is discarded.

+

In addition, msg_id values that belong over 30 seconds in the future or over 300 seconds in the past are to be ignored (recall that msg_id approximately equals unixtime * 2^32). This is especially important for the server. The client would also find this useful (to protect from a replay attack), but only if it is certain of its time (for example, if its time has been synchronized with that of the server).

+

Certain client-to-server service messages containing data sent by the client to the server (for example, msg_id of a recent client query) may, nonetheless, be processed on the client even if the time appears to be “incorrect”. This is especially true of messages to change server_salt and notifications about invalid time on the client. See Mobile Protocol: Service Messages.

+

Behavior in case of mismatch

+

If one of the checks listed above fails, the client is to completely discard the message obtained from server. We also recommend closing and reestablishing the TCP connection to the server, then retrying the operation or the whole key generation protocol.

+

No information from incorrect messages can be used. Even if the application throws an exception and dies, this is much better than continuing with invalid data.

+

Notice that invalid messages will infrequently appear during normal work even if no malicious tampering is being done. This is due to network transmission errors. We recommend ignoring the invalid message and closing the TCP connection, then creating a new TCP connection to the server and retrying the original query.

+
+

The previous version of security recommendations relevant for MTProto 1.0 clients is available here.

+
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/mtproto/security_guidelines_v1.html b/data/core.telegram.org/mtproto/security_guidelines_v1.html new file mode 100644 index 0000000000..38b59f3e62 --- /dev/null +++ b/data/core.telegram.org/mtproto/security_guidelines_v1.html @@ -0,0 +1,175 @@ + + + + + Security Guidelines for Client Developers (v.1.0, DEPRECATED) + + + + + + + + + + + + + +
+ +
+
+
+ +

Security Guidelines for Client Developers (v.1.0, DEPRECATED)

+ +
+ +
+

This document describes security recommendations for clients using MTProto 1.0, its status is DEPRECATED. +For up-to-date security recommendations, kindly see this document.

+
+

See also:

+

+ +

While MTProto is designed to be a reasonably fast and secure protocol, its advantages can be easily negated by careless implementation. We collected some security guidelines for client software developers on this page. All Telegram clients are required to comply with these.

+

Diffie--Hellman key exchange

+

We use DH key exchange in two cases:

+ +

In both cases, there are some verifications to be done whenever DH is used:

+

Validation of DH parameters

+

Client is expected to check whether p = dh_prime 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 not to repeat lengthy computations in future.

+

If the verification takes too long (which is the case for older mobile devices), one might initially run only 15 Miller--Rabin iterations (use parameter 30 in Java) for verifying primeness of p and (p - 1)/2 with error probability not exceeding one billionth, and do more iterations in the background later.

+

Another way to optimize this is to embed into the client application code a small table with some known "good" couples (g,p) (or just known safe primes p, since the condition on g is easily verified during execution), checked during code generation phase, so as to avoid doing such verification during runtime altogether. The server rarely changes these values, thus one usually needs to put the current value of server's dh_prime into such a table. For example, the current value of dh_prime equals (in big-endian byte order)

+
C7 1C AE B9 C6 B1 C9 04 8E 6C 52 2F 70 F1 3F 73 98 0D 40 23 8E 3E 21 C1 49 34 D0 37 56 3D 93 0F 48 19 8A 0A A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E 0A C9 25 13 95 43 AE D4 4C CE 7C 37 20 FD 51 F6 94 58 70 5A C6 8C D4 FE 6B 6B 13 AB DC 97 46 51 29 69 32 84 54 F1 8F AF 8C 59 5F 64 24 77 FE 96 BB 2A 94 1D 5B CD 1D 4A C8 CC 49 88 07 08 FA 9B 37 8E 3C 4F 3A 90 60 BE E6 7C F9 A4 A4 A6 95 81 10 51 90 7E 16 27 53 B5 6B 0F 6B 41 0D BA 74 D8 A8 4B 2A 14 B3 14 4E 0E F1 28 47 54 FD 17 ED 95 0D 59 65 B4 B9 DD 46 58 2D B1 17 8D 16 9C 6B C4 65 B0 D6 FF 9C A3 92 8F EF 5B 9A E4 E4 18 FC 15 E8 3E BE A0 F8 7F A9 FF 5E ED 70 05 0D ED 28 49 F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6 35 B1 05 EE 2E 4E 15 D0 4B 24 54 BF 6F 4F AD F0 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B
+

g_a and g_b validation

+

Apart from the conditions on the Diffie-Hellman prime dh_prime and generator g, both sides are to check that g, g_a and g_b are greater than 1 and less than dh_prime - 1. We recommend checking that g_a and g_b are between 2^{2048-64} and dh_prime - 2^{2048-64} as well.

+

Checking SHA1 hash values

+

Once the client receives a server_DH_params_ok answer in step 5) of the Authorization Key generation protocol and decrypts it obtaining answer_with_hash, it MUST check that

+
answer_with_hash := SHA1(answer) + answer + (0-15 random bytes)
+

In other words, the first 20 bytes of answer_with_hash must be equal to SHA1 of the remainder of the decrypted message without the padding random bytes.

+

Checking nonce, server_nonce and new_nonce fields

+

When the client receives and/or decrypts server messages during creation of Authorization Key, and these messages contain some nonce fields already known to the client from messages previously obtained during the same run of the protocol, the client is to check that these fields indeed contain the values previosly known.

+

Using secure pseudorandom number generator to create DH secret parameters a and b

+

Client must use a cryptographically secure PRNG to generate secret exponents a or b for DH key exchange. For secret chats, the client might request some entropy (random bytes) from the server while invoking messages.getDhConfig and feed these random bytes into its PRNG (for example, by PRNG_seed if OpenSSL library is used), but never using these "random" bytes by themselves or replacing by them the local PRNG seed. One should mix bytes received from server into local PRNG seed.

+

MTProto Encrypted Messages

+

Some important checks are to be done while sending and especially receiving encrypted MTProto messages.

+

Checking SHA1 hash value of msg_key

+

msg_key is used not only to compute the AES key and IV to decrypt the received message. After decryption, the client MUST check that msg_key is indeed equal to SHA1 of the plaintext obtained as the result of decryption (without the final padding bytes).

+

If an error is encountered before this check could be performed, the client must perform the msg-key check anyway before returning any result. Note that the response to any error encountered before the msg_key check must be the same as the response to a failed msg_key check.

+

Checking message length

+

The client is to check that the length of the message or container obtained from the decrypted message (computed from its length field) does not exceed the total size of the plaintext, and that the difference is not more than 15 bytes. Apart from this, knowing the total length is important for the previous verification.

+

The length should be always divisible by 4 and non-negative. On no account the client is to access data past the end of the decryption buffer containing the plaintext message.

+

Checking session_id

+

The client is to check that the session_id field in the decrypted message indeed equals to that of an active session created by the client.

+

Checking msg_id

+

The client must check that msg_id has even parity for messages from client to server, and odd parity for messages from server to client.

+

In addition, the identifiers (msg_id) of the last N messages received from the other side must be stored, and if a message comes in with an msg_id lower than all or equal to any of the stored values, that message is to be ignored. Otherwise, the new message msg_id is added to the set, and, if the number of stored msg_id values is greater than N, the oldest (i. e. the lowest) is discarded.

+

In addition, msg_id values that belong over 30 seconds in the future or over 300 seconds in the past are to be ignored (recall that msg_id approximately equals unixtime * 2^32). This is especially important for the server. The client would also find this useful (to protect from a replay attack), but only if it is certain of its time (for example, if its time has been synchronized with that of the server).

+

Certain client-to-server service messages containing data sent by the client to the server (for example, msg_id of a recent client query) may, nonetheless, be processed on the client even if the time appears to be “incorrect”. This is especially true of messages to change server_salt and notifications about invalid time on the client. See Mobile Protocol: Service Messages.

+

Behavior in case of mismatch

+

If one of the checks listed above fails, the client is to completely discard the message obtained from server. We also recommend closing and reestablishing the TCP connection to the server, then retrying the operation or the whole key generation protocol.

+

No information from incorrect messages can be used. Even if the application throws an exception and dies, this is much better than continuing with invalid data.

+

Notice that invalid messages will infrequently appear during normal work even if no malicious tampering is being done. This is due to network transmission errors. We recommend ignoring the invalid message and closing the TCP connection, then creating a new TCP connection to the server and retrying the original query.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/mtproto/serialize.html b/data/core.telegram.org/mtproto/serialize.html new file mode 100644 index 0000000000..9045264529 --- /dev/null +++ b/data/core.telegram.org/mtproto/serialize.html @@ -0,0 +1,240 @@ + + + + + Binary Data Serialization + + + + + + + + + + + + + +
+ +
+
+
+ +

Binary Data Serialization

+ +

MTProto operation requires that elementary and composite data types as well as queries to which such data types are passed as arguments or by which they are returned, be transmitted in binary format (i. e. serialized) . +The TL language is used to describe the data types to be serialized.

+

General Definitions

+

For our purposes, we can identify a type with the set of its (serialized) values understood as strings (finite sequences) of 32-bit numbers (transmitted in little endian order).

+

Therefore:

+
    +
  • Alphabet (A), in this case, is a set of 32-bit numbers (normally, signed, i. e. between -2^31 and 2^31 - 1).
  • +
  • Value, in this case, is the same as a string in Alphabet A, i. e. a finite (possibly, empty) sequence of 32-bit numbers. The set of all such sequences is designated as A*.
  • +
  • Type, for our purposes, is the same as the set of legal values of a type, i. e. some set T which is a subset of A* and is a prefix code (i. e. no element of T may be a prefix for any other element). Therefore, any sequence from A* can contain no more than one prefix that is a member of T.
  • +
  • Value of Type T is any sequence (value) which is a member of T as a subset of A*.
  • +
  • Compatible Types are the types T and T’ not intersecting as subsets of A*, such that the union of T and T' is a prefix code.
  • +
  • Coordinated System of Types is a finite or infinite set of types T_1, ..., T_n, ..., such that any two types from this set are compatible.
  • +
  • Data Type is the same as type in the sense of the definition above.
  • +
  • Functional Type is a type describing a function; it is not a type in the sense of the definition above. Initially, we ignore the existence of functional types and describe only the data types; however, in reality, functional types will later be implemented in some extension of this system using the so-called temporary combinators.
  • +
+

Combinators, Constructors, Composite Data Types

+
    +
  • +

    Combinator is a function that takes arguments of certain types and returns a value of some other type. We normally look at combinators whose argument and result types are data types (rather than functional types).

    +
  • +
  • +

    Arity (of combinator) is a non-negative integer, the number of combinator arguments.

    +
  • +
  • +

    Combinator identifier is an identifier beginning with a lowercase Roman letter that uniquely identifies a combinator.

    +
  • +
  • +

    Combinator number or combinator name is a 32-bit number (i.e., an element of A) that uniquely identifies a combinator. Most often, it is CRC32 of the string containing the combinator description without the final semicolon, and with one space between contiguous lexemes. This always falls in the range from 0x01000000 to 0xffffff00. The highest 256 values are reserved for the so-called temporal-logic combinators used to transmit functions. We frequently denote as combinator the combinator name with single quotes: ‘combinator’.

    +
  • +
  • +

    Combinator description is a string of format combinator_name type_arg_1 ... type_arg_N = type_res; where N stands for the arity of the combinator, type_arg_i is the type of the i-th argument (or rather, a string with the combinator name), and type_res is the combinator value type.

    +
  • +
  • +

    Constructor is a combinator that cannot be computed (reduced). This is used to represent composite data types. For example, combinator ‘int_tree’ with description int_tree IntTree int IntTree = IntTree, alongside combinator empty_tree = IntTree, may be used to define a composite data type called “IntTree” that takes on values in the form of binary trees with integers as nodes.

    +
  • +
  • +

    Function (functional combinator) is a combinator which may be computed (reduced) on condition that the requisite number of arguments of requisite types are provided. The result of the computation is an expression consisting of constructors and base type values only.

    +
  • +
  • +

    Normal form is an expression consisting only of constructors and base type values; that which is normally the result of computing a function.

    +
  • +
  • +

    Type identifier is an identifier that normally starts with a capital letter in Roman script and uniquely identifies the type.

    +
  • +
  • +

    Type number or type name is a 32-bit number that uniquely identifies a type; it normally is the sum of the CRC32 values of the descriptions of the type constructors.

    +
  • +
  • +

    Description of (composite) Type T is a collection of the descriptions of all constructors that take on Type T values. This is normally written as text with each string containing the description of a single constructor. Here is a description of Type ‘IntTree’, for example:

    +

    int_tree IntTree int IntTree = IntTree; +empty_tree = IntTree;

    +
  • +
  • +

    Polymorphic type is a type whose description contains parameters (type variables) in lieu of actual types; approximately, what would be a template in C++. Here is a description of Type List alpha where List is a polymorphic type of arity 1 (i. e., dependent on a single argument), and alpha is a type variable which appears as the constructor’s optional parameter (in curly braces):

    +

    cons {alpha:Type} alpha (List alpha) = List alpha; +nil {alpha:Type} = List alpha;

    +
  • +
  • +

    Value of (composite) Type T is any sequence from A* in the format constr_num arg1 ... argN, where constr_num is the index number of some Constructor C which takes on values of Type T, and arg_i is a value of Type T_i which is the type of the i-th argument to Constructor C. For example, let Combinator int_tree have the index number 17, whereas Combinator empty_tree has the index number 239. Then, the value of Type IntTree is, for example, 17 17 239 1 239 2 239 which is more conveniently written as 'int_tree' 'int_tree' 'empty_tree' 1 'empty_tree' 2 ‘empty_tree’. From the standpoint of a high-level language, this is int_tree (int_tree (empty_tree) 1 (empty_tree)) 2 (empty_tree): IntTree.

    +
  • +
  • +

    Schema is a collection of all the (composite) data type descriptions. This is used to define some agreed-to system of types.

    +
  • +
+

Boxed and Bare Types

+
    +
  • Boxed type is a type any value of which starts with the constructor number. Since every constructor has a uniquely determined value type, the first number in any boxed type value uniquely defines its type. This guarantees that the various boxed types in totality make up a coordinated system of types. A boxed type identifier is always capitalized.
  • +
  • Bare type is a type whose values do not contain a constructor number, which is implied instead. A bare type identifier always coincides with the name of the implied constructor (and therefore, begins with a lowercase letter) which may be padded at the front by the percentage sign (%). In addition, if X is a boxed type with no more than a single constructor, then %X refers to the corresponding bare type. The values of a bare type are identical with the set of number sequences obtained by dropping the first number (i. e., the external constructor index number) from the set of values of the corresponding boxed type (which is the result type of the selected constructor), starting with the selected constructor index number. For example, 3 4 is a value of the int_couple bare type, defined using int_couple int int = IntCouple. The corresponding boxed type is IntCouple; if 404 is the constructor index number for int_couple, then 404 3 4 is the value for the IntCouple boxed type which corresponds to the value of the bare type int_couple (also known as %int_couple and %IntCouple; the latter form is conceptually preferable but longer).
  • +
+

Conceptually, only boxed types should be used everywhere. However, for speed and compactness, bare types have to be used (for instance, an array of 10,000 bare int values is 40,000 bytes long, whereas boxed Int values take up twice as much space; therefore, when transmitting a large array of integer identifiers, say, it is more efficient to use the Vector int type rather than Vector Int). In addition, all base types (int, long, double, string) are bare.

+

If a boxed type is polymorphic of type arity r, this is also true of any derived bare type. In other words, if one were to define intCouple {alpha:Type} int alpha = IntCouple alpha, then, thereafter, intCouple as an identifier would also be a polymorphic type of arity 1 in combinator (and consequently, in constructor and type) descriptions. The notations intCouple X, %(IntCouple X), and %IntCouple X are equivalent.

+

Base Types

+

Base types exist both as bare (int, long, double, string) and as boxed (Int, Long, Double, String) versions. Their constructor identifiers coincide with the names of the relevant bare types. Their pseudodescriptions have the following appearance:

+
int ? = Int;
+long ? = Long;
+double ? = Double;
+string ? = String;
+

Consequently, the int constructor index number, for example, is the CRC32 of the string "int ? = Int".

+

The values of bare type int are exactly all the single-element sequences, i. e. numbers between -2^31 and 2^31-1 represent themselves in this case. Values of type long are two-element sequences that are 64-bit signed numbers (little endian again). Values of type double, again, are two-element sequences containing 64-bit real numbers in a standard double format. And finally, the values of type string look differently depending on the length L of the string being serialized:

+
    +
  • If L <= 253, the serialization contains one byte with the value of L, then L bytes of the string followed by 0 to 3 characters containing 0, such that the overall length of the value be divisible by 4, whereupon all of this is interpreted as a sequence of int(L/4)+1 32-bit numbers.
  • +
  • If L >= 254, the serialization contains byte 254, followed by 3 bytes with the string length L, followed by L bytes of the string, further followed by 0 to 3 null padding bytes.
  • +
+

Object Pseudotype

+

The Object pseudotype is a “type” which can take on values that belong to any boxed type in the schema. This helps quickly define such types as list of random items without using polymorphic types. It is best not to abuse this capability since it results in the use of dynamic typing. Nonetheless, it is hard to imagine the data structures that we know from PHP and JSON without using the Object pseudotype.

+

It is recommended to use TypedObject instead whenever possible:

+
object X:Type value:X = TypedObject;
+

Built-In Composite Types: Vectors and Associative Arrays

+

The Vector t polymorphic pseudotype is a “type” whose value is a sequence of values of any type t, either boxed or bare.

+
vector {t:Type} # [ t ] = Vector t;
+

Serialization always uses the same constructor “vector” (const 0x1cb5c415 = crc32("vector t:Type # [ t ] = Vector t”) that is not dependent on the specific value of the variable of type t. The value of the Vector t type is the index number of the relevant constructor number followed by N, the number of elements in the vector, and then by N values of type t. The value of the optional parameter t is not involved in the serialization since it is derived from the result type (always known prior to deserialization).

+

Polymorphic pseudotypes IntHash t and StrHash t are associative arrays mapping integer and string keys to values of type t. They are, in fact, vectors containing bare 2-tuples (int, t) or (string, t):

+
coupleInt {t:Type} int t = CoupleInt t;
+intHash {t:Type} (vector %(CoupleInt t)) = IntHash t;
+coupleStr {t:Type} string t = CoupleStr t;
+strHash {t:Type} (vector %(CoupleStr t)) = StrHash t;
+

The percentage sign, in this case, means that a bare type that corresponds to the boxed type in parentheses is taken; the boxed type in question must have no more than a single constructor, whatever the values of the parameters.

+

The keys may be sorted or be in some other order (as in PHP arrays). For associative arrays with sorted keys, the IntSortedHash or StrSortedHash alias is used:

+
intSortedHash {t:Type} (intHash t) = IntSortedHash t;
+strSortedHash {t:Type} (strHash t) = StrSortedHash t;
+

Polymorphic Type Constructors

+

The constructor of a polymorphic type does not depend on the specific types to which the polymorphic type is applied. When it is computed, optional parameters (normally containing type variables and placed in curly braces) cease to be optional (the curly braces are removed), and, in addition to that, all parenthesis are also removed. Therefore,

+
vector {t:Type} # [ t ] = Vector t;
+

corresponds to the constructor number crc32("vector t:Type # [ t ] = Vector t") = 0x1cb5c415. During (de)serialization, the specific values of the optional variable t are derived from the result type (i. e. the object being serialized or deserialized) that is always known, and are never serialized explicitly.

+

Previously, it had to be known which specific variable types each polymorphic type will apply to. To accomplish this, the type system used strings of the form

+
polymorphic_type_name type_1 ... type_N;
+

For example,

+
Vector int;
+Vector string;
+Vector Object;
+

Now they are ignored.

+

See also polymorphism in TL.

+

In this case, the Object pseudotype permits using Vector Object to store lists of anything (the values of any boxed types). Since bare types are efficient when short, in practice it is unlikely that cases more complex than the ones cited above will be required.

+

Field Names

+

Let us say that we need to represent users as triplets containing one integer (user ID) and two strings (first and last names). The requisite data structure is the triplet int, string, string which may be declared as follows:

+
user int string string = User;
+

On the other hand, a group may be described by a similar triplet consisting of a group ID, its name, and description:

+
group int string string = Group;
+

For the difference between User and Group to be clear, it is convenient to assign names to some or all of the fields:

+
user id:int first_name:string last_name:string = User;
+group id:int title:string description:string = Group;
+

If the User type needs to be extended at a later time by having records with some additional field added to it, it could be accomplished as follows:

+
userv2 id:int unread_messages:int first_name:string last_name:string in_groups:vector int = User;
+

Aside from other things, this approach helps define correct mappings between fields that belong to different constructors of the same type, convert between them as well as convert type values into an associative array with string keys (field names, if defined, are natural choices for such keys).

+

TL Language

+

See TL Language

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/service_messages.html b/data/core.telegram.org/mtproto/service_messages.html new file mode 100644 index 0000000000..4fee68b0ba --- /dev/null +++ b/data/core.telegram.org/mtproto/service_messages.html @@ -0,0 +1,195 @@ + + + + + Service Messages + + + + + + + + + + + + + +
+ +
+
+
+ +

Service Messages

+ +

Response to an RPC query

+

A response to an RPC query is normally wrapped as follows:

+
rpc_result#f35c6d01 req_msg_id:long result:Object = RpcResult;
+

Here req_msg_id is the identifier of the message sent by the other party and containing an RPC query. This way, the recipient knows that the result is a response to the specific RPC query in question. +At the same time, this response serves as acknowledgment of the other party’s receipt of the req_msg_id message.

+

Note that the response to an RPC query must also be acknowledged. Most frequently, this coincides with the transmission of the next message (which may have a container attached to it carrying a service message with the acknowledgment).

+

RPC Error

+

The result field returned in response to any RPC query may also contain an error message in the following format:

+
rpc_error#2144ca19 error_code:int error_message:string = RpcError;
+

Cancellation of an RPC Query

+

In certain situations, the client does not want to receive a response to an already transmitted RPC query, for example because the response turns out to be long and the client has decided to do without it because of insufficient link capacity. Simply interrupting the TCP connection will not have any effect because the server would re-send the missing response at the first opportunity. Therefore, the client needs a way to cancel receipt of the RPC response message, actually acknowledging its receipt prior to it being in fact received, which will settle the server down and prevent it from re-sending the response. However, the client does not know the RPC response’s msg_id prior to receiving the response; the only thing it knows is the req_msg_id. i. e. the msg_id of the relevant RPC query. Therefore, a special query is used:

+
rpc_drop_answer#58e4a740 req_msg_id:long = RpcDropAnswer;
+

The response to this query returns as one of the following messages wrapped in rpc_result and requiring an acknowledgment:

+
rpc_answer_unknown#5e2ad36e = RpcDropAnswer;
+rpc_answer_dropped_running#cd78e586 = RpcDropAnswer;
+rpc_answer_dropped#a43ad8b7 msg_id:long seq_no:int bytes:int = RpcDropAnswer;
+

The first version of the response is used if the server remembers nothing of the incoming req_msg_id (if it has already been responded to, for example). The second version is used if the response was canceled while the RPC query was being processed (where the RPC query itself was still fully processed); in this case, the same rpc_answer_dropped_running is also returned in response to the original query, and both of these responses require an acknowledgment from the client. The final version means that the RPC response was removed from the server’s outgoing queue, and its msg_id, seq_no, and length in bytes are transmitted to the client.

+

Note that rpc_answer_dropped_running and rpc_answer_dropped serve as acknowledgments of the server’s receipt of the original query (the same one, the response to which we wish to forget). In addition, same as for any RPC queries, any response to rpc_drop_answer is an acknowledgment for rpc_drop_answer itself.

+

As an alternative to using rpc_drop_answer, a new session may be created after the connection is reset and the old session is removed through destroy_session.

+

Messages associated with querying, changing, and receiving the status of other messages

+

See Mobile Protocol: Service Messages about Messages

+

Request for several future salts

+

The client may at any time request from the server several (between 1 and 64) future server salts together with their validity periods. Having stored them in persistent memory, the client may use them to send messages in the future even if it changes sessions (a server salt is attached to the authorization key rather than being session-specific).

+
get_future_salts#b921bd04 num:int = FutureSalts;
+future_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt;
+future_salts#ae500895 req_msg_id:long now:int salts:vector<future_salt> = FutureSalts;
+

The client must check to see that the response’s req_msg_id in fact coincides with msg_id of the query for get_future_salts. The server returns a maximum of num future server salts (may return fewer). The response serves as the acknowledgment of the query and does not require an acknowledgment itself.

+

Ping Messages (PING/PONG)

+
ping#7abe77ec ping_id:long = Pong;
+

A response is usually returned to the same connection:

+
pong#347773c5 msg_id:long ping_id:long = Pong;
+

These messages do not require acknowledgments. A pong is transmitted only in response to a ping while a ping can be initiated by either side.

+

Deferred Connection Closure + PING

+
ping_delay_disconnect#f3427b8c ping_id:long disconnect_delay:int = Pong;
+

Works like ping. In addition, after this is received, the server starts a timer which will close the current connection disconnect_delay seconds later unless it receives a new message of the same type which automatically resets all previous timers. If the client sends these pings once every 60 seconds, for example, it may set disconnect_delay equal to 75 seconds.

+

Request to Destroy Session

+

Used by the client to notify the server that it may forget the data from a different session belonging to the same user (i. e. with the same auth_key_id). The result of this being applied to the current session is undefined.

+
destroy_session#e7512126 session_id:long = DestroySessionRes;
+destroy_session_ok#e22045fc session_id:long = DestroySessionRes;
+destroy_session_none#62d350c9 session_id:long = DestroySessionRes;
+

New Session Creation Notification

+

The server notifies the client that a new session (from the server’s standpoint) had to be created to handle a client message. If, after this, the server receives a message with an even smaller msg_id within the same session, a similar notification will be generated for this msg_id as well. No such notifications are generated for high msg_id values.

+
new_session_created#9ec20908 first_msg_id:long unique_id:long server_salt:long = NewSession
+

The unique_id parameter is generated by the server every time a session is (re-)created.

+

This notification must be acknowledged by the client. It is necessary, for instance, for the client to understand that there is, in fact, a “gap” in the stream of long poll notifications received from the server (the user may have failed to receive notifications during some period of time).

+

Notice that the server may unilaterally destroy (close) any existing client sessions with all pending messages and notifications, without sending any notifications. This happens, for example, if the session is inactive for a long time, and the server runs out of memory. If the client at some point decides to send new messages to the server using the old session, already forgotten by the server, such a "new session created" notification will be generated. The client is expected to handle such situations gracefully.

+

Containers

+

Containers are messages containing several other messages. Used for the ability to transmit several RPC queries and/or service messages at the same time, using HTTP or even TCP or UDP protocol. A container may only be accepted or rejected by the other party as a whole.

+

Simple Container

+

A simple container carries several messages as follows:

+
msg_container#73f1f8dc messages:vector message = MessageContainer;
+

Here message refers to any message together with its length and msg_id:

+
message msg_id:long seqno:int bytes:int body:Object = Message;
+

bytes is the number of bytes in the body serialization. +All messages in a container must have msg_id lower than that of the container itself. A container does not require an acknowledgment and may not carry other simple containers. When messages are re-sent, they may be combined into a container in a different manner or sent individually.

+

MTProto container payloads have a limit of 2^15 bytes or 1020 messages, whichever limit is reached first.
+Clients should group acknowledgments, state requests and message resend requests into three separate msgs_ack, msgs_state_req, msg_resend_req service messages with at most 8192 IDs each; these three messages (+http_wait) will not be included in the 1020 message limit.

+

Empty containers are also allowed. They are used by the server, for example, to respond to an HTTP request when the timeout specified in http_wait expires, and there are no messages to transmit.

+

Example implementation.

+

Message Copies

+

In some situations, an old message with a msg_id that is no longer valid needs to be re-sent. Then, it is wrapped in a copy container:

+
msg_copy#e06046b2 orig_message:Message = MessageCopy;
+

Once received, the message is processed as if the wrapper were not there. However, if it is known for certain that the message orig_message.msg_id was received, then the new message is not processed (while at the same time, it and orig_message.msg_id are acknowledged). The value of orig_message.msg_id must be lower than the container’s msg_id.

+

This is not used at this time, because an old message can be wrapped in a simple container with the same result.

+

Packed Object

+

Used to replace any other object (or rather, a serialization thereof) with its archived (gzipped) representation:

+
gzip_packed#3072cfa1 packed_data:string = Object;
+

At the present time, it is supported in the body of an RPC response (i.e., as result in rpc_result) and generated by the server for a limited number of high-level queries. In addition, in the future it may be used to transmit non-service messages (i. e. RPC queries) from client to server.

+

HTTP Wait/Long Poll

+

The following special service query not requiring an acknowledgement (which must be transmitted only through an HTTP connection) is used to enable the server to send messages in the future to the client using HTTP protocol:

+
http_wait#9299359f max_delay:int wait_after:int max_wait:int = HttpWait;
+

When such a message (or a container carrying such a message) is received, the server either waits max_delay milliseconds, whereupon it forwards all the messages that it is holding on to the client if there is at least one message queued in session (if needed, by placing them into a container to which acknowledgments may also be added); or else waits no more than max_wait milliseconds until such a message is available. If a message never appears, an empty container is transmitted.

+

The max_delay parameter denotes the maximum number of milliseconds that has elapsed between the first message for this session and the transmission of an HTTP response. The wait_after parameter works as follows: after the receipt of the latest message for a particular session, the server waits another wait_after milliseconds in case there are more messages. If there are no additional messages, the result is transmitted (a container with all the messages). If more messages appear, the wait_after timer is reset.

+

At the same time, the max_delay parameter has higher priority than wait_after, and max_wait has higher priority than max_delay.

+

This message does not require a response or an acknowledgement. If the container transmitted over HTTP carries several such messages, the behavior is undefined (in fact, the latest parameter will be used).

+

If no http_wait is present in container, default values max_delay=0 (milliseconds), wait_after=0 (milliseconds), and max_wait=25000 (milliseconds) are used.

+

If the client’s ping of the server takes a long time, it may make sense to set max_delay to a value that is comparable in magnitude to ping time.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/service_messages_about_messages.html b/data/core.telegram.org/mtproto/service_messages_about_messages.html new file mode 100644 index 0000000000..6a531811d5 --- /dev/null +++ b/data/core.telegram.org/mtproto/service_messages_about_messages.html @@ -0,0 +1,185 @@ + + + + + Service Messages about Messages + + + + + + + + + + + + + +
+ +
+
+
+ +

Service Messages about Messages

+ +

Acknowledgment of Receipt

+

Receipt of virtually all messages (with the exception of some purely service ones as well as the plain-text messages used in the protocol for creating an authorization key) must be acknowledged. +This requires the use of the following service message (not requiring an acknowledgment):

+
msgs_ack#62d6b459 msg_ids:Vector<long> = MsgsAck;
+

A server usually acknowledges the receipt of a message from a client (normally, an RPC query) using an RPC response. If a response is a long time coming, a server may first send a receipt acknowledgment, and somewhat later, the RPC response itself.

+

A client normally acknowledges the receipt of a message from a server (usually, an RPC response) by adding an acknowledgment to the next RPC query if it is not transmitted too late (if it is generated, say, 60-120 seconds following the receipt of a message from the server). However, if for a long period of time there is no reason to send messages to the server or if there is a large number of unacknowledged messages from the server (say, over 16), the client transmits a stand-alone acknowledgment.

+

Max 8192 IDs are allowed per constructor.

+

Notice of Ignored Error Message

+

In certain cases, a server may notify a client that its incoming message was ignored for whatever reason. Note that such a notification cannot be generated unless a message is correctly decoded by the server.

+
bad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int error_code:int = BadMsgNotification;
+bad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification;
+

Here, error_code can also take on the following values:

+
    +
  • 16: msg_id too low (most likely, client time is wrong; it would be worthwhile to synchronize it using msg_id notifications and re-send the original message with the “correct” msg_id or wrap it in a container with a new msg_id if the original message had waited too long on the client to be transmitted)
  • +
  • 17: msg_id too high (similar to the previous case, the client time has to be synchronized, and the message re-sent with the correct msg_id)
  • +
  • 18: incorrect two lower order msg_id bits (the server expects client message msg_id to be divisible by 4)
  • +
  • 19: container msg_id is the same as msg_id of a previously received message (this must never happen)
  • +
  • 20: message too old, and it cannot be verified whether the server has received a message with this msg_id or not
  • +
  • 32: msg_seqno too low (the server has already received a message with a lower msg_id but with either a higher or an equal and odd seqno)
  • +
  • 33: msg_seqno too high (similarly, there is a message with a higher msg_id but with either a lower or an equal and odd seqno)
  • +
  • 34: an even msg_seqno expected (irrelevant message), but odd received
  • +
  • 35: odd msg_seqno expected (relevant message), but even received
  • +
  • 48: incorrect server salt (in this case, the bad_server_salt response is received with the correct salt, and the message is to be re-sent with it)
  • +
  • 64: invalid container.
  • +
+

The intention is that error_code values are grouped (error_code >> 4): for example, the codes 0x40 - 0x4f correspond to errors in container decomposition.

+

Notifications of an ignored message do not require acknowledgment (i.e., are irrelevant).

+

Important: if server_salt has changed on the server or if client time is incorrect, any query will result in a notification in the above format. The client must check that it has, in fact, recently sent a message with the specified msg_id, and if that is the case, update its time correction value (the difference between the client’s and the server’s clocks) and the server salt based on msg_id and the server_salt notification, so as to use these to (re)send future messages. In the meantime, the original message (the one that caused the error message to be returned) must also be re-sent with a better msg_id and/or server_salt.

+

In addition, the client can update the server_salt value used to send messages to the server, based on the values of RPC responses or containers carrying an RPC response, provided that this RPC response is actually a match for the query sent recently. (If there is doubt, it is best not to update since there is risk of a replay attack).

+

Request for Message Status Information

+

If either party has not received information on the status of its outgoing messages for a while, it may explicitly request it from the other party:

+
msgs_state_req#da69fb52 msg_ids:Vector long = MsgsStateReq;
+

Max 8192 IDs are allowed per constructor.

+

The response to the query contains the following information:

+

Informational Message regarding Status of Messages

+
msgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo;
+

Here, info is a string that contains exactly one byte of message status for each message from the incoming msg_ids list:

+
    +
  • 1 = nothing is known about the message (msg_id too low, the other party may have forgotten it)
  • +
  • 2 = message not received (msg_id falls within the range of stored identifiers; however, the other party has certainly not received a message like that)
  • +
  • 3 = message not received (msg_id too high; however, the other party has certainly not received it yet)
  • +
  • 4 = message received (note that this response is also at the same time a receipt acknowledgment)
  • +
  • +8 = message already acknowledged
  • +
  • +16 = message not requiring acknowledgment
  • +
  • +32 = RPC query contained in message being processed or processing already complete
  • +
  • +64 = content-related response to message already generated
  • +
  • +128 = other party knows for a fact that message is already received
  • +
+

This response does not require an acknowledgment. It is an acknowledgment of the relevant msgs_state_req, in and of itself.

+

Note that if it turns out suddenly that the other party does not have a message that looks like it has been sent to it, the message can simply be re-sent. Even if the other party should receive two copies of the message at the same time, the duplicate will be ignored. (If too much time has passed, and the original msg_id is not longer valid, the message is to be wrapped in msg_copy).

+

Voluntary Communication of Status of Messages

+

Either party may voluntarily inform the other party of the status of the messages transmitted by the other party.

+
msgs_all_info#8cc0d131 msg_ids:Vector long info:string = MsgsAllInfo
+

All message codes known to this party are enumerated, with the exception of those for which the +128 and the +16 flags are set. However, if the +32 flag is set but not +64, then the message status will still be communicated.

+

This message does not require an acknowledgment.

+

Extended Voluntary Communication of Status of One Message

+

Normally used by the server to respond to the receipt of a duplicate msg_id, especially if a response to the message has already been generated and the response is large. If the response is small, the server may re-send the answer itself instead. This message can also be used as a notification instead of resending a large message.

+
msg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo;
+msg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo;
+

The second version is used to notify of messages that were created on the server not in response to an RPC query (such as notifications of new messages) and were transmitted to the client some time ago, but not acknowledged.

+

Currently, status is always zero. This may change in future.

+

This message does not require an acknowledgment.

+

Explicit Request to Re-Send Messages

+
msg_resend_req#7d861a08 msg_ids:Vector long = MsgResendReq;
+

The remote party immediately responds by re-sending the requested messages, normally using the same connection that was used to transmit the query. If at least one message with requested msg_id does not exist or has already been forgotten, or has been sent by the requesting party (known from parity), MsgsStateInfo is returned for all messages requested as if the MsgResendReq query had been a MsgsStateReq query as well.
+Max 8192 IDs are allowed per constructor.

+

Explicit Request to Re-Send Answers

+
msg_resend_ans_req#8610baeb msg_ids:Vector long = MsgResendReq;
+

The remote party immediately responds by re-sending answers to the requested messages, normally using the same connection that was used to transmit the query. MsgsStateInfo is returned for all messages requested as if the MsgResendReq query had been a MsgsStateReq query as well.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto_v1.html b/data/core.telegram.org/mtproto_v1.html new file mode 100644 index 0000000000..d395ad3347 --- /dev/null +++ b/data/core.telegram.org/mtproto_v1.html @@ -0,0 +1,229 @@ + + + + + MTProto Mobile Protocol v.1.0 (DEPRECATED) + + + + + + + + + + + + + +
+ +
+
+
+
+

MTProto Mobile Protocol v.1.0 (DEPRECATED)

+ +
+

This document describes MTProto v1.0, its status is DEPRECATED.
For information on encryption used in up-to-date Telegram clients, kindly see this document.

+
+

Related articles

+

+
+

This page deals with the basic layer of MTProto encryption used for Cloud chats (server-client encryption). See also:

+ +

General Description

+

The protocol is designed for access to a server API from applications running on mobile devices. It must be emphasized that a web browser is not such an application.

+

The protocol is subdivided into three virtually independent components:

+
    +
  • High-level component (API query language): defines the method whereby API queries and responses are converted to binary messages.
  • +
  • Cryptographic (authorization) layer: defines the method by which messages are encrypted prior to being transmitted through the transport protocol.
  • +
  • Transport component: defines the method for the client and the server to transmit messages over some other existing network protocol (such as, http, https, tcp, udp).
  • +
+ + +
+

Got questions about this setup? — Check out the Advanced FAQ!

+
+
Note 1
+

Each plaintext message to be encrypted in MTProto always contains the following data to be checked upon decryption in order to make the system robust against known problems with the components:

+
    +
  • server salt (64-Bit)
  • +
  • session id
  • +
  • message sequence number
  • +
  • message length
  • +
  • time
  • +
+
Note 2
+

See additional comments on our use of IGE, SHA-1 and message authentication.

+
Note 3
+

Telegram's End-to-end encrypted Secret Chats are using an additional layer of encryption on top of the described above. See Secret Chats, End-to-End encryption for details.

+

Brief Component Summary

+

High-Level Component (RPC Query Language/API)

+

From the standpoint of the high-level component, the client and the server exchange messages inside a session. The session is attached to the client device (the application, to be more exact) rather than a specific http/https/tcp connection. In addition, each session is attached to a user key ID by which authorization is actually accomplished.

+

Several connections to a server may be open; messages may be sent in either direction through any of the connections (a response to a query is not necessarily returned through the same connection that carried the original query, although most often, that is the case; however, in no case can a message be returned through a connection belonging to a different session). When the UDP protocol is used, a response might be returned by a different IP address than the one to which the query had been sent.

+

There are several types of messages:

+
    +
  • RPC calls (client to server): calls to API methods
  • +
  • RPC responses (server to client): results of RPC calls
  • +
  • Message received acknowledgment (or rather, notification of status of a set of messages)
  • +
  • Message status query
  • +
  • Multipart message or container (a container that holds several messages; needed to send several RPC calls at once over an HTTP connection, for example; also, a container may support gzip).
  • +
+

From the standpoint of lower level protocols, a message is a binary data stream aligned along a 4 or 16-byte boundary. The first several fields in the message are fixed and are used by the cryptographic/authorization system.

+

Each message, either individual or inside a container, consists of a message identifier (64 bits, see below), a message sequence number within a session (32 bits), the length (of the message body in bytes; 32 bits), and a body (any size which is a multiple of 4 bytes). In addition, when a container or a single message is sent, an internal header is added at the top (see below), then the entire message is encrypted, and an external header is placed at the top of the message (a 64-bit key identifier and a 128-bit message key).

+

A message body normally consists of a 32-bit message type followed by type-dependent parameters. In particular, each RPC function has a corresponding message type. For more detail, see Binary Data Serialization, Mobile Protocol: Service Messages.

+

All numbers are written as little endian. However, very large numbers (2048-bit) used in RSA and DH are written in the big endian format because that is what the OpenSSL library does.

+

Authorization and Encryption

+

Prior to a message (or a multipart message) being transmitted over a network using a transport protocol, it is encrypted in a certain way, and an external header is added at the top of the message which is: a 64-bit key identifier (that uniquely identifies an authorization key for the server as well as the user) and a 128-bit message key. A user key together with the message key defines an actual 256-bit key which is what encrypts the message using AES-256 encryption. Note that the initial part of the message to be encrypted contains variable data (session, message ID, sequence number, server salt) that obviously influences the message key (and thus the AES key and iv). The message key is defined as the 128 lower-order bits of the SHA1 of the message body (including session, message ID, etc.). Multipart messages are encrypted as a single message.

+

For a technical specification, see Mobile Protocol: Detailed Description
The first thing a client application must do is create an authorization key which is normally generated when it is first run and almost never changes.

+

The protocol’s principal drawback is that an intruder passively intercepting messages and then somehow appropriating the authorization key (for example, by stealing a device) will be able to decrypt all the intercepted messages post factum. This probably is not too much of a problem (by stealing a device, one could also gain access to all the information cached on the device without decrypting anything); however, the following steps could be taken to overcome this weakness:

+
    +
  • Session keys generated using the Diffie-Hellman protocol and used in conjunction with the authorization and the message keys to select AES parameters. To create these, the first thing a client must do after creating a new session is send a special RPC query to the server (“generate session key”) to which the server will respond, whereupon all subsequent messages within the session are encrypted using the session key as well.
  • +
  • Protecting the key stored on the client device with a (text) password; this password is never stored in memory and is entered by a user when starting the application or more frequently (depending on application settings).
  • +
  • Data stored (cached) on the user device can also be protected by encryption using an authorization key which, in turn, is to be password-protected. Then, a password will be required to gain access even to those data.
  • +
+

Time Synchronization

+

If client time diverges widely from server time, a server may start ignoring client messages, or vice versa, because of an invalid message identifier (which is closely related to creation time). Under these circumstances, the server will send the client a special message containing the correct time and a certain 128-bit salt (either explicitly provided by the client in a special RPC synchronization request or equal to the key of the latest message received from the client during the current session). This message could be the first one in a container that includes other messages (if the time discrepancy is significant but does not as yet result in the client’s messages being ignored).

+

Having received such a message or a container holding it, the client first performs a time synchronization (in effect, simply storing the difference between the server’s time and its own to be able to compute the “correct” time in the future) and then verifies that the message identifiers for correctness.

+

Where a correction has been neglected, the client will have to generate a new session to assure the monotonicity of message identifiers.

+

Transport

+

Enables the delivery of encrypted containers together with the external header (hereinafter, Payload) from client to server and back. There are three types of transport:

+
    +
  • HTTP
  • +
  • TCP
  • +
  • UDP
  • +
+

We shall examine the first two types.

+

HTTP Transport

+

Implemented over HTTP/1.1 (with keepalive) running over the traditional TCP Port 80. HTTPS is not used; the above encryption method is used instead.

+

An HTTP connection is attached to a session (or rather, to session + key identifier) specified in the most recent user query received; normally, the session is the same in all queries, but crafty HTTP proxies may corrupt that. A server may not return a message into an HTTP connection unless it belongs to the same session, and unless it is the server’s turn (an HTTP request had been received from the client to which a response has not been sent yet).

+

The overall arrangement is as follows. The client opens one or more keepalive HTTP connections to the server. If one or more messages need to be sent, they are made into a payload which is followed by a POST request to the URL/api to which the payload is transmitted as data. In addition, Content-Length, Keepalive, and Host are valid HTTP headers.

+

Having received the query, the server may either wait a little while (if the query requires a response following a short timeout) or immediately return a dummy response (only acknowledging the receipt of the container). In any case, the response may contain any number of messages. The server may at the same time send out any other messages it might be holding for the session.

+

In addition, there exists a special long poll RPC query (valid for HTTP connections only) which transmits maximum timeout T. If the server has messages for the session, they are returned immediately; otherwise, a wait state is entered until such time as the server has a message for the client or T seconds have elapsed. If no events occur in the span of T seconds, a dummy response is returned (special message).

+

If a server needs to send a message to a client, it checks for an HTTP connection that belongs to the required session and is in the “answering an HTTP request” state (including long poll) whereupon the message is added to the response container for the connection and sent to the user. In a typical case, there is some additional wait time (50 milliseconds) against the eventuality that the server will soon have more messages for the session.

+

If no suitable HTTP connection is available, the messages are placed in the current session’s send queue. However, they find their way there anyway until receipt is explicitly or indirectly confirmed by the client. For the HTTP protocol, sending the next query into the same HTTP connection is regarded as an implicit acknowledgment (not any more, the HTTP protocol also requires that explicit acknowledgments be sent); in other cases, the client must return an explicit acknowledgment within a reasonable time (it can be added to a container for the following request).

+

Important: if the acknowledgment fails to arrive on time, the message can be resent (possibly, in a different container). The parties must autonomously be ready for this and must store the identifiers of the most recent messages received (and ignore such duplicates rather than repeat actions). In order not to have the identifiers stored forever, there exist special garbage collection messages that take advantage of message identifier monotonicity.

+

If the send queue overflows or if messages stay in the queue for over 10 minutes, the server forgets them (or sends them to swap, no genius required). This may happen even faster, if the server is running out of buffer space (for example, because of serious network issues resulting in a large number of connections becoming severed).

+

TCP Transport

+

This is very similar to the HTTP transport. May also be implemented over Port 80 (to penetrate all firewalls) and even use the same server IP addresses. In this situation, the server understands whether HTTP or TCP protocol must be used for the connection, based on the first four incoming bytes (for HTTP, it is POST).

+

When a TCP connection is created, it is assigned to the session (and the authorization key) transmitted in the first user message, and subsequently used exclusively for this session (multiplexing arrangements are not allowed).

+

If a payload (packet) needs to be transmitted from server to client or from client to server, it is encapsulated as follows: 4 length bytes are added at the front (to include the length, the sequence number, and CRC32; always divisible by 4) and 4 bytes with the packet sequence number within this TCP connection (the first packet sent is numbered 0, the next one 1, etc.), and 4 CRC32 bytes at the end (length, sequence number, and payload together).

+

There is an abridged version of the same protocol: if the client sends 0xef as the first byte (important: only prior to the very first data packet), then packet length is encoded by a single byte (0x01..0x7e = data length divided by 4; or 0x7f followed by 3 length bytes (little endian) divided by 4) followed by the data themselves (sequence number and CRC32 not added). In this case, server responses look the same (the server does not send 0xefas the first byte).

+

In case 4-byte data alignment is needed, an intermediate version of the original protocol may be used: if the client sends 0xeeeeeeee as the first int (four bytes), then packet length is encoded always by four bytes as in the original version, but the sequence number and CRC32 are omitted, thus decreasing total packet size by 8 bytes.

+

The full, the intermediate and the abridged versions of the protocol have support for quick acknowledgment. In this case, the client sets the highest-order length bit in the query packet, and the server responds with a special 4 bytes as a separate packet. They are the 32 higher-order SHA1 bits of the encrypted portion of the packet with the most significant bit set to make clear that this is not the length of a regular server response packet; if the abridged version is used, bswap is applied to these four bytes.

+

There are no implicit acknowledgments for the TCP transport: all messages must be acknowledged explicitly. Most frequently, acknowledgments are placed in a container with the next query or response if it is transmitted in short order. For example, this is almost always the case for client messages containing RPC queries: the acknowledgment normally arrives with the RPC response.

+

In the event of an error, the server may send a packet whose payload consists of 4 bytes as the error code. For example, Error Code 403 corresponds to situations where the corresponding HTTP error would have been returned by the HTTP protocol.

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/passport.html b/data/core.telegram.org/passport.html new file mode 100644 index 0000000000..80b9247f07 --- /dev/null +++ b/data/core.telegram.org/passport.html @@ -0,0 +1,690 @@ + + + + + Telegram Passport Manual + + + + + + + + + + + + + +
+ +
+
+
+
+

Telegram Passport Manual

+ +
+ +

Telegram Passport is a unified authorization method for services that require personal identification. Users can upload their documents once, then instantly share their data with services that require real-world ID (finance, ICOs, etc.). Telegram doesn't have access to the users' personal information thanks to end-to-end encryption.

+

Overview

+

From the perspective of a service that requires real-world ID, the process looks like this:

+
    +
  • A user presses "Log in with Telegram" on your website or in your app.
  • +
  • You request the data you need.
  • +
  • The user accepts your privacy policy and agrees to share their data.
  • +
  • The user's Telegram app downloads and decrypts the data you requested from the end-to-end encrypted storage on Telegram.
  • +
  • If some of the data you requested is missing, the user can add it to their Telegram Passport at this point.
  • +
  • The user's app encrypts the data with your public key and sends it to you.
  • +
  • You decrypt the data, check it for errors and re-request any missing or invalid information.
  • +
  • You sign the user up for your service. Tada!
  • +
+

Check out this example to see Telegram Passport in action.

+
+

To learn more about Telegram Passport from the perspective of a user, please see this blog post and the technical MTProto documentation. +See this page if you're interested in encryption algorithms used on Telegram's side.

+
+

Recent changes

+

August 25, 2018

+

Telegram Passport 1.1 (blog post)

+
    +
  • Added support for requesting several documents of one type. See the new objects PassportScope, PassportScopeElement, PassportScopeElementOneOfSeveral and PassportScopeElementOne.
  • +
  • Added support for middle names.
  • +
  • Added support for requesting certified English translations for documents (see Fields; new field translation also added to the SecureValue object). Note: Please only request translations after you have received a valid document that requires one.
  • +
  • Added support for requesting names in the language of the user's country of residence (if other than English). New fields first_name_native, last_name_native and middle_name_native added to the PersonalDetails object.
  • +
  • Replaced the payload parameter with the new parameter nonce, which serves the same function, to make the purpose more obvious (see Request Parameters and the Credentials object).
  • +
  • Updated the example page to support the new functionality.
  • +
+

Setting Up Telegram Passport

+

To integrate Telegram Passport into your login or verification flow, you need a working Telegram bot (see this page for information on how to get one).

+

To request data from Telegram Passport users, your bot will need to generate a pair of encryption keys.

+

Generating a private key

+

First, use a console to generate a private key:

+
openssl genrsa 2048 > private.key
+

WARNING: Keep your private key SECRET!

+

Generating your public key

+

Then use the console to print the corresponding public key:

+
openssl rsa -in private.key -pubout
+

Use the /setpublickey command with @BotFather to connect this public key with your bot.

+

Privacy Policy

+

Add a link to your Privacy Policy by using the /setprivacypolicy command. Users will see this link when offered to authorize you to access their data.

+

Requesting Information

+

SDK

+

To request information stored in a Telegram Passport, use one of these SDKs:

+ +

Request Parameters

+

Use the following parameters to request information with the SDK:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParametersTypeRequired
bot_idIntegerYes
scopePassportScopeYes
public_keyStringYes
nonceStringYes
+

PassportScope

+

This object represents the data to be requested.

+ + + + + + + + + + + + + + + + + + +
FieldTypeDescription
dataArray of PassportScopeElementList of requested elements, each type may be used only once in the entire array of PassportScopeElement objects
vIntegerScope version, must be 1
+

PassportScopeElement

+

This object represents a requested element, should be one of:

+ +

PassportScopeElementOneOfSeveral

+

This object represents several elements one of which must be provided.

+ + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
one_ofArray of PassportScopeElementOneList of elements one of which must be provided; must contain either several of “passport”, “driver_license”, “identity_card”, “internal_passport” or several of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
selfieBooleanOptional. Use this parameter if you want to request a selfie with the document from this list that the user chooses to upload.
translationBooleanOptional. Use this parameter if you want to request a translation of the document from this list that the user chooses to upload. Note: We suggest to only request translations after you have received a valid document that requires one.
+

PassportScopeElementOne

+

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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringElement type. One of "personal_details", "passport", "driver_license", "identity_card", "internal_passport", "address", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration", "phone_number", "email"
selfieBooleanOptional. Use this parameter if you want to request a selfie with the document as well. Available for "passport", "driver_license", "identity_card" and "internal_passport"
translationBooleanOptional. Use this parameter if you want to request a translation of the document as well. Available for "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration" and "temporary_registration". Note: We suggest to only request translations after you have received a valid document that requires one.
native_namesBooleanOptional. 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 "personal_details"
+

You can also use the special type "id_document" as an alias for one of "passport", "driver_license", "identity_card" and the special type "address_document" as an alias for one of "utility_bill", "bank_statement", "rental_agreement". +So {"type":"id_document",selfie:true} is equal to {"one_of":["passport","driver_license","identity_card"],selfie:true}.

+

Fields

+

Your bot can request personal details, one or several types of identity document, residential address, one or several types of proof of address document, a phone number, or an email address. You can also request optional selfies with the document and certified English translations of the document. +This is just a list of data types that can be requested, and the encrypted objects that will contain such data.

+
+

Note: We suggest to only request English translations after you have received a valid document that requires one.

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameKeyTypeDescription
personal_detailsdataPersonalDetailsPersonal Details
passportdataIdDocumentDataPassport
front_sidePassportFile
selfieOptional. PassportFile
translationOptional. Array of PassportFile
internal_passportdataIdDocumentDataInternal Passport
front_sidePassportFile
selfieOptional. PassportFile
translationOptional. Array of PassportFile
driver_licensedataIdDocumentDataDriver License
front_sidePassportFile
reverse_sidePassportFile
selfieOptional. PassportFile
translationOptional. Array of PassportFile
identity_carddataIdDocumentDataIdentity Card
front_sidePassportFile
reverse_sidePassportFile
selfieOptional. PassportFile
translationOptional. Array of PassportFile
addressdataResidentialAddressAddress
utility_billfilesArray of PassportFileUtility Bill
translationOptional. Array of PassportFile
bank_statementfilesArray of PassportFileBank Statement
translationOptional. Array of PassportFile
rental_agreementfilesArray of PassportFileRental Agreement
translationOptional. Array of PassportFile
passport_registrationfilesArray of PassportFileRegistration Page in the Internal Passport
translationOptional. Array of PassportFile
temporary_registrationfilesArray of PassportFileTemporary Registration
translationOptional. Array of PassportFile
phone_numberStringPhone number
emailStringEmail
+

PersonalDetails

+

This object represents personal details.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
first_nameStringFirst Name
last_nameStringLast Name
middle_nameStringOptional. Middle Name
birth_dateStringDate of birth in DD.MM.YYYY format
genderStringGender, male or female
country_codeStringCitizenship (ISO 3166-1 alpha-2 country code)
residence_country_codeStringCountry of residence (ISO 3166-1 alpha-2 country code)
first_name_nativeStringFirst Name in the language of the user's country of residence
last_name_nativeStringLast Name in the language of the user's country of residence
middle_name_nativeStringOptional. Middle Name in the language of the user's country of residence
+

ResidentialAddress

+

This object represents a residential address.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
street_line1StringFirst line for the address
street_line2StringOptional. Second line for the address
cityStringCity
stateStringOptional. State
country_codeStringISO 3166-1 alpha-2 country code
post_codeStringAddress post code
+

IdDocumentData

+

This object represents the data of an identity document.

+ + + + + + + + + + + + + + + + + + +
FieldTypeDescription
document_noStringDocument number
expiry_dateStringOptional. Date of expiry, in DD.MM.YYYY format
+

PassportFile

+

This object represents a PassportFile related to a document. The file is up to 10MB in size and in the .jpg format.

+

Receiving information

+

When the user confirms your request by pressing the 'Authorize' button, the Bot API sends an Update with the field passport_data to the bot that contains encrypted Telegram Passport data.

+
+

Note that all base64-encoded fields should be decoded before use.

+
+

Decrypting data

+

To decrypt the received data, first, decrypt the credentials contained in EncryptedCredentials.

+
    +
  1. +

    Decrypt the credentials secret ( secret field in EncryptedCredentials) using your private key (set OAEP padding option, e.g. OPENSSL_PKCS1_OAEP_PADDING in PHP)

    +
  2. +
  3. +

    Use this secret and the credentials hash ( hash field in EncryptedCredentials) to calculate credentials_key and credentials_iv as described below:

    +
     credentials_secret_hash = SHA512( credentials_secret + credentials_hash )
    + credentials_key = slice( credentials_secret_hash, 0, 32 )
    + credentials_iv = slice( credentials_secret_hash, 32, 16 )
    +
  4. +
  5. +

    Decrypt the credentials data ( data field in EncryptedCredentials) by AES256-CBC using these credentials_key and credentials_iv. IMPORTANT: At this step, make sure that the credentials hash is equal to SHA256( credentials_data )

    +
  6. +
  7. +

    Credentials data is padded with 32 to 255 random padding bytes to make its length divisible by 16 bytes. The first byte contains the length of this padding (including this byte). Remove the padding to get the data.

    +
  8. +
+
+

Note that all hashes represent as raw binary data, not hexits

+
+

Credentials

+

Credentials is a JSON-serialized object.

+ + + + + + + + + + + + + + + + + + +
FieldTypeDescription
secure_dataSecureDataCredentials for encrypted data
nonceStringBot-specified nonce
+

IMPORTANT: Make sure that the nonce is the same as was passed in the request.

+

SecureData

+

This object represents the credentials required to decrypt encrypted data. All fields are optional and depend on fields that were requested.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
personal_detailsSecureValueOptional. Credentials for encrypted personal details
passportSecureValueOptional. Credentials for encrypted passport
internal_passportSecureValueOptional. Credentials for encrypted internal passport
driver_licenseSecureValueOptional. Credentials for encrypted driver license
identity_cardSecureValueOptional. Credentials for encrypted ID card
addressSecureValueOptional. Credentials for encrypted residential address
utility_billSecureValueOptional. Credentials for encrypted utility bill
bank_statementSecureValueOptional. Credentials for encrypted bank statement
rental_agreementSecureValueOptional. Credentials for encrypted rental agreement
passport_registrationSecureValueOptional. Credentials for encrypted registration from internal passport
temporary_registrationSecureValueOptional. Credentials for encrypted temporary registration
+

SecureValue

+

This object represents the credentials required to decrypt encrypted values. All fields are optional and depend on the type of fields that were requested.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
dataDataCredentialsOptional. Credentials for encrypted Telegram Passport data. Available for "personal_details", "passport", "driver_license", "identity_card", "internal_passport" and "address" types.
front_sideFileCredentialsOptional. Credentials for an encrypted document's front side. Available for "passport", "driver_license", "identity_card" and "internal_passport".
reverse_sideFileCredentialsOptional. Credentials for an encrypted document's reverse side. Available for "driver_license" and "identity_card".
selfieFileCredentialsOptional. Credentials for an encrypted selfie of the user with a document. Available for "passport", "driver_license", "identity_card" and "internal_passport".
translationArray of FileCredentialsOptional. Credentials for an encrypted translation of the document. Available for "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration" and "temporary_registration".
filesArray of FileCredentialsOptional. Credentials for encrypted files. Available for "utility_bill", "bank_statement", "rental_agreement", "passport_registration" and "temporary_registration" types.
+

DataCredentials

+

These credentials can be used to decrypt encrypted data from the data field in EncryptedPassportElement.

+ + + + + + + + + + + + + + + + + + +
FieldTypeDescription
data_hashStringChecksum of encrypted data
secretStringSecret of encrypted data
+
    +
  1. +

    To decrypt data, use the corresponding secret and data_hash from DataCredentials as described below:

    +
     data_secret_hash = SHA512( data_secret + data_hash )
    + data_key = slice( data_secret_hash, 0, 32 )
    + data_iv = slice( data_secret_hash, 32, 16 )
    +
  2. +
  3. +

    Use AES256-CBC with this data_key and data_iv to decrypt the data (the data field in EncryptedPassportElement). IMPORTANT: At this step, make sure that data_hash from the credentials is equal to SHA256( data ).

    +
  4. +
  5. +

    The data is padded with 32 to 255 random padding bytes to make its length divisible by 16 bytes. The first byte contains the length of the padding (including this byte). Remove padding to get the data.

    +
  6. +
  7. +

    The data is a JSON-serialized object of one of the following types: PersonalDetails, IdDocumentData, ResidentialAddress, depending on type.

    +
  8. +
+

FileCredentials

+

These credentials can be used to decrypt encrypted files from the front_side, reverse_side, selfie, files and translation fields in EncryptedPassportElement.

+ + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_hashStringChecksum of encrypted file
secretStringSecret of encrypted file
+
    +
  1. +

    To decrypt the file, use the corresponding secret and file_hash from FileCredentials as described below:

    +
     file_secret_hash = SHA512( file_secret + file_hash )
    + file_key = slice( file_secret_hash, 0, 32 )
    + file_iv = slice( file_secret_hash, 32, 16 )
    +
  2. +
  3. +

    Download the encrypted file using the getFile method.

    +
  4. +
  5. +

    Use AES256-CBC with this file_key and file_iv to decrypt the content of the file. IMPORTANT: At this step, make sure that file_hash from the credentials is equal to SHA256( file_content ).

    +
  6. +
  7. +

    The content of the file is padded with 32 to 255 random padding bytes to make its length divisible by 16 bytes. The first byte contains the length of the padding (including that byte). Remove padding to get the file content.

    +
  8. +
+

Fixing errors

+

If the data you received contains errors, the bot can use the setPassportDataErrors method to inform the user and request information again. The user will not be able to resend the data, until all errors are fixed.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/passport/encryption.html b/data/core.telegram.org/passport/encryption.html new file mode 100644 index 0000000000..43794b6bd2 --- /dev/null +++ b/data/core.telegram.org/passport/encryption.html @@ -0,0 +1,606 @@ + + + + + Telegram Passport Encryption Details + + + + + + + + + + + + + +
+ +
+
+
+ +

Telegram Passport Encryption Details

+ +
+ +

Telegram Passport data is stored encrypted End-to-End which means that the Telegram server does not have access to the data and only functions as a storage for encrypted data it can't decipher. Encryption and decryption are handled exclusively by the Telegram clients, which are open source.

+

Overview

+

To encrypt each particular element of Telegram Passport, the client generates a random secret. The secret is a 32-byte number with the modulo 255 sum of bytes equal to 239. This secret is in turn encrypted with the passport_secret that is generated when the user creates their Telegram Passport. passport_secret is encrypted with the user's password and is stored encrypted in the Telegram Cloud.

+

Passport Secret

+

The passport secret is one of the secret parameters used to encrypt the data uploaded by the user to the Telegram Cloud.

+

When first setting up Telegram Passport it must be created, encrypted and uploaded as described in Passport Secret Encryption.

+

When using Telegram Passport normally, it must be downloaded and decrypted for use as described in Passport Secret Decryption.

+

The passport secret must also be downloaded, re-encrypted and re-uploaded as described in Passport Secret Encryption if a new, more secure encryption algorithm is defined in a newer version of Telegram or the 2FA password is updated.

+

Passport Secret Encryption

+

First of all, server-side passport parameters are fetched, scheme:

+
account.password#ad2641f8 flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes = account.Password;
+
+securePasswordKdfAlgoUnknown#4a8537 = SecurePasswordKdfAlgo;
+securePasswordKdfAlgoPBKDF2HMACSHA512iter100000#bbf2dda0 salt:bytes = SecurePasswordKdfAlgo;
+securePasswordKdfAlgoSHA512#86471d92 salt:bytes = SecurePasswordKdfAlgo;
+
+
+---functions---
+
+account.getPassword#548a30f5 = account.Password;
+

When Telegram Passport is first used, the client generates a passport_secret (a 32-byte number with the modulo 255 sum of bytes equal to 239), using a part of server-generated random secure_random from account.password as an additional source of entropy for OpenSSL (when re-encrypting the passport_secret with a more secure algorithm or after a 2FA password change, the previous passport_secret is used, instead). +Then passport_secret is then encrypted using the user's password and hashed using the scheme and parameters specified in the new_algo field of account.password.

+

The server should always return a securePasswordKdfAlgoPBKDF2HMACSHA512iter100000 constructor in the new_algo field. +If securePasswordKdfAlgoUnknown is returned, the remotely stored secret is encrypted using a new algorithm, not supported by the current client: the user should update their app.

+

The other constructors may be used only when decrypting old passport parameters generated by a legacy client; in this case, the passport secret should be re-encrypted and updated using new_algo.

+ +

Subsequently, the client receives the encrypted passport_secret from the server and decrypts it after the user enters their password ».

+

In case the password is changed or a more secure algorithm is introduced in an update of the API, the client re-encrypts the passport_secret using the new password. +If the password is disabled, all Telegram Passport data is lost.

+

Passport Secret Decryption

+

Scheme:

+
securePasswordKdfAlgoUnknown#4a8537 = SecurePasswordKdfAlgo;
+securePasswordKdfAlgoPBKDF2HMACSHA512iter100000#bbf2dda0 salt:bytes = SecurePasswordKdfAlgo;
+securePasswordKdfAlgoSHA512#86471d92 salt:bytes = SecurePasswordKdfAlgo;
+
+secureSecretSettings#1527bcac secure_algo:SecurePasswordKdfAlgo secure_secret:bytes secure_secret_id:long = SecureSecretSettings;
+
+account.passwordSettings#9a5c33e5 flags:# email:flags.0?string secure_settings:flags.1?SecureSecretSettings = account.PasswordSettings;
+
+---functions---
+
+account.getPasswordSettings#9cd4eaf9 password:InputCheckPasswordSRP = account.PasswordSettings;
+

The client requests the user's 2FA password and generates the SRP paramaters to be passed to account.getPasswordSettings.

+

If the password is correct, an account.passwordSettings constructor with secureSecretSettings is returned.

+

encrypted_passport_secret, passport_secret_fingerprint parameters are extracted from the secureSecretSettings constructor:

+
encrypted_passport_secret = secureSecretSettings.secure_secret
+passport_secret_fingerprint = secureSecretSettings.secure_id
+

The combined passport_secret_salt is extracted from the SecurePasswordKdfAlgo.

+
passport_secret_salt = SecurePasswordKdfAlgo.salt
+

Similar to passport secret encryption, the following process is used to decrypt and verify the encrypted_passport_secret:

+
    +
  • +

    The user's 2FA plaintext password is hashed using the specified algorithm.

    + +
  • +
  • +

    The secret_key and iv parameters are extracted from the generated password_hash

    +
    secret_key = slice( password_hash, 0, 32 )
    +iv = slice( password_hash, 32, 16 )
    +
  • +
  • +

    The encrypted_passport_secret is decrypted using AES256-CBC with the key secret_key and iv:

    +
    passport_secret = AES256_CBC_DEC(encrypted_passport_secret, secret_key, iv)
    +
  • +
  • +

    The passport_secret is verified by generating and checking the fingerprint:

    +
    my_passport_secret_fingerprint = long( slice( SHA256( passport_secret ), 0, 8 ) )
    +

    The client must verify that passport_secret_fingerprint is indeed equal to my_passport_secret_fingerprint.

    +
  • +
+

The passport_secret can now be used to decrypt encrypted passport data stored on telegram servers:

+

Data and File Encryption

+

Encryption

+

To encrypt Telegram Passport data, the client generates a data_secret (a 32-byte number with the modulo 255 sum of bytes equal to 239). The the data is encrypted according to the following scheme:

+ +

Packing

+
SecureData
+
secureData#8aeabec3 data:bytes data_hash:bytes secret:bytes = SecureData;
+
    +
  • data is an encrypted and padded (see Encryption) JSON-serialized object of one of the following types: PersonalDetails, IdDocumentData, ResidentialAddress, depending on the chosen type. +Data must be in JSON format and not TL, as it has to be passed directly to the service using E2E encryption, without the bot API middleman to convert TL objects.
  • +
  • data_hash is the data_hash
  • +
  • secret is the encrypted_data_secret
  • +
+

Data is an encrypted and padded JSON-serialized object of one of the specified JSON types, depending on the chosen type.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Chosen typeJSON object
secureValueTypePersonalDetailsPersonalDetails
secureValueTypePassportIdDocumentData
secureValueTypeDriverLicenseIdDocumentData
secureValueTypeIdentityCardIdDocumentData
secureValueTypeInternalPassportIdDocumentData
secureValueTypeAddressResidentialAddress
+
InputSecureFile
+
inputSecureFileUploaded#3334b0f0 id:long parts:int md5_checksum:string file_hash:bytes secret:bytes = InputSecureFile;
+inputSecureFile#5367e5be id:long access_hash:long = InputSecureFile;
+
+---functions---
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+

Files (JPG format, max. 10MB) are encrypted and padded (see Encryption), and then uploaded chunk by chunk as described in files », except that instead of generating an inputFile, an inputSecureFile should be generated, instead.

+
    +
  • As for secret chat files, the md5_checksum is to be set to the MD5 hash of the encrypted file, for a server-side integrity check.
  • +
  • The file_hash field should be set to the data_hash of the data.
  • +
  • The secret field is the encrypted_data_secret.
  • +
+
SecurePlainData
+
securePlainPhone#7d6099dd phone:string = SecurePlainData;
+securePlainEmail#21ec5a5f email:string = SecurePlainData;
+
+---functions---
+
+account.sendVerifyPhoneCode#a5a356f9 phone_number:string settings:CodeSettings = auth.SentCode;
+account.verifyPhone#4dd3a7f6 phone_number:string phone_code_hash:string phone_code:string = Bool;
+account.sendVerifyEmailCode#7011509f email:string = account.SentEmailCode;
+account.verifyEmail#ecba39db email:string code:string = Bool;
+
+auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode;
+auth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;
+

The email/phone is passed in plaintext using the respective SecurePlainData constructor. +To verify a phone number or email and use it in Telegram Passport, use the appropriate methods:

+ +

The flow is similar to the one used for logging in:

+
    +
  • Send email/phone code using the appropriate account.sendVerify*Code method
  • +
  • Pass the received code to the appropriate account.verify* method
  • +
  • Only for phone code verification, you can also resend/cancel the phone code using auth.resendCode/auth.cancelCode, as for logging in.
  • +
+

For more info, see the authorization docs.

+

When to use each constructor.

+
inputSecureFileUploaded#3334b0f0 id:long parts:int md5_checksum:string file_hash:bytes secret:bytes = InputSecureFile;
+inputSecureFile#5367e5be id:long access_hash:long = InputSecureFile;
+
+secureValueTypePersonalDetails#9d2a81e3 = SecureValueType;
+secureValueTypePassport#3dac6a00 = SecureValueType;
+secureValueTypeDriverLicense#6e425c4 = SecureValueType;
+secureValueTypeIdentityCard#a0d0744b = SecureValueType;
+secureValueTypeInternalPassport#99a48f23 = SecureValueType;
+secureValueTypeAddress#cbe31e26 = SecureValueType;
+secureValueTypeUtilityBill#fc36954e = SecureValueType;
+secureValueTypeBankStatement#89137c0d = SecureValueType;
+secureValueTypeRentalAgreement#8b883488 = SecureValueType;
+secureValueTypePassportRegistration#99e3806a = SecureValueType;
+secureValueTypeTemporaryRegistration#ea02ec33 = SecureValueType;
+secureValueTypePhone#b320aadb = SecureValueType;
+secureValueTypeEmail#8e3ca7ee = SecureValueType;
+
+securePlainPhone#7d6099dd phone:string = SecurePlainData;
+securePlainEmail#21ec5a5f email:string = SecurePlainData;
+
+secureData#8aeabec3 data:bytes data_hash:bytes secret:bytes = SecureData;
+
+inputSecureValue#db21d0a7 flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?InputSecureFile reverse_side:flags.2?InputSecureFile selfie:flags.3?InputSecureFile translation:flags.6?Vector<InputSecureFile> files:flags.4?Vector<InputSecureFile> plain_data:flags.5?SecurePlainData = InputSecureValue;
+

The scheme for the inputSecureValue constructor defines the constructor to use for each field.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
typeSecureValueTypeSecure passport value type
dataflags.0?SecureDataEncrypted Telegram Passport element data
front_sideflags.1?InputSecureFileEncrypted passport file with the front side of the document
reverse_sideflags.2?InputSecureFileEncrypted passport file with the reverse side of the document
selfieflags.3?InputSecureFileEncrypted passport file with a selfie of the user holding the document
translationflags.6?Vector<InputSecureFile>Array of encrypted passport files with translated versions of the provided documents
filesflags.4?Vector<InputSecureFile>Array of encrypted passport files with photos the of the documents
plain_dataflags.5?SecurePlainDataPlaintext verified passport data
+

Here's a list of possible SecureValueTypes, and the parameters that can be set/requested when using each type.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeAllowed fields
secureValueTypeEmailplain_data
secureValueTypePhoneplain_data
secureValueTypePersonalDetailsdata
secureValueTypePassportdata, front_side, selfie, translation
secureValueTypeDriverLicensedata, front_side, reverse_side, selfie, translation
secureValueTypeIdentityCarddata, front_side, reverse_side, selfie, translation
secureValueTypeInternalPassportdata, front_side, selfie, translation
secureValueTypeAddressdata
secureValueTypeUtilityBillfiles, translation
secureValueTypeBankStatementfiles, translation
secureValueTypeRentalAgreementfiles, translation
secureValueTypePassportRegistrationfiles, translation
secureValueTypeTemporaryRegistrationfiles, translation
+

Fetching and deleting stored passport data

+
---functions---
+
+account.getAllSecureValues#b288bc7d = Vector<SecureValue>;
+account.getSecureValue#73665bc2 types:Vector<SecureValueType> = Vector<SecureValue>;
+account.deleteSecureValue#b880bc4b types:Vector<SecureValueType> = Bool;
+

The above methods can be used to fetch or remove encrypted Telegram Passport files stored in the Telegram Cloud by document type.

+

Passport Credentials

+

When a service requests data, it passes a nonce to the client. The nonce is a cryptographically secure unique identifier which allows the service to identify a request when receiving data as well as confirm the integrity of the data. The Telegram server doesn't have access to this nonce.

+

Once the user authorizes the Telegram Passport data transfer, the client forms the credentials (Credentials JSON object). Credentials contain the data_hash and data_secret from each element of Telegram Passport to which the user has allowed access. In addition to this, the credentials will always contain the nonce that the client received from the service at the initiation of the request.

+

Credentials are then passed to the service through the Bot API in encrypted form. To encrypt the credentials, the client generates a credentials_secret (a 32-byte number with the modulo 255 sum of bytes equal to 239). Then the credentials are encrypted according to the following scheme:

+
    +
  • +

    Credentials are padded to a length which is divisible by 16 bytes. To achieve this, 32 to 255 bytes are added at the beginning, where the first byte always holds the number of added bytes and the rest are random.

    +
  • +
  • +

    A hash of the padded credentials credentials_hash is calculated:

    +
    credentials_hash = SHA256( credentials )
    +
  • +
  • +

    The encryption key credentials_key is calculated:

    +
    credentials_secret_hash = SHA512( credentials_secret + credentials_hash )
    +credentials_key = slice( credentials_secret_hash, 0, 32 )
    +iv = slice( credentials_secret_hash, 32, 16 )
    +
  • +
  • +

    Credentials are encrypted using AES256-CBC with the key credentials_key and iv.

    +
    encrypted_credentials = AES256-CBC-ENC(credentials, credentials_key, iv)
    +
  • +
  • +

    credentials_secret is encrypted with the public RSA-key of the service with OPENSSL_PKCS1_OAEP_PADDING.

    +
    encrypted_credentials_secret = RSA-ENC(credentials_secret, key, OPENSSL_PKCS1_OAEP_PADDING)
    +
  • +
  • +

    The encrypted credentials are passed to the service via the MTProto API together with the encrypred credentials_secret and credentials_hash. Along with the credentials, the service receives from the Telegram Cloud the data it requested in encrypted form. See Submitting the Passport Form and PassportData:

    +
    secureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted;
    +
  • +
  • +

    data is the encrypted_credentials

    +
  • +
  • +

    hash is the credentials_hash

    +
  • +
  • +

    secret is the encrypted_credentials_secret

    +
  • +
+

Then the service decrypts the data as described here.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/passport/example.html b/data/core.telegram.org/passport/example.html new file mode 100644 index 0000000000..d23bd8dcba --- /dev/null +++ b/data/core.telegram.org/passport/example.html @@ -0,0 +1,585 @@ + + + + + Example + + + + + + + + + + + + + + + +
+ +
+
+
+
+

Example

+ +

If you'd like to test Telegram Passport, use this page to request data. If you'd like to check out a real-life implementation, please see this blog post for examples of services that have integrated Telegram Passport.

+

Request Telegram Passport Data

+

+

+
+
+
+ + +
+
+
+
+ +
+ +
+ +
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+
+
+ +
+ +
+ +
+ +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ + +
+
+
+ +

+
+
+

Note that the passport demo bot will only store data for 1 hour and then discard it. After logging in here, you can use the logout button on this page to reset your session.

+
+ +
+ +
+
+ +
+ + + + + + + + + diff --git a/data/core.telegram.org/passport/sdk-android.html b/data/core.telegram.org/passport/sdk-android.html new file mode 100644 index 0000000000..a44201d52b --- /dev/null +++ b/data/core.telegram.org/passport/sdk-android.html @@ -0,0 +1,180 @@ + + + + + Android SDK + + + + + + + + + + + + + +
+ +
+
+
+ +

Android SDK

+ +
+ +

The Android SDK helps you easily integrate Telegram Passport requests into your Android-based apps. Check out our GitHub repository to see samples using this SDK.

+

Installation

+

Installing from Maven

+

Telegram Passport SDK is available from the Maven repository. +Add this line to the dependencies section in your build.gradle:

+
compile 'org.telegram:passport:1.1'
+

and sync your project.

+

Adding as a module

+

Download the library, unzip it and copy the library project to the root of your project directory (the one with settings.gradle and gradle.properties). Then, make the following changes to your Gradle scripts.

+

In settings.gradle, add ':telegrampassport' to includes:

+
include ':app', ':telegrampassport'
+

In the build.gradle file for your app, add this line to the dependencies section:

+
compile ':telegrampassport'
+

and sync your project.

+

Usage

+

Adding the button

+

The SDK provides the "Log in with Telegram" button which we recommend using for a consistent user experience across different apps. You can either add it from your Java code:

+
TelegramLoginButton telegramButton;
+// ...
+telegramButton=new TelegramLoginButton(this);
+// Optionally you can change the roundness of the button corners
+// to better fit your design.
+telegramButton.setCornerRoundness(1f);
+viewGroupOfSomeSort.addView(telegramButton, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+

Or from XML:

+
 <org.telegram.passport.TelegramLoginButton
+             android:layout_width="wrap_content"
+             android:layout_height="wrap_content"
+             app:cornerRoundness="0.5"/>
+

Requesting authorization

+

The button doesn't do anything by itself; you need to set an OnClickListener on it to start the authorization flow (replace the comments with actual parameters):

+
private static final int TG_PASSPORT_RESULT=352; // this can be any integer less than 0xFFFF
+// ...
+telegramButton.setOnClickListener(new View.OnClickListener(){
+@Override
+public void onClick(View view){
+    TelegramPassport.AuthRequest req=new TelegramPassport.AuthRequest();
+    req.botID=/* your bot ID here */;
+    req.publicKey=/* your bot public key here */;
+    req.nonce=/* a unique nonce to pass to the bot server */;
+    // Request either a passport or an ID card with selfie, a driver license, personal details with
+    // name as it appears in the documents, address with any address document, and a phone number.
+    // You could also pass a raw JSON object here if that's what works better for you
+    // (for example, if you already get it from your server in the correct format).
+    req.scope=new PassportScope(
+        new PassportScopeElementOneOfSeveral(PassportScope.PASSPORT, PassportScope.IDENTITY_CARD).withSelfie(),
+        new PassportScopeElementOne(PassportScope.PERSONAL_DETAILS).withNativeNames(),
+        PassportScope.DRIVER_LICENSE,
+        PassportScope.ADDRESS,
+        PassportScope.ADDRESS_DOCUMENT,
+        PassportScope.PHONE_NUMBER
+    );
+    TelegramPassport.request(MyActivity.this, req, TG_PASSPORT_RESULT);
+}});
+

If you need more control over the process, the TelegramPassport class contains several more methods:

+
    +
  • getAuthIntent(AuthParams) returns an Intent for you to use in startActivityForResult if you need to do that in some special way. Be sure to check that an app is present that can handle this intent before starting it by using PackageManager or intent.resolveActivity.
  • +
  • showAppInstallAlert(Activity) shows an alert that the user needs to install Telegram in order to continue. This is intended to be used together with the previous method for the cases when the app isn't installed.
  • +
+

Handling the result

+

The result is delivered via the onActivityResult method in your activity with the request code you passed to TelegramPassport.request. Currently, the only meaningful parameter is resultCode, which is RESULT_OK if the authorization was successful and RESULT_CANCELED otherwise.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/passport/sdk-ios-mac.html b/data/core.telegram.org/passport/sdk-ios-mac.html new file mode 100644 index 0000000000..05aa14d5ed --- /dev/null +++ b/data/core.telegram.org/passport/sdk-ios-mac.html @@ -0,0 +1,246 @@ + + + + + iOS & macOS SDK + + + + + + + + + + + + + +
+ +
+
+
+ +

iOS & macOS SDK

+ +
+ +

TGPassportKit helps you easily integrate Telegram Passport requests into your iOS & macOS apps. Check out our GitHub repository to see samples using this SDK.

+

Installation

+

Installing using Cocoapods

+

To install TGPassportKit via Cocoapods add the following to your Podfile:

+
target 'MyApp' do
+  pod 'TGPassportKit' 
+end
+

then run pod install in your project root directory.

+

Installing using Carthage

+

Add the following line to your Cartfile:

+
github "telegrammessenger/TGPassportKit"
+

then run carthage update, and you will get the latest version of TGPassportKit in your Carthage folder.

+

Project Setup

+

Configure Your Info.plist

+

Configure your Info.plist by right-clicking it in Project Navigator, choosing Open As > Source Code and adding this snippet: +Replace {bot_id} with your value

+
<key>CFBundleURLTypes</key>
+<array>
+  <dict>
+  <key>CFBundleURLSchemes</key>
+  <array>
+    <string>tgbot{bot_id}</string>
+  </array>
+  </dict>
+</array>
+<key>LSApplicationQueriesSchemes</key>
+<array>
+  <string>tg</string>
+</array>
+

Connect AppDelegate methods

+

Add this code to your UIApplicationDelegate implementation

+
#import <TGPassportKit/TGPAppDelegate.h>
+
+- (BOOL)application:(UIApplication *)application
+            openURL:(NSURL *)url
+            options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options {
+    BOOL handledByPassportKit = [[TGPAppDelegate sharedDelegate] application:application
+                                                                     openURL:url
+                                                                     options:options];
+
+    return YES;
+}
+

If you support iOS 9 and below, also add this method:

+
- (BOOL)application:(UIApplication *)application 
+            openURL:(NSURL *)url 
+  sourceApplication:(nullable NSString *)sourceApplication 
+         annotation:(id)annotation {
+    BOOL handledByPassportKit = [[TGPAppDelegate sharedDelegate] application:application
+                                                                     openURL:url
+                                                           sourceApplication:sourceApplication
+                                                                  annotation:annotation];
+
+    return YES;
+}
+

Usage

+

Add Telegram Passport Button

+

To add the Telegram Passport button, add the following code to your view controller: +Replace {bot_id}, {bot_public_key} and {request_nonce} with your values

+
#import <TGPassportKit/TGPButton.h>
+
+@interface ViewController <TGPButtonDelegate>
+
+@end
+
+@implementation ViewController
+
+- (void)viewDidLoad {
+  [super viewDidLoad];
+
+  TGPButton *button = [[TGPButton alloc] init];
+  button.botConfig = [[TGPBotConfig alloc] initWithBotId:{bot_id} 
+                                               publicKey:@"{bot_public_key}"];
+  button.scope = [[TGPScope alloc] initWithJSONString:@"{\"data\":[\"id_document\",\"address_document\",\"phone_number\"],\"v\":1}"];
+// You can also construct a scope using provided data type classes like this: 
+// button.scope = [[TGPScope alloc] initWithTypes:@[[[TGPPersonalDetails alloc] init], [[TGPIdentityDocument alloc] initWithType:TGPIdentityDocumentTypePassport selfie:true translation:true]]];
+  button.nonce = @"{request_nonce}";
+  button.delegate = self;
+  [self.view addSubview:button];
+}
+
+- (void)passportButton:(TGPButton *)passportButton 
+ didCompleteWithResult:(TGPRequestResult)result 
+                 error:(NSError *)error {
+    switch (result) {
+        case TGPRequestResultSucceed:
+            NSLog(@"Succeed");
+            break;
+
+        case TGPRequestResultCancelled:
+            NSLog(@"Cancelled");
+            break;
+
+        default:
+            NSLog(@"Failed");
+            break;
+    }
+}
+
+@end
+

...or Implement Your Own Behavior

+

If you want to design a custom UI and behavior, you can invoke a Passport request like this: +Replace {bot_id}, {bot_public_key} and {request_nonce} with your values

+
#import <TGPassportKit/TGPRequest.h>
+
+- (void)performPassportRequest 
+{
+    TGPBotConfig *botConfig = [[TGPBotConfig alloc] initWithBotId:{bot_id} 
+                                                        publicKey:@"{bot_public_key}"];
+    TGPRequest *request = [[TGPRequest alloc] initWithBotConfig:botConfig];
+    [request performWithScope:[[TGPScope alloc] initWithJSONString:@"{\"data\":[\"id_document\",\"phone_number\"],\"v\":1}"] 
+                      payload:@"{request_nonce}" 
+            completionHandler:^(TGPRequestResult result, NSError * _Nullable error) {
+        switch (result) {
+            case TGPRequestResultSucceed:
+                NSLog(@"Succeed");
+                break;
+
+            case TGPRequestResultCancelled:
+                NSLog(@"Cancelled");
+                break;
+
+            default:
+                NSLog(@"Failed");
+                break;
+        }
+    }];
+}
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/passport/sdk-javascript.html b/data/core.telegram.org/passport/sdk-javascript.html new file mode 100644 index 0000000000..ffa54bb091 --- /dev/null +++ b/data/core.telegram.org/passport/sdk-javascript.html @@ -0,0 +1,258 @@ + + + + + Javascript SDK + + + + + + + + + + + + + +
+ +
+
+
+ +

Javascript SDK

+ +
+ +

The Javascript SDK helps you easily integrate Telegram Passport requests into your website. Check out our GitHub repository to see samples using this SDK.

+

Installation

+

Download and include the Javascript SDK in the head section of your page:

+
<script src="telegram-passport.js"></script>
+

Usage

+

Simply call Telegram.Passport.createAuthButton to create the default Telegram Passport button:

+
<div id="telegram_passport_auth"></div>
+<script>
+  Telegram.Passport.createAuthButton('telegram_passport_auth', {
+    bot_id:       123456, // place id of your bot here
+    scope:        {data: [{type: 'id_document', selfie: true}, 'address_document', 'phone_number', 'email'], v: 1},
+    public_key:   '-----BEGIN PUBLIC KEY----- ...', // place public key of your bot here
+    nonce:        'ab2df83746a87d2f3bd6...', // place nonce here
+    callback_url: 'https://example.com/callback/' // place callback url here
+  });
+</script>
+
+

Note that if you use a Content-Security-Policy (CSP) header with the frame-src/child-src directive you should allow tg: source to prevent errors in some browsers (e.g. Firefox)

+
+

createAuthButton

+ + + + + + + + + + + + + + + + + + + + + + + +
ParametersTypeRequired
elementString or DOMNodeYes
auth_paramsAuthParameters or FunctionYes
optionsAuthButtonOptionsOptional
+

AuthParameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
bot_idIntegerUnique identifier for the bot
scopePassportScopeA JSON-serialized object describing the data you want to request
public_keyStringPublic key of your bot
nonceStringBot-specified nonce
callback_urlStringOptional. URL to which the user will be redirected.
+

AuthButtonOptions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
textStringOptional. Text on the button. Defaults to "Log In With Telegram".
radiusIntegerOptional. Radius of the button and tooltip in px. Defaults to 23.
tooltip_textStringOptional. Text on the tooltip. Defaults to "Please install Telegram to use this option.".
tooltip_positionStringOptional. Tooltip position. One of "top", "bottom", "left", "right". Defaults to "bottom".
tooltip_forceBooleanOptional. Always show a tooltip. Defaults to false.
+

You can also create your custom button. Do not forget about the tooltip. You should add an onclick listener to the button which calls the Telegram.Passport.auth(auth_params, tooltip_toggle); method:

+
<button id="telegram_passport_auth">Log In With Telegram</button>
+<script>
+  var auth_button = document.getElementById('telegram_passport_auth');
+  var auth_params = {
+    bot_id:        XXXXXX, // place id of your bot here
+    scope:         {data: [{type: 'id_document', selfie: true}, 'address_document', 'phone_number', 'email'], v: 1},
+    public_key:    '-----BEGIN PUBLIC KEY----- ...', // place public key of your bot here
+    nonce:         'ab2df83746a87d2f3bd6...', // place nonce here
+    callback_url:  'https://example.com/callback/' // place callback url here
+  };
+  auth_button.addEventListener('click', function() {
+    Telegram.Passport.auth(auth_params, function(show) {
+      if (show) {
+        // some code to show tooltip
+      } else {
+        // some code to hide tooltip
+      }
+    });
+  }, false);
+</script>
+

Receiving information

+

When the user confirms your request by pressing the 'Authorize' button, it will be redirected to the URL specified in the callback_url with the parameter tg_passport=success and the Bot API will send the bot an Update with the field passport_data which contains encrypted Telegram Passport data.

+

If the user cancels your request, it will be redirected to the URL specified in the callback_url with the parameter tg_passport=cancel.

+

If an error occurs during the request, the user will be redirected to the URL specified in the callback_url with the parameter tg_passport=error. The parameter error will contain one of the following values: BOT_INVALID, PUBLIC_KEY_REQUIRED, PUBLIC_KEY_INVALID, SCOPE_EMPTY, NONCE_EMPTY.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/reproducible-builds.html b/data/core.telegram.org/reproducible-builds.html new file mode 100644 index 0000000000..cc4eb5657b --- /dev/null +++ b/data/core.telegram.org/reproducible-builds.html @@ -0,0 +1,485 @@ + + + + + Reproducible Builds for iOS and Android + + + + + + + + + + + + + +
+ +
+
+
+
+

Reproducible Builds for iOS and Android

+ +

This page contains instructions for verifying that Telegram's open source code is exactly the same as the code that is used to build the apps that are available in the App Store, Google Play and directly on the Telegram website.

+

Warning: Telegram supports reproducible builds as of version 5.13. Bear in mind that, at this stage, the verification process should be considered experimental. We will be updating our apps and these instructions to make this process as straightforward as possible.

+ +
+

Please read the relevant notes and troubleshooting section carefully.

+
+
+
+ Dude in a jacket inspecting the hologram of a mechanical dog to verify it's built according to the blueprints provided. +
+ +

Reproducible Builds for Android

+

Step 1. Install Docker

+

Docker can be obtained here. Once the installation is complete, log into your Docker account > Preferences > Advanced and configure the amount of resources Docker may use:

+
+ +

Docker Performance

+
+ +

We recommend using the maximum amount allowed by your system's hardware, in order to speed up the build time.

+

Step 2. Confirm which version you have installed on your Android device

+

You can find the version/build number at the bottom of the Settings page. Note that Telegram supports reproducible builds starting with version 5.13.

+
+ +

App Version

+
+ +

The commit tag to checkout source code for the example above will be release-5.13.0_1821.

+
+

Please make sure that you're using the correct version and build number of the version you want to check (and not the one from this example 😈).

+
+

The part after the version number will help you know in which folder to look for the correct APK when you've finished building the app (Step 4):

+
    +
  • “Direct” after version number means that the APK will be inside the “afat/standalone” folder.
  • +
  • “Universal” after version number means that the APK will be inside the “afat/release” folder.
  • +
  • If you have Android Version 6.0 or greater, your APK folder will have the “_SDK23” suffix.
  • +
  • “arm64-v8a” - folder name will start with “arm64”.
  • +
  • “armeabi-v7” - folder name will start with “armv7”.
  • +
  • “x86” - folder name will start with “x86”.
  • +
  • “x86_64” - folder name will start with “x64”.
  • +
+
+ +

APK Folders

+
+ + +

Step 3. Obtain the source code

+

Open Terminal, run the commands:
git clone https://github.com/DrKLO/Telegram.git $HOME/telegram-android
cd $HOME/telegram-android
git checkout release-{VERSION AND BUILD NUMBER FROM STEP 2}

+

For our example, the command would be:
git checkout release-5.13.0_1821

+
+ +
+ +

Step 4. Build the app

+

Open Terminal, run the commands:
cd $HOME/telegram-android
docker build -t telegram-build .

+
+ +
+ +

docker run --rm -v "$PWD":/home/source telegram-build

+
+ +
+ +

These commands will produce 9 different APKs for different target SDK versions and CPU ABIs.

+

These APKs can be found in:
$HOME/telegram-android/TMessagesProj/build/outputs/apk/

+

Use the folder name from Step 2 to find the correct folder that holds the same APK as installed on your device. For example, for non-universal Android 9.0 arm64-v8a, the path to your APK will be:
$HOME/telegram-android/TMessagesProj/build/outputs/apk/arm64_SDK23/release/app.apk
Copy this APK to the root source directory by running this command in Terminal:
cp $HOME/telegram-android/TMessagesProj/build/outputs/apk/arm64_SDK23/release/app.apk $HOME/telegram-android/telegram_built.apk

+
+ +
+ +

Step 5. The Telegram APK installed on your device

+

You will need adb for this step.

+
+ +

ADB

+
+ +
+

If you downloaded your APK directly from Telegram's website, use the package name org.telegram.messenger.web in this step. To verify the Google Play APK, use org.telegram.messenger.

+
+

Connect your device to the computer, open Terminal, run the commands:
adb shell pm path org.telegram.messenger

+
+ +
+ +

The output will look something like this:
package:/data/app/org.telegram.messenger-_zOSURFEx2GpHM8UDF_PVg==/base.apk
By using this information, pull the APK from your device to $HOME/telegram-android using command:
adb pull /data/app/org.telegram.messenger-_zOSURFEx2GpHM8UDF_PVg==/base.apk $HOME/telegram-android/telegram_store.apk

+

Step 6. Compare the APKs

+

Open Terminal, run the commands:
cd $HOME/telegram-android
python apkdiff.py telegram_store.apk telegram_built.apk
If the APKs are the same, you will see
APKs are the same!

+
+ +
+Tada! + +Otherwise, something went wrong. +
+ +
+ +

If your APKs don't match, please make sure that you chose the correct code version and the right SDK.

+

Check out the Troubleshooting section first in case you run into trouble.

+
+

Reproducible Builds for iOS

+

The verification process for iOS builds is, unfortunately, a lot more complex than for Android. The two main issues with Apple's current policies and infrastructure are as follows:

+
    +
  1. Apple insists on using FairPlay encryption to “protect” even free apps from “app pirates” which makes obtaining the executable code of apps impossible without a jailbroken device. To solve this issue, Apple would simply need to allow submitting unencryptable binaries to the App Store. This would not affect security since the code would still be signed – and would enable anyone to check the integrity of apps supporting reproducible builds without endangering the integrity and security of their devices.

    +
  2. +
  3. Building your own reproducible binaries is difficult because macOS doesn't support containers like Docker. If Apple followed in the footsteps of Linux (and even Microsoft!) and added container support, it would eliminate the need for steps 1-3 in the guide below.

    +
  4. +
+
+

As things stand now, you'll need a jailbroken device, at least 1,5 hours and approximately 90GB of free space to properly set up a virtual machine for the verification process.

+
+

To provide a stable and easily reproducible environment, Telegram iOS builds are compiled on a virtual machine. Parallels is used to verify the builds.

+

Step 1. Install the Parallels virtual machine

+

Parallels can be obtained here, it features a fully-functional trial version.

+

Step 2. Install the latest version of macOS Catalina

+

To download an image that can be installed on the virtual machine, open the App Store, search for “Catalina” and click “View”.

+
+ +

Search for macOS Catalina on App Store > View

+
+ +
+ +

macOS Catalina > Get +

+
+ +

This will open a system pop-up offering to download the OS:

+
+ +
+Choose “Download” and wait for the download to finish. + +> If you were not using the latest version of the OS, your system may start updating instead. Please finish updating to download macOS Catalina. + +When done, open Parallels and choose macOS Catalina: + +
+ +

Select 'Install Windows or another OS' > Continue

+
+ +
+ +

Select a file... > Applications (All files) > Install macOS Сatalina

+
+ +

Before starting the installation, configure the virtual machine:

+
+ +

Checkbox 'Customize settings before installation'

+
+ +

Change the name of the virtual machine to macos10_15_Xcode12_2

+
+ +

Name VM as macos10_15_Xcode12_2

+
+ +

Hardware > Processors: 2-4
Memory > 4GB may suffice but 8GB is recommended

+
+ +

At least 2 CPUs + 4 (8 recommended) GB Memory.

+
+ +

You will get something like this:

+
+ +

Click Continue

+
+ +

Parallels may request access to your microphone and camera, this is not required – just press Close.

+
+ +

Install macOS > Continue

+
+ +

Your Apple ID is also not required, you can choose Set Up Later.

+
+ +

Skip Apple ID with 'Set Up Later'

+
+ +

Use “telegram” for both the account name and password.

+
+

Do not ever use the password “telegram” for anything else, it's cursed.

+
+
+ +

Create a computer account with 'telegram' set both as account name and password

+
+ +

Now install Parallels tools from the menu bar:

+
+ + +

Install Parallels Tools using menu bar > Parallels icon > Actions > Install (Reinstall) Parallels Tools...

+
+ +

After the system restarts, log in.
Open Terminal and run:
sudo visudo
Enter the password “telegram”

+
+ +
+ +

Find this line at the end of the file:
%admin ALL=(ALL) ALL
Press “i” on your keyboard, add “NOPASSWD:”
%admin ALL=(ALL) NOPASSWD: ALL
Press Escape.
Type in “:wq”
Press Enter

+
+ +

Press i to edit the highlighted string.

+ +

Enter :wq > press Enter.

+
+ +

In the terminal, run:
sudo systemsetup -setcomputersleep Never

+
+ +

sudo systemsetup -setcomputersleep Never > press Enter.

+
+ +

Step 3. Install SSH keys on the virtual machine

+

In the virtual machine, open System Settings > Sharing and enable Remote Login.

+
+ +
+ +

In the virtual machine, open Terminal and run:
mkdir -p .ssh; nano .ssh/authorized_keys

+
+ +
+ +

In your main OS, open Terminal and run:
if [ ! -e ~/.ssh/id_rsa.pub ]; then ssh-keygen -t rsa -b 4096; fi && cat ~/.ssh/id_rsa.pub | pbcopy

+
+ +
+ +

If you see the line “Enter file in which to save the key (/Users/…/.ssh/id_rsa):”, press Enter
In the virtual machine, press CMD+V
Then Ctrl+O, Ctrl+X

+
+ +
+ +

Step 4. Install Xcode version 12.2

+

In the virtual machine, open Safari and go to https://developer.apple.com
Sign in to your Account:

+
+ +

developer.apple.com > Account > sign in with your Apple ID

+
+ +

Go to Downloads > More
Enter Xcode in the search field and find the version 12.2

+
+ +

Downloads > More > Xcode 12.2

+
+ +

Once the installation is complete, open the file Xcode 12.2.xip. The system will unarchive the app into the same folder. Move it to the Applications folder using Finder.

+
+ +

Unarchive Xcode > drag the app to Applications folder

+
+ +
+ +
+ +

On the virtual machine, run this command from the terminal:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

+
+ +
+ +

Shut down the virtual machine.

+
+ +

Shut down the virtual machine

+
+ +

Step 5. Obtaining the source code

+

git clone --recursive https://github.com/TelegramMessenger/telegram-ios.git $HOME/telegram-ios
cd $HOME/telegram-ios
git checkout release-${VERSION_NUMBER}

+

E.g., git checkout release-7.3. Please note that you need to check out the whole git history as the build version depends on the number of commits in the repository.

+
+ +
+ +

Step 6. Downloading Bazel 3.7.0 to $HOME/bazel/bazel

+

mkdir -p $HOME/bazel && cd $HOME/bazel
curl -O -L https://github.com/bazelbuild/bazel/releases/download/3.7.0/bazel-3.7.0-darwin-x86_64
mv bazel-3.7.0-darwin-x86_64 bazel

+

Check that you have downloaded the correct version:
chmod +x bazel
./bazel --version

+

Step 7. Building the app

+

Open Terminal, run the commands:
cd $HOME/telegram-ios +BAZEL="$HOME/bazel/bazel" sh buildbox/build-telegram.sh verify

+
+ +
+ +

If the environment has been set up correctly, this will start the building process. Note that this step can easily take 30-40 minutes. The average build time on a MacBook Pro (i9 6 core) is 35 minutes.

+
+ + +
+ +

Once the process is complete the resulting IPA file can be found in build/artifacts/Telegram.ipa
All the following steps will be made via Terminal on your main system.

+

Step 8. Downloading a decrypted version of the app from the App Store

+

This step requires a jailbroken device equipped with tools for decrypting apps. We‘d love to make this process more simple but that’s what you get for using Apple tech.

+

Step 9. Comparing the AppStore build and the version built in the virtual machine

+

Install the necessary tools:
if ! type brew > /dev/null; + then /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"; fi && brew install python3

+
+ +
+ +

Run
python3 tools/ipadiff.py build/artifacts/Telegram.ipa PATH-TO-THE-IPA-FILE-FROM-STEP-9

+
    +
  1. cd telegram-ios > Enter
  2. +
  3. python3 tools/ipadiff.py build/artifacts/Telegram.ipa /path/ > Enter
  4. +
+
+ +
+ +

In case of a successful comparison, you will get a text along these lines:

+
IPAs are equal, except for the files that can't currently be checked:
+    Excluded files that couldn't be checked due to being encrypted:
+        PlugIns/SiriIntents.appex/SiriIntents
+        PlugIns/Widget.appex/Widget
+        PlugIns/NotificationContent.appex/NotificationContent
+        PlugIns/NotificationService.appex/NotificationService
+        PlugIns/Share.appex/Share
+    IPAs contain Watch directory with a Watch app which can't be checked currently.
+    IPAs contain .car (Asset Catalog) files that are compiled by the App Store and can't currently be checked:
+
+        Frameworks/TelegramUI.framework/Assets.car
+        Assets.car
+    IPAs contain .nib (compiled Interface Builder) files that are compiled by the App Store and can't currently be checked:
+        Base.lproj/LaunchScreen.nib
+
+ +
+ +

In case of any mismatches, you'll get a detailed report.

+
+ +
+ +

iOS: Notes

+
    +
  1. You will get a warning if the archive created in Step 7 contains encrypted files. If all these files are in the PlugIns subfolder, they represent various system extensions (e.g. external sharing, Siri, 3D touch). Decrypting such files using existing ways of receiving app archives via Jailbreak is non-trivial (but we're working on resolving this issue). If you do manage to decrypt them, e.g. on iOS 8, they will be matched.

    +
  2. +
  3. You will be notified if the archive includes an Apple Watch app. The watch app will soon no longer be included in the archive.

    +
  4. +
  5. Files with the .car extension are app resource archives (images, sounds) which were compiled and processed specifically for the target device. The App Store processes them in non-trivial ways, we're planning on getting rid of them in future versions.

    +
  6. +
  7. The LaunchScreen.nib file is an empty file containing a description of the interface which is displayed by the system before the app is launched. It is processed by the App Store in a non-trivial way but doesn't contain any code and therefore may be ignored.

    +
  8. +
+
+

Troubleshooting

+

If you encounter any issues with obtaining the code, building and comparing the apps, please contact us at @botsupport and include the hashtag #reproducibleBuilds with your message describing the problem.

+

Troubleshooting: Android

+
    +
  1. Make sure that you checkout the correct version of the code.

    +
  2. +
  3. Make sure that you build the app using the right SDK.

    +
  4. +
  5. If the gradle version used in the Dockerfile is not available anymore and building of the Docker image fails, wait for a Dockerfile update or update manually to lastest available version.

    +
  6. +
+

+

We will update this section with information on overcoming other common issues.

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/schema/end-to-end-json.html b/data/core.telegram.org/schema/end-to-end-json.html new file mode 100644 index 0000000000..6c3b4f2cbe --- /dev/null +++ b/data/core.telegram.org/schema/end-to-end-json.html @@ -0,0 +1 @@ +{"constructors":[{"id":"528568095","predicate":"decryptedMessage","params":[{"name":"random_id","type":"long"},{"name":"random_bytes","type":"bytes"},{"name":"message","type":"string"},{"name":"media","type":"DecryptedMessageMedia"}],"type":"DecryptedMessage","layer":8},{"id":"541931640","predicate":"decryptedMessage","params":[{"name":"random_id","type":"long"},{"name":"ttl","type":"int"},{"name":"message","type":"string"},{"name":"media","type":"DecryptedMessageMedia"}],"type":"DecryptedMessage","layer":17},{"id":"917541342","predicate":"decryptedMessage","params":[{"name":"flags","type":"#"},{"name":"random_id","type":"long"},{"name":"ttl","type":"int"},{"name":"message","type":"string"},{"name":"media","type":"flags.9?DecryptedMessageMedia"},{"name":"entities","type":"flags.7?Vector"},{"name":"via_bot_name","type":"flags.11?string"},{"name":"reply_to_random_id","type":"flags.3?long"}],"type":"DecryptedMessage","layer":45},{"id":"-1848883596","predicate":"decryptedMessage","params":[{"name":"flags","type":"#"},{"name":"random_id","type":"long"},{"name":"ttl","type":"int"},{"name":"message","type":"string"},{"name":"media","type":"flags.9?DecryptedMessageMedia"},{"name":"entities","type":"flags.7?Vector"},{"name":"via_bot_name","type":"flags.11?string"},{"name":"reply_to_random_id","type":"flags.3?long"},{"name":"grouped_id","type":"flags.17?long"}],"type":"DecryptedMessage","layer":73},{"id":"-1438109059","predicate":"decryptedMessageService","params":[{"name":"random_id","type":"long"},{"name":"random_bytes","type":"bytes"},{"name":"action","type":"DecryptedMessageAction"}],"type":"DecryptedMessage","layer":8},{"id":"1930838368","predicate":"decryptedMessageService","params":[{"name":"random_id","type":"long"},{"name":"action","type":"DecryptedMessageAction"}],"type":"DecryptedMessage","layer":17},{"id":"144661578","predicate":"decryptedMessageMediaEmpty","params":[],"type":"DecryptedMessageMedia","layer":8},{"id":"846826124","predicate":"decryptedMessageMediaPhoto","params":[{"name":"thumb","type":"bytes"},{"name":"thumb_w","type":"int"},{"name":"thumb_h","type":"int"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"size","type":"int"},{"name":"key","type":"bytes"},{"name":"iv","type":"bytes"}],"type":"DecryptedMessageMedia","layer":8},{"id":"-235238024","predicate":"decryptedMessageMediaPhoto","params":[{"name":"thumb","type":"bytes"},{"name":"thumb_w","type":"int"},{"name":"thumb_h","type":"int"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"size","type":"int"},{"name":"key","type":"bytes"},{"name":"iv","type":"bytes"},{"name":"caption","type":"string"}],"type":"DecryptedMessageMedia","layer":45},{"id":"1290694387","predicate":"decryptedMessageMediaVideo","params":[{"name":"thumb","type":"bytes"},{"name":"thumb_w","type":"int"},{"name":"thumb_h","type":"int"},{"name":"duration","type":"int"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"size","type":"int"},{"name":"key","type":"bytes"},{"name":"iv","type":"bytes"}],"type":"DecryptedMessageMedia","layer":8},{"id":"1380598109","predicate":"decryptedMessageMediaVideo","params":[{"name":"thumb","type":"bytes"},{"name":"thumb_w","type":"int"},{"name":"thumb_h","type":"int"},{"name":"duration","type":"int"},{"name":"mime_type","type":"string"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"size","type":"int"},{"name":"key","type":"bytes"},{"name":"iv","type":"bytes"}],"type":"DecryptedMessageMedia","layer":17},{"id":"-1760785394","predicate":"decryptedMessageMediaVideo","params":[{"name":"thumb","type":"bytes"},{"name":"thumb_w","type":"int"},{"name":"thumb_h","type":"int"},{"name":"duration","type":"int"},{"name":"mime_type","type":"string"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"size","type":"int"},{"name":"key","type":"bytes"},{"name":"iv","type":"bytes"},{"name":"caption","type":"string"}],"type":"DecryptedMessageMedia","layer":45},{"id":"893913689","predicate":"decryptedMessageMediaGeoPoint","params":[{"name":"lat","type":"double"},{"name":"long","type":"double"}],"type":"DecryptedMessageMedia","layer":8},{"id":"1485441687","predicate":"decryptedMessageMediaContact","params":[{"name":"phone_number","type":"string"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"user_id","type":"int"}],"type":"DecryptedMessageMedia","layer":8},{"id":"-1586283796","predicate":"decryptedMessageActionSetMessageTTL","params":[{"name":"ttl_seconds","type":"int"}],"type":"DecryptedMessageAction","layer":8},{"id":"-1332395189","predicate":"decryptedMessageMediaDocument","params":[{"name":"thumb","type":"bytes"},{"name":"thumb_w","type":"int"},{"name":"thumb_h","type":"int"},{"name":"file_name","type":"string"},{"name":"mime_type","type":"string"},{"name":"size","type":"int"},{"name":"key","type":"bytes"},{"name":"iv","type":"bytes"}],"type":"DecryptedMessageMedia","layer":8},{"id":"2063502050","predicate":"decryptedMessageMediaDocument","params":[{"name":"thumb","type":"bytes"},{"name":"thumb_w","type":"int"},{"name":"thumb_h","type":"int"},{"name":"mime_type","type":"string"},{"name":"size","type":"int"},{"name":"key","type":"bytes"},{"name":"iv","type":"bytes"},{"name":"attributes","type":"Vector"},{"name":"caption","type":"string"}],"type":"DecryptedMessageMedia","layer":45},{"id":"1619031439","predicate":"decryptedMessageMediaAudio","params":[{"name":"duration","type":"int"},{"name":"size","type":"int"},{"name":"key","type":"bytes"},{"name":"iv","type":"bytes"}],"type":"DecryptedMessageMedia","layer":8},{"id":"1474341323","predicate":"decryptedMessageMediaAudio","params":[{"name":"duration","type":"int"},{"name":"mime_type","type":"string"},{"name":"size","type":"int"},{"name":"key","type":"bytes"},{"name":"iv","type":"bytes"}],"type":"DecryptedMessageMedia","layer":17},{"id":"206520510","predicate":"decryptedMessageActionReadMessages","params":[{"name":"random_ids","type":"Vector"}],"type":"DecryptedMessageAction","layer":8},{"id":"1700872964","predicate":"decryptedMessageActionDeleteMessages","params":[{"name":"random_ids","type":"Vector"}],"type":"DecryptedMessageAction","layer":8},{"id":"-1967000459","predicate":"decryptedMessageActionScreenshotMessages","params":[{"name":"random_ids","type":"Vector"}],"type":"DecryptedMessageAction","layer":8},{"id":"1729750108","predicate":"decryptedMessageActionFlushHistory","params":[],"type":"DecryptedMessageAction","layer":8},{"id":"467867529","predicate":"decryptedMessageLayer","params":[{"name":"random_bytes","type":"bytes"},{"name":"layer","type":"int"},{"name":"in_seq_no","type":"int"},{"name":"out_seq_no","type":"int"},{"name":"message","type":"DecryptedMessage"}],"type":"DecryptedMessageLayer","layer":17},{"id":"381645902","predicate":"sendMessageTypingAction","params":[],"type":"SendMessageAction","layer":17},{"id":"-44119819","predicate":"sendMessageCancelAction","params":[],"type":"SendMessageAction","layer":17},{"id":"-1584933265","predicate":"sendMessageRecordVideoAction","params":[],"type":"SendMessageAction","layer":17},{"id":"-1845219337","predicate":"sendMessageUploadVideoAction","params":[],"type":"SendMessageAction","layer":17},{"id":"-718310409","predicate":"sendMessageRecordAudioAction","params":[],"type":"SendMessageAction","layer":17},{"id":"-424899985","predicate":"sendMessageUploadAudioAction","params":[],"type":"SendMessageAction","layer":17},{"id":"-1727382502","predicate":"sendMessageUploadPhotoAction","params":[],"type":"SendMessageAction","layer":17},{"id":"-1884362354","predicate":"sendMessageUploadDocumentAction","params":[],"type":"SendMessageAction","layer":17},{"id":"393186209","predicate":"sendMessageGeoLocationAction","params":[],"type":"SendMessageAction","layer":17},{"id":"1653390447","predicate":"sendMessageChooseContactAction","params":[],"type":"SendMessageAction","layer":17},{"id":"1360072880","predicate":"decryptedMessageActionResend","params":[{"name":"start_seq_no","type":"int"},{"name":"end_seq_no","type":"int"}],"type":"DecryptedMessageAction","layer":17},{"id":"-217806717","predicate":"decryptedMessageActionNotifyLayer","params":[{"name":"layer","type":"int"}],"type":"DecryptedMessageAction","layer":17},{"id":"-860719551","predicate":"decryptedMessageActionTyping","params":[{"name":"action","type":"SendMessageAction"}],"type":"DecryptedMessageAction","layer":17},{"id":"-204906213","predicate":"decryptedMessageActionRequestKey","params":[{"name":"exchange_id","type":"long"},{"name":"g_a","type":"bytes"}],"type":"DecryptedMessageAction","layer":20},{"id":"1877046107","predicate":"decryptedMessageActionAcceptKey","params":[{"name":"exchange_id","type":"long"},{"name":"g_b","type":"bytes"},{"name":"key_fingerprint","type":"long"}],"type":"DecryptedMessageAction","layer":20},{"id":"-586814357","predicate":"decryptedMessageActionAbortKey","params":[{"name":"exchange_id","type":"long"}],"type":"DecryptedMessageAction","layer":20},{"id":"-332526693","predicate":"decryptedMessageActionCommitKey","params":[{"name":"exchange_id","type":"long"},{"name":"key_fingerprint","type":"long"}],"type":"DecryptedMessageAction","layer":20},{"id":"-1473258141","predicate":"decryptedMessageActionNoop","params":[],"type":"DecryptedMessageAction","layer":20},{"id":"1815593308","predicate":"documentAttributeImageSize","params":[{"name":"w","type":"int"},{"name":"h","type":"int"}],"type":"DocumentAttribute","layer":23},{"id":"297109817","predicate":"documentAttributeAnimated","params":[],"type":"DocumentAttribute","layer":23},{"id":"-83208409","predicate":"documentAttributeSticker","params":[],"type":"DocumentAttribute","layer":23},{"id":"978674434","predicate":"documentAttributeSticker","params":[{"name":"alt","type":"string"},{"name":"stickerset","type":"InputStickerSet"}],"type":"DocumentAttribute","layer":45},{"id":"1494273227","predicate":"documentAttributeVideo","params":[{"name":"duration","type":"int"},{"name":"w","type":"int"},{"name":"h","type":"int"}],"type":"DocumentAttribute","layer":23},{"id":"250621158","predicate":"documentAttributeVideo","params":[{"name":"flags","type":"#"},{"name":"duration","type":"int"},{"name":"w","type":"int"},{"name":"h","type":"int"}],"type":"DocumentAttribute","layer":66},{"id":"85215461","predicate":"documentAttributeAudio","params":[{"name":"duration","type":"int"}],"type":"DocumentAttribute","layer":23},{"id":"-556656416","predicate":"documentAttributeAudio","params":[{"name":"duration","type":"int"},{"name":"title","type":"string"},{"name":"performer","type":"string"}],"type":"DocumentAttribute","layer":45},{"id":"-1739392570","predicate":"documentAttributeAudio","params":[{"name":"flags","type":"#"},{"name":"duration","type":"int"},{"name":"title","type":"flags.0?string"},{"name":"performer","type":"flags.1?string"},{"name":"waveform","type":"flags.2?bytes"}],"type":"DocumentAttribute","layer":46},{"id":"358154344","predicate":"documentAttributeFilename","params":[{"name":"file_name","type":"string"}],"type":"DocumentAttribute","layer":23},{"id":"236446268","predicate":"photoSizeEmpty","params":[{"name":"type","type":"string"}],"type":"PhotoSize","layer":23},{"id":"2009052699","predicate":"photoSize","params":[{"name":"type","type":"string"},{"name":"location","type":"FileLocation"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"size","type":"int"}],"type":"PhotoSize","layer":23},{"id":"-374917894","predicate":"photoCachedSize","params":[{"name":"type","type":"string"},{"name":"location","type":"FileLocation"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"bytes","type":"bytes"}],"type":"PhotoSize","layer":23},{"id":"2086234950","predicate":"fileLocationUnavailable","params":[{"name":"volume_id","type":"long"},{"name":"local_id","type":"int"},{"name":"secret","type":"long"}],"type":"FileLocation","layer":23},{"id":"1406570614","predicate":"fileLocation","params":[{"name":"dc_id","type":"int"},{"name":"volume_id","type":"long"},{"name":"local_id","type":"int"},{"name":"secret","type":"long"}],"type":"FileLocation","layer":23},{"id":"-90853155","predicate":"decryptedMessageMediaExternalDocument","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"mime_type","type":"string"},{"name":"size","type":"int"},{"name":"thumb","type":"PhotoSize"},{"name":"dc_id","type":"int"},{"name":"attributes","type":"Vector"}],"type":"DecryptedMessageMedia","layer":23},{"id":"-1148011883","predicate":"messageEntityUnknown","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity","layer":45},{"id":"-100378723","predicate":"messageEntityMention","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity","layer":45},{"id":"1868782349","predicate":"messageEntityHashtag","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity","layer":45},{"id":"1827637959","predicate":"messageEntityBotCommand","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity","layer":45},{"id":"1859134776","predicate":"messageEntityUrl","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity","layer":45},{"id":"1692693954","predicate":"messageEntityEmail","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity","layer":45},{"id":"-1117713463","predicate":"messageEntityBold","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity","layer":45},{"id":"-2106619040","predicate":"messageEntityItalic","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity","layer":45},{"id":"681706865","predicate":"messageEntityCode","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity","layer":45},{"id":"1938967520","predicate":"messageEntityPre","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"},{"name":"language","type":"string"}],"type":"MessageEntity","layer":45},{"id":"1990644519","predicate":"messageEntityTextUrl","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"},{"name":"url","type":"string"}],"type":"MessageEntity","layer":45},{"id":"-2044933984","predicate":"inputStickerSetShortName","params":[{"name":"short_name","type":"string"}],"type":"InputStickerSet","layer":45},{"id":"-4838507","predicate":"inputStickerSetEmpty","params":[],"type":"InputStickerSet","layer":45},{"id":"-1978796689","predicate":"decryptedMessageMediaVenue","params":[{"name":"lat","type":"double"},{"name":"long","type":"double"},{"name":"title","type":"string"},{"name":"address","type":"string"},{"name":"provider","type":"string"},{"name":"venue_id","type":"string"}],"type":"DecryptedMessageMedia","layer":45},{"id":"-452652584","predicate":"decryptedMessageMediaWebPage","params":[{"name":"url","type":"string"}],"type":"DecryptedMessageMedia","layer":45},{"id":"-1997373508","predicate":"sendMessageRecordRoundAction","params":[],"type":"SendMessageAction","layer":66},{"id":"-1150187996","predicate":"sendMessageUploadRoundAction","params":[],"type":"SendMessageAction","layer":66}],"methods":[]} \ No newline at end of file diff --git a/data/core.telegram.org/schema/end-to-end.html b/data/core.telegram.org/schema/end-to-end.html new file mode 100644 index 0000000000..19610fca4d --- /dev/null +++ b/data/core.telegram.org/schema/end-to-end.html @@ -0,0 +1,225 @@ + + + + + Current end-to-end TL-schema + + + + + + + + + + + + + +
+ +
+
+
+ +

Current end-to-end TL-schema

+ +
+

Below you will find the current end-to-end TL-schema. More details on TL »

+
+

See also: +End-to-end encryption in MTProto, Secret Chats +Detailed schema in JSON

+ +
===8===
+decryptedMessage#1f814f1f random_id:long random_bytes:bytes message:string media:DecryptedMessageMedia = DecryptedMessage;
+decryptedMessageService#aa48327d random_id:long random_bytes:bytes action:DecryptedMessageAction = DecryptedMessage;
+decryptedMessageMediaEmpty#89f5c4a = DecryptedMessageMedia;
+decryptedMessageMediaPhoto#32798a8c thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaVideo#4cee6ef3 thumb:bytes thumb_w:int thumb_h:int duration:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaGeoPoint#35480a59 lat:double long:double = DecryptedMessageMedia;
+decryptedMessageMediaContact#588a0a97 phone_number:string first_name:string last_name:string user_id:int = DecryptedMessageMedia;
+decryptedMessageActionSetMessageTTL#a1733aec ttl_seconds:int = DecryptedMessageAction;
+decryptedMessageMediaDocument#b095434b thumb:bytes thumb_w:int thumb_h:int file_name:string mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaAudio#6080758f duration:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageActionReadMessages#c4f40be random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionDeleteMessages#65614304 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionScreenshotMessages#8ac1f475 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionFlushHistory#6719e45c = DecryptedMessageAction;
+
+===17===
+decryptedMessage#204d3878 random_id:long ttl:int message:string media:DecryptedMessageMedia = DecryptedMessage;
+decryptedMessageService#73164160 random_id:long action:DecryptedMessageAction = DecryptedMessage;
+decryptedMessageMediaVideo#524a415d thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaAudio#57e0a9cb duration:int mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageLayer#1be31789 random_bytes:bytes layer:int in_seq_no:int out_seq_no:int message:DecryptedMessage = DecryptedMessageLayer;
+sendMessageTypingAction#16bf744e = SendMessageAction;
+sendMessageCancelAction#fd5ec8f5 = SendMessageAction;
+sendMessageRecordVideoAction#a187d66f = SendMessageAction;
+sendMessageUploadVideoAction#92042ff7 = SendMessageAction;
+sendMessageRecordAudioAction#d52f73f7 = SendMessageAction;
+sendMessageUploadAudioAction#e6ac8a6f = SendMessageAction;
+sendMessageUploadPhotoAction#990a3c1a = SendMessageAction;
+sendMessageUploadDocumentAction#8faee98e = SendMessageAction;
+sendMessageGeoLocationAction#176f8ba1 = SendMessageAction;
+sendMessageChooseContactAction#628cbc6f = SendMessageAction;
+decryptedMessageActionResend#511110b0 start_seq_no:int end_seq_no:int = DecryptedMessageAction;
+decryptedMessageActionNotifyLayer#f3048883 layer:int = DecryptedMessageAction;
+decryptedMessageActionTyping#ccb27641 action:SendMessageAction = DecryptedMessageAction;
+
+===20===
+decryptedMessageActionRequestKey#f3c9611b exchange_id:long g_a:bytes = DecryptedMessageAction;
+decryptedMessageActionAcceptKey#6fe1735b exchange_id:long g_b:bytes key_fingerprint:long = DecryptedMessageAction;
+decryptedMessageActionAbortKey#dd05ec6b exchange_id:long = DecryptedMessageAction;
+decryptedMessageActionCommitKey#ec2e0b9b exchange_id:long key_fingerprint:long = DecryptedMessageAction;
+decryptedMessageActionNoop#a82fdd63 = DecryptedMessageAction;
+
+===23===
+documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
+documentAttributeAnimated#11b58939 = DocumentAttribute;
+documentAttributeSticker#fb0a5727 = DocumentAttribute;
+documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute;
+documentAttributeAudio#51448e5 duration:int = DocumentAttribute;
+documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
+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;
+fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation;
+fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
+decryptedMessageMediaExternalDocument#fa95b0dd id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector<DocumentAttribute> = DecryptedMessageMedia;
+
+===45===
+decryptedMessage#36b091de flags:# random_id:long ttl:int message:string media:flags.9?DecryptedMessageMedia entities:flags.7?Vector<MessageEntity> via_bot_name:flags.11?string reply_to_random_id:flags.3?long = DecryptedMessage;
+decryptedMessageMediaPhoto#f1fa8d78 thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes caption:string = DecryptedMessageMedia;
+decryptedMessageMediaVideo#970c8c0e thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes caption:string = DecryptedMessageMedia;
+decryptedMessageMediaDocument#7afe8ae2 thumb:bytes thumb_w:int thumb_h:int mime_type:string size:int key:bytes iv:bytes attributes:Vector<DocumentAttribute> caption:string = DecryptedMessageMedia;
+documentAttributeSticker#3a556302 alt:string stickerset:InputStickerSet = DocumentAttribute;
+documentAttributeAudio#ded218e0 duration:int title:string performer:string = DocumentAttribute;
+messageEntityUnknown#bb92ba95 offset:int length:int = MessageEntity;
+messageEntityMention#fa04579d offset:int length:int = MessageEntity;
+messageEntityHashtag#6f635b0d offset:int length:int = MessageEntity;
+messageEntityBotCommand#6cef8ac7 offset:int length:int = MessageEntity;
+messageEntityUrl#6ed02538 offset:int length:int = MessageEntity;
+messageEntityEmail#64e475c2 offset:int length:int = MessageEntity;
+messageEntityBold#bd610bc9 offset:int length:int = MessageEntity;
+messageEntityItalic#826f8b60 offset:int length:int = MessageEntity;
+messageEntityCode#28a20571 offset:int length:int = MessageEntity;
+messageEntityPre#73924be0 offset:int length:int language:string = MessageEntity;
+messageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity;
+inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
+inputStickerSetEmpty#ffb62b95 = InputStickerSet;
+decryptedMessageMediaVenue#8a0df56f lat:double long:double title:string address:string provider:string venue_id:string = DecryptedMessageMedia;
+decryptedMessageMediaWebPage#e50511d8 url:string = DecryptedMessageMedia;
+
+===46===
+documentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;
+
+===66===
+documentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true duration:int w:int h:int = DocumentAttribute;
+sendMessageRecordRoundAction#88f27fbc = SendMessageAction;
+sendMessageUploadRoundAction#bb718624 = SendMessageAction;
+
+===73===
+decryptedMessage#91cc4674 flags:# no_webpage:flags.1?true silent:flags.5?true random_id:long ttl:int message:string media:flags.9?DecryptedMessageMedia entities:flags.7?Vector<MessageEntity> via_bot_name:flags.11?string reply_to_random_id:flags.3?long grouped_id:flags.17?long = DecryptedMessage;
+
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/schema/json.html b/data/core.telegram.org/schema/json.html new file mode 100644 index 0000000000..f4a326f472 --- /dev/null +++ b/data/core.telegram.org/schema/json.html @@ -0,0 +1 @@ +{"constructors":[{"id":"-1132882121","predicate":"boolFalse","params":[],"type":"Bool"},{"id":"-1720552011","predicate":"boolTrue","params":[],"type":"Bool"},{"id":"1072550713","predicate":"true","params":[],"type":"True"},{"id":"481674261","predicate":"vector","params":[],"type":"Vector t"},{"id":"-994444869","predicate":"error","params":[{"name":"code","type":"int"},{"name":"text","type":"string"}],"type":"Error"},{"id":"1450380236","predicate":"null","params":[],"type":"Null"},{"id":"2134579434","predicate":"inputPeerEmpty","params":[],"type":"InputPeer"},{"id":"2107670217","predicate":"inputPeerSelf","params":[],"type":"InputPeer"},{"id":"396093539","predicate":"inputPeerChat","params":[{"name":"chat_id","type":"int"}],"type":"InputPeer"},{"id":"-1182234929","predicate":"inputUserEmpty","params":[],"type":"InputUser"},{"id":"-138301121","predicate":"inputUserSelf","params":[],"type":"InputUser"},{"id":"-208488460","predicate":"inputPhoneContact","params":[{"name":"client_id","type":"long"},{"name":"phone","type":"string"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"}],"type":"InputContact"},{"id":"-181407105","predicate":"inputFile","params":[{"name":"id","type":"long"},{"name":"parts","type":"int"},{"name":"name","type":"string"},{"name":"md5_checksum","type":"string"}],"type":"InputFile"},{"id":"-1771768449","predicate":"inputMediaEmpty","params":[],"type":"InputMedia"},{"id":"505969924","predicate":"inputMediaUploadedPhoto","params":[{"name":"flags","type":"#"},{"name":"file","type":"InputFile"},{"name":"stickers","type":"flags.0?Vector"},{"name":"ttl_seconds","type":"flags.1?int"}],"type":"InputMedia"},{"id":"-1279654347","predicate":"inputMediaPhoto","params":[{"name":"flags","type":"#"},{"name":"id","type":"InputPhoto"},{"name":"ttl_seconds","type":"flags.0?int"}],"type":"InputMedia"},{"id":"-104578748","predicate":"inputMediaGeoPoint","params":[{"name":"geo_point","type":"InputGeoPoint"}],"type":"InputMedia"},{"id":"-122978821","predicate":"inputMediaContact","params":[{"name":"phone_number","type":"string"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"vcard","type":"string"}],"type":"InputMedia"},{"id":"480546647","predicate":"inputChatPhotoEmpty","params":[],"type":"InputChatPhoto"},{"id":"-968723890","predicate":"inputChatUploadedPhoto","params":[{"name":"flags","type":"#"},{"name":"file","type":"flags.0?InputFile"},{"name":"video","type":"flags.1?InputFile"},{"name":"video_start_ts","type":"flags.2?double"}],"type":"InputChatPhoto"},{"id":"-1991004873","predicate":"inputChatPhoto","params":[{"name":"id","type":"InputPhoto"}],"type":"InputChatPhoto"},{"id":"-457104426","predicate":"inputGeoPointEmpty","params":[],"type":"InputGeoPoint"},{"id":"1210199983","predicate":"inputGeoPoint","params":[{"name":"flags","type":"#"},{"name":"lat","type":"double"},{"name":"long","type":"double"},{"name":"accuracy_radius","type":"flags.0?int"}],"type":"InputGeoPoint"},{"id":"483901197","predicate":"inputPhotoEmpty","params":[],"type":"InputPhoto"},{"id":"1001634122","predicate":"inputPhoto","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"file_reference","type":"bytes"}],"type":"InputPhoto"},{"id":"-539317279","predicate":"inputFileLocation","params":[{"name":"volume_id","type":"long"},{"name":"local_id","type":"int"},{"name":"secret","type":"long"},{"name":"file_reference","type":"bytes"}],"type":"InputFileLocation"},{"id":"-1649296275","predicate":"peerUser","params":[{"name":"user_id","type":"int"}],"type":"Peer"},{"id":"-1160714821","predicate":"peerChat","params":[{"name":"chat_id","type":"int"}],"type":"Peer"},{"id":"-1432995067","predicate":"storage.fileUnknown","params":[],"type":"storage.FileType"},{"id":"1086091090","predicate":"storage.filePartial","params":[],"type":"storage.FileType"},{"id":"8322574","predicate":"storage.fileJpeg","params":[],"type":"storage.FileType"},{"id":"-891180321","predicate":"storage.fileGif","params":[],"type":"storage.FileType"},{"id":"172975040","predicate":"storage.filePng","params":[],"type":"storage.FileType"},{"id":"-1373745011","predicate":"storage.filePdf","params":[],"type":"storage.FileType"},{"id":"1384777335","predicate":"storage.fileMp3","params":[],"type":"storage.FileType"},{"id":"1258941372","predicate":"storage.fileMov","params":[],"type":"storage.FileType"},{"id":"-1278304028","predicate":"storage.fileMp4","params":[],"type":"storage.FileType"},{"id":"276907596","predicate":"storage.fileWebp","params":[],"type":"storage.FileType"},{"id":"537022650","predicate":"userEmpty","params":[{"name":"id","type":"int"}],"type":"User"},{"id":"1326562017","predicate":"userProfilePhotoEmpty","params":[],"type":"UserProfilePhoto"},{"id":"1775479590","predicate":"userProfilePhoto","params":[{"name":"flags","type":"#"},{"name":"has_video","type":"flags.0?true"},{"name":"photo_id","type":"long"},{"name":"photo_small","type":"FileLocation"},{"name":"photo_big","type":"FileLocation"},{"name":"dc_id","type":"int"}],"type":"UserProfilePhoto"},{"id":"164646985","predicate":"userStatusEmpty","params":[],"type":"UserStatus"},{"id":"-306628279","predicate":"userStatusOnline","params":[{"name":"expires","type":"int"}],"type":"UserStatus"},{"id":"9203775","predicate":"userStatusOffline","params":[{"name":"was_online","type":"int"}],"type":"UserStatus"},{"id":"-1683826688","predicate":"chatEmpty","params":[{"name":"id","type":"int"}],"type":"Chat"},{"id":"1004149726","predicate":"chat","params":[{"name":"flags","type":"#"},{"name":"creator","type":"flags.0?true"},{"name":"kicked","type":"flags.1?true"},{"name":"left","type":"flags.2?true"},{"name":"deactivated","type":"flags.5?true"},{"name":"call_active","type":"flags.23?true"},{"name":"call_not_empty","type":"flags.24?true"},{"name":"id","type":"int"},{"name":"title","type":"string"},{"name":"photo","type":"ChatPhoto"},{"name":"participants_count","type":"int"},{"name":"date","type":"int"},{"name":"version","type":"int"},{"name":"migrated_to","type":"flags.6?InputChannel"},{"name":"admin_rights","type":"flags.14?ChatAdminRights"},{"name":"default_banned_rights","type":"flags.18?ChatBannedRights"}],"type":"Chat"},{"id":"120753115","predicate":"chatForbidden","params":[{"name":"id","type":"int"},{"name":"title","type":"string"}],"type":"Chat"},{"id":"461151667","predicate":"chatFull","params":[{"name":"flags","type":"#"},{"name":"can_set_username","type":"flags.7?true"},{"name":"has_scheduled","type":"flags.8?true"},{"name":"id","type":"int"},{"name":"about","type":"string"},{"name":"participants","type":"ChatParticipants"},{"name":"chat_photo","type":"flags.2?Photo"},{"name":"notify_settings","type":"PeerNotifySettings"},{"name":"exported_invite","type":"ExportedChatInvite"},{"name":"bot_info","type":"flags.3?Vector"},{"name":"pinned_msg_id","type":"flags.6?int"},{"name":"folder_id","type":"flags.11?int"}],"type":"ChatFull"},{"id":"-925415106","predicate":"chatParticipant","params":[{"name":"user_id","type":"int"},{"name":"inviter_id","type":"int"},{"name":"date","type":"int"}],"type":"ChatParticipant"},{"id":"-57668565","predicate":"chatParticipantsForbidden","params":[{"name":"flags","type":"#"},{"name":"chat_id","type":"int"},{"name":"self_participant","type":"flags.0?ChatParticipant"}],"type":"ChatParticipants"},{"id":"1061556205","predicate":"chatParticipants","params":[{"name":"chat_id","type":"int"},{"name":"participants","type":"Vector"},{"name":"version","type":"int"}],"type":"ChatParticipants"},{"id":"935395612","predicate":"chatPhotoEmpty","params":[],"type":"ChatPhoto"},{"id":"-770990276","predicate":"chatPhoto","params":[{"name":"flags","type":"#"},{"name":"has_video","type":"flags.0?true"},{"name":"photo_small","type":"FileLocation"},{"name":"photo_big","type":"FileLocation"},{"name":"dc_id","type":"int"}],"type":"ChatPhoto"},{"id":"-2082087340","predicate":"messageEmpty","params":[{"name":"id","type":"int"}],"type":"Message"},{"id":"1487813065","predicate":"message","params":[{"name":"flags","type":"#"},{"name":"out","type":"flags.1?true"},{"name":"mentioned","type":"flags.4?true"},{"name":"media_unread","type":"flags.5?true"},{"name":"silent","type":"flags.13?true"},{"name":"post","type":"flags.14?true"},{"name":"from_scheduled","type":"flags.18?true"},{"name":"legacy","type":"flags.19?true"},{"name":"edit_hide","type":"flags.21?true"},{"name":"pinned","type":"flags.24?true"},{"name":"id","type":"int"},{"name":"from_id","type":"flags.8?Peer"},{"name":"peer_id","type":"Peer"},{"name":"fwd_from","type":"flags.2?MessageFwdHeader"},{"name":"via_bot_id","type":"flags.11?int"},{"name":"reply_to","type":"flags.3?MessageReplyHeader"},{"name":"date","type":"int"},{"name":"message","type":"string"},{"name":"media","type":"flags.9?MessageMedia"},{"name":"reply_markup","type":"flags.6?ReplyMarkup"},{"name":"entities","type":"flags.7?Vector"},{"name":"views","type":"flags.10?int"},{"name":"forwards","type":"flags.10?int"},{"name":"replies","type":"flags.23?MessageReplies"},{"name":"edit_date","type":"flags.15?int"},{"name":"post_author","type":"flags.16?string"},{"name":"grouped_id","type":"flags.17?long"},{"name":"restriction_reason","type":"flags.22?Vector"}],"type":"Message"},{"id":"678405636","predicate":"messageService","params":[{"name":"flags","type":"#"},{"name":"out","type":"flags.1?true"},{"name":"mentioned","type":"flags.4?true"},{"name":"media_unread","type":"flags.5?true"},{"name":"silent","type":"flags.13?true"},{"name":"post","type":"flags.14?true"},{"name":"legacy","type":"flags.19?true"},{"name":"id","type":"int"},{"name":"from_id","type":"flags.8?Peer"},{"name":"peer_id","type":"Peer"},{"name":"reply_to","type":"flags.3?MessageReplyHeader"},{"name":"date","type":"int"},{"name":"action","type":"MessageAction"}],"type":"Message"},{"id":"1038967584","predicate":"messageMediaEmpty","params":[],"type":"MessageMedia"},{"id":"1766936791","predicate":"messageMediaPhoto","params":[{"name":"flags","type":"#"},{"name":"photo","type":"flags.0?Photo"},{"name":"ttl_seconds","type":"flags.2?int"}],"type":"MessageMedia"},{"id":"1457575028","predicate":"messageMediaGeo","params":[{"name":"geo","type":"GeoPoint"}],"type":"MessageMedia"},{"id":"-873313984","predicate":"messageMediaContact","params":[{"name":"phone_number","type":"string"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"vcard","type":"string"},{"name":"user_id","type":"int"}],"type":"MessageMedia"},{"id":"-1618676578","predicate":"messageMediaUnsupported","params":[],"type":"MessageMedia"},{"id":"-1230047312","predicate":"messageActionEmpty","params":[],"type":"MessageAction"},{"id":"-1503425638","predicate":"messageActionChatCreate","params":[{"name":"title","type":"string"},{"name":"users","type":"Vector"}],"type":"MessageAction"},{"id":"-1247687078","predicate":"messageActionChatEditTitle","params":[{"name":"title","type":"string"}],"type":"MessageAction"},{"id":"2144015272","predicate":"messageActionChatEditPhoto","params":[{"name":"photo","type":"Photo"}],"type":"MessageAction"},{"id":"-1780220945","predicate":"messageActionChatDeletePhoto","params":[],"type":"MessageAction"},{"id":"1217033015","predicate":"messageActionChatAddUser","params":[{"name":"users","type":"Vector"}],"type":"MessageAction"},{"id":"-1297179892","predicate":"messageActionChatDeleteUser","params":[{"name":"user_id","type":"int"}],"type":"MessageAction"},{"id":"739712882","predicate":"dialog","params":[{"name":"flags","type":"#"},{"name":"pinned","type":"flags.2?true"},{"name":"unread_mark","type":"flags.3?true"},{"name":"peer","type":"Peer"},{"name":"top_message","type":"int"},{"name":"read_inbox_max_id","type":"int"},{"name":"read_outbox_max_id","type":"int"},{"name":"unread_count","type":"int"},{"name":"unread_mentions_count","type":"int"},{"name":"notify_settings","type":"PeerNotifySettings"},{"name":"pts","type":"flags.0?int"},{"name":"draft","type":"flags.1?DraftMessage"},{"name":"folder_id","type":"flags.4?int"}],"type":"Dialog"},{"id":"590459437","predicate":"photoEmpty","params":[{"name":"id","type":"long"}],"type":"Photo"},{"id":"-82216347","predicate":"photo","params":[{"name":"flags","type":"#"},{"name":"has_stickers","type":"flags.0?true"},{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"file_reference","type":"bytes"},{"name":"date","type":"int"},{"name":"sizes","type":"Vector"},{"name":"video_sizes","type":"flags.1?Vector"},{"name":"dc_id","type":"int"}],"type":"Photo"},{"id":"236446268","predicate":"photoSizeEmpty","params":[{"name":"type","type":"string"}],"type":"PhotoSize"},{"id":"2009052699","predicate":"photoSize","params":[{"name":"type","type":"string"},{"name":"location","type":"FileLocation"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"size","type":"int"}],"type":"PhotoSize"},{"id":"-374917894","predicate":"photoCachedSize","params":[{"name":"type","type":"string"},{"name":"location","type":"FileLocation"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"bytes","type":"bytes"}],"type":"PhotoSize"},{"id":"286776671","predicate":"geoPointEmpty","params":[],"type":"GeoPoint"},{"id":"-1297942941","predicate":"geoPoint","params":[{"name":"flags","type":"#"},{"name":"long","type":"double"},{"name":"lat","type":"double"},{"name":"access_hash","type":"long"},{"name":"accuracy_radius","type":"flags.0?int"}],"type":"GeoPoint"},{"id":"1577067778","predicate":"auth.sentCode","params":[{"name":"flags","type":"#"},{"name":"type","type":"auth.SentCodeType"},{"name":"phone_code_hash","type":"string"},{"name":"next_type","type":"flags.1?auth.CodeType"},{"name":"timeout","type":"flags.2?int"}],"type":"auth.SentCode"},{"id":"-855308010","predicate":"auth.authorization","params":[{"name":"flags","type":"#"},{"name":"tmp_sessions","type":"flags.0?int"},{"name":"user","type":"User"}],"type":"auth.Authorization"},{"id":"-543777747","predicate":"auth.exportedAuthorization","params":[{"name":"id","type":"int"},{"name":"bytes","type":"bytes"}],"type":"auth.ExportedAuthorization"},{"id":"-1195615476","predicate":"inputNotifyPeer","params":[{"name":"peer","type":"InputPeer"}],"type":"InputNotifyPeer"},{"id":"423314455","predicate":"inputNotifyUsers","params":[],"type":"InputNotifyPeer"},{"id":"1251338318","predicate":"inputNotifyChats","params":[],"type":"InputNotifyPeer"},{"id":"-1673717362","predicate":"inputPeerNotifySettings","params":[{"name":"flags","type":"#"},{"name":"show_previews","type":"flags.0?Bool"},{"name":"silent","type":"flags.1?Bool"},{"name":"mute_until","type":"flags.2?int"},{"name":"sound","type":"flags.3?string"}],"type":"InputPeerNotifySettings"},{"id":"-1353671392","predicate":"peerNotifySettings","params":[{"name":"flags","type":"#"},{"name":"show_previews","type":"flags.0?Bool"},{"name":"silent","type":"flags.1?Bool"},{"name":"mute_until","type":"flags.2?int"},{"name":"sound","type":"flags.3?string"}],"type":"PeerNotifySettings"},{"id":"1933519201","predicate":"peerSettings","params":[{"name":"flags","type":"#"},{"name":"report_spam","type":"flags.0?true"},{"name":"add_contact","type":"flags.1?true"},{"name":"block_contact","type":"flags.2?true"},{"name":"share_contact","type":"flags.3?true"},{"name":"need_contacts_exception","type":"flags.4?true"},{"name":"report_geo","type":"flags.5?true"},{"name":"autoarchived","type":"flags.7?true"},{"name":"invite_members","type":"flags.8?true"},{"name":"geo_distance","type":"flags.6?int"}],"type":"PeerSettings"},{"id":"-1539849235","predicate":"wallPaper","params":[{"name":"id","type":"long"},{"name":"flags","type":"#"},{"name":"creator","type":"flags.0?true"},{"name":"default","type":"flags.1?true"},{"name":"pattern","type":"flags.3?true"},{"name":"dark","type":"flags.4?true"},{"name":"access_hash","type":"long"},{"name":"slug","type":"string"},{"name":"document","type":"Document"},{"name":"settings","type":"flags.2?WallPaperSettings"}],"type":"WallPaper"},{"id":"1490799288","predicate":"inputReportReasonSpam","params":[],"type":"ReportReason"},{"id":"505595789","predicate":"inputReportReasonViolence","params":[],"type":"ReportReason"},{"id":"777640226","predicate":"inputReportReasonPornography","params":[],"type":"ReportReason"},{"id":"-1376497949","predicate":"inputReportReasonChildAbuse","params":[],"type":"ReportReason"},{"id":"-512463606","predicate":"inputReportReasonOther","params":[{"name":"text","type":"string"}],"type":"ReportReason"},{"id":"-302941166","predicate":"userFull","params":[{"name":"flags","type":"#"},{"name":"blocked","type":"flags.0?true"},{"name":"phone_calls_available","type":"flags.4?true"},{"name":"phone_calls_private","type":"flags.5?true"},{"name":"can_pin_message","type":"flags.7?true"},{"name":"has_scheduled","type":"flags.12?true"},{"name":"video_calls_available","type":"flags.13?true"},{"name":"user","type":"User"},{"name":"about","type":"flags.1?string"},{"name":"settings","type":"PeerSettings"},{"name":"profile_photo","type":"flags.2?Photo"},{"name":"notify_settings","type":"PeerNotifySettings"},{"name":"bot_info","type":"flags.3?BotInfo"},{"name":"pinned_msg_id","type":"flags.6?int"},{"name":"common_chats_count","type":"int"},{"name":"folder_id","type":"flags.11?int"}],"type":"UserFull"},{"id":"-116274796","predicate":"contact","params":[{"name":"user_id","type":"int"},{"name":"mutual","type":"Bool"}],"type":"Contact"},{"id":"-805141448","predicate":"importedContact","params":[{"name":"user_id","type":"int"},{"name":"client_id","type":"long"}],"type":"ImportedContact"},{"id":"-748155807","predicate":"contactStatus","params":[{"name":"user_id","type":"int"},{"name":"status","type":"UserStatus"}],"type":"ContactStatus"},{"id":"-1219778094","predicate":"contacts.contactsNotModified","params":[],"type":"contacts.Contacts"},{"id":"-353862078","predicate":"contacts.contacts","params":[{"name":"contacts","type":"Vector"},{"name":"saved_count","type":"int"},{"name":"users","type":"Vector"}],"type":"contacts.Contacts"},{"id":"2010127419","predicate":"contacts.importedContacts","params":[{"name":"imported","type":"Vector"},{"name":"popular_invites","type":"Vector"},{"name":"retry_contacts","type":"Vector"},{"name":"users","type":"Vector"}],"type":"contacts.ImportedContacts"},{"id":"182326673","predicate":"contacts.blocked","params":[{"name":"blocked","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"contacts.Blocked"},{"id":"-513392236","predicate":"contacts.blockedSlice","params":[{"name":"count","type":"int"},{"name":"blocked","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"contacts.Blocked"},{"id":"364538944","predicate":"messages.dialogs","params":[{"name":"dialogs","type":"Vector"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Dialogs"},{"id":"1910543603","predicate":"messages.dialogsSlice","params":[{"name":"count","type":"int"},{"name":"dialogs","type":"Vector"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Dialogs"},{"id":"-1938715001","predicate":"messages.messages","params":[{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Messages"},{"id":"978610270","predicate":"messages.messagesSlice","params":[{"name":"flags","type":"#"},{"name":"inexact","type":"flags.1?true"},{"name":"count","type":"int"},{"name":"next_rate","type":"flags.0?int"},{"name":"offset_id_offset","type":"flags.2?int"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Messages"},{"id":"1694474197","predicate":"messages.chats","params":[{"name":"chats","type":"Vector"}],"type":"messages.Chats"},{"id":"-438840932","predicate":"messages.chatFull","params":[{"name":"full_chat","type":"ChatFull"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.ChatFull"},{"id":"-1269012015","predicate":"messages.affectedHistory","params":[{"name":"pts","type":"int"},{"name":"pts_count","type":"int"},{"name":"offset","type":"int"}],"type":"messages.AffectedHistory"},{"id":"1474492012","predicate":"inputMessagesFilterEmpty","params":[],"type":"MessagesFilter"},{"id":"-1777752804","predicate":"inputMessagesFilterPhotos","params":[],"type":"MessagesFilter"},{"id":"-1614803355","predicate":"inputMessagesFilterVideo","params":[],"type":"MessagesFilter"},{"id":"1458172132","predicate":"inputMessagesFilterPhotoVideo","params":[],"type":"MessagesFilter"},{"id":"-1629621880","predicate":"inputMessagesFilterDocument","params":[],"type":"MessagesFilter"},{"id":"2129714567","predicate":"inputMessagesFilterUrl","params":[],"type":"MessagesFilter"},{"id":"-3644025","predicate":"inputMessagesFilterGif","params":[],"type":"MessagesFilter"},{"id":"522914557","predicate":"updateNewMessage","params":[{"name":"message","type":"Message"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"}],"type":"Update"},{"id":"1318109142","predicate":"updateMessageID","params":[{"name":"id","type":"int"},{"name":"random_id","type":"long"}],"type":"Update"},{"id":"-1576161051","predicate":"updateDeleteMessages","params":[{"name":"messages","type":"Vector"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"}],"type":"Update"},{"id":"1548249383","predicate":"updateUserTyping","params":[{"name":"user_id","type":"int"},{"name":"action","type":"SendMessageAction"}],"type":"Update"},{"id":"-1704596961","predicate":"updateChatUserTyping","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"int"},{"name":"action","type":"SendMessageAction"}],"type":"Update"},{"id":"125178264","predicate":"updateChatParticipants","params":[{"name":"participants","type":"ChatParticipants"}],"type":"Update"},{"id":"469489699","predicate":"updateUserStatus","params":[{"name":"user_id","type":"int"},{"name":"status","type":"UserStatus"}],"type":"Update"},{"id":"-1489818765","predicate":"updateUserName","params":[{"name":"user_id","type":"int"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"username","type":"string"}],"type":"Update"},{"id":"-1791935732","predicate":"updateUserPhoto","params":[{"name":"user_id","type":"int"},{"name":"date","type":"int"},{"name":"photo","type":"UserProfilePhoto"},{"name":"previous","type":"Bool"}],"type":"Update"},{"id":"-1519637954","predicate":"updates.state","params":[{"name":"pts","type":"int"},{"name":"qts","type":"int"},{"name":"date","type":"int"},{"name":"seq","type":"int"},{"name":"unread_count","type":"int"}],"type":"updates.State"},{"id":"1567990072","predicate":"updates.differenceEmpty","params":[{"name":"date","type":"int"},{"name":"seq","type":"int"}],"type":"updates.Difference"},{"id":"16030880","predicate":"updates.difference","params":[{"name":"new_messages","type":"Vector"},{"name":"new_encrypted_messages","type":"Vector"},{"name":"other_updates","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"state","type":"updates.State"}],"type":"updates.Difference"},{"id":"-1459938943","predicate":"updates.differenceSlice","params":[{"name":"new_messages","type":"Vector"},{"name":"new_encrypted_messages","type":"Vector"},{"name":"other_updates","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"intermediate_state","type":"updates.State"}],"type":"updates.Difference"},{"id":"-484987010","predicate":"updatesTooLong","params":[],"type":"Updates"},{"id":"580309704","predicate":"updateShortMessage","params":[{"name":"flags","type":"#"},{"name":"out","type":"flags.1?true"},{"name":"mentioned","type":"flags.4?true"},{"name":"media_unread","type":"flags.5?true"},{"name":"silent","type":"flags.13?true"},{"name":"id","type":"int"},{"name":"user_id","type":"int"},{"name":"message","type":"string"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"},{"name":"date","type":"int"},{"name":"fwd_from","type":"flags.2?MessageFwdHeader"},{"name":"via_bot_id","type":"flags.11?int"},{"name":"reply_to","type":"flags.3?MessageReplyHeader"},{"name":"entities","type":"flags.7?Vector"}],"type":"Updates"},{"id":"1076714939","predicate":"updateShortChatMessage","params":[{"name":"flags","type":"#"},{"name":"out","type":"flags.1?true"},{"name":"mentioned","type":"flags.4?true"},{"name":"media_unread","type":"flags.5?true"},{"name":"silent","type":"flags.13?true"},{"name":"id","type":"int"},{"name":"from_id","type":"int"},{"name":"chat_id","type":"int"},{"name":"message","type":"string"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"},{"name":"date","type":"int"},{"name":"fwd_from","type":"flags.2?MessageFwdHeader"},{"name":"via_bot_id","type":"flags.11?int"},{"name":"reply_to","type":"flags.3?MessageReplyHeader"},{"name":"entities","type":"flags.7?Vector"}],"type":"Updates"},{"id":"2027216577","predicate":"updateShort","params":[{"name":"update","type":"Update"},{"name":"date","type":"int"}],"type":"Updates"},{"id":"1918567619","predicate":"updatesCombined","params":[{"name":"updates","type":"Vector"},{"name":"users","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"date","type":"int"},{"name":"seq_start","type":"int"},{"name":"seq","type":"int"}],"type":"Updates"},{"id":"1957577280","predicate":"updates","params":[{"name":"updates","type":"Vector"},{"name":"users","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"date","type":"int"},{"name":"seq","type":"int"}],"type":"Updates"},{"id":"-1916114267","predicate":"photos.photos","params":[{"name":"photos","type":"Vector"},{"name":"users","type":"Vector"}],"type":"photos.Photos"},{"id":"352657236","predicate":"photos.photosSlice","params":[{"name":"count","type":"int"},{"name":"photos","type":"Vector"},{"name":"users","type":"Vector"}],"type":"photos.Photos"},{"id":"539045032","predicate":"photos.photo","params":[{"name":"photo","type":"Photo"},{"name":"users","type":"Vector"}],"type":"photos.Photo"},{"id":"157948117","predicate":"upload.file","params":[{"name":"type","type":"storage.FileType"},{"name":"mtime","type":"int"},{"name":"bytes","type":"bytes"}],"type":"upload.File"},{"id":"414687501","predicate":"dcOption","params":[{"name":"flags","type":"#"},{"name":"ipv6","type":"flags.0?true"},{"name":"media_only","type":"flags.1?true"},{"name":"tcpo_only","type":"flags.2?true"},{"name":"cdn","type":"flags.3?true"},{"name":"static","type":"flags.4?true"},{"name":"id","type":"int"},{"name":"ip_address","type":"string"},{"name":"port","type":"int"},{"name":"secret","type":"flags.10?bytes"}],"type":"DcOption"},{"id":"856375399","predicate":"config","params":[{"name":"flags","type":"#"},{"name":"phonecalls_enabled","type":"flags.1?true"},{"name":"default_p2p_contacts","type":"flags.3?true"},{"name":"preload_featured_stickers","type":"flags.4?true"},{"name":"ignore_phone_entities","type":"flags.5?true"},{"name":"revoke_pm_inbox","type":"flags.6?true"},{"name":"blocked_mode","type":"flags.8?true"},{"name":"pfs_enabled","type":"flags.13?true"},{"name":"date","type":"int"},{"name":"expires","type":"int"},{"name":"test_mode","type":"Bool"},{"name":"this_dc","type":"int"},{"name":"dc_options","type":"Vector"},{"name":"dc_txt_domain_name","type":"string"},{"name":"chat_size_max","type":"int"},{"name":"megagroup_size_max","type":"int"},{"name":"forwarded_count_max","type":"int"},{"name":"online_update_period_ms","type":"int"},{"name":"offline_blur_timeout_ms","type":"int"},{"name":"offline_idle_timeout_ms","type":"int"},{"name":"online_cloud_timeout_ms","type":"int"},{"name":"notify_cloud_delay_ms","type":"int"},{"name":"notify_default_delay_ms","type":"int"},{"name":"push_chat_period_ms","type":"int"},{"name":"push_chat_limit","type":"int"},{"name":"saved_gifs_limit","type":"int"},{"name":"edit_time_limit","type":"int"},{"name":"revoke_time_limit","type":"int"},{"name":"revoke_pm_time_limit","type":"int"},{"name":"rating_e_decay","type":"int"},{"name":"stickers_recent_limit","type":"int"},{"name":"stickers_faved_limit","type":"int"},{"name":"channels_read_media_period","type":"int"},{"name":"tmp_sessions","type":"flags.0?int"},{"name":"pinned_dialogs_count_max","type":"int"},{"name":"pinned_infolder_count_max","type":"int"},{"name":"call_receive_timeout_ms","type":"int"},{"name":"call_ring_timeout_ms","type":"int"},{"name":"call_connect_timeout_ms","type":"int"},{"name":"call_packet_timeout_ms","type":"int"},{"name":"me_url_prefix","type":"string"},{"name":"autoupdate_url_prefix","type":"flags.7?string"},{"name":"gif_search_username","type":"flags.9?string"},{"name":"venue_search_username","type":"flags.10?string"},{"name":"img_search_username","type":"flags.11?string"},{"name":"static_maps_provider","type":"flags.12?string"},{"name":"caption_length_max","type":"int"},{"name":"message_length_max","type":"int"},{"name":"webfile_dc_id","type":"int"},{"name":"suggested_lang_code","type":"flags.2?string"},{"name":"lang_pack_version","type":"flags.2?int"},{"name":"base_lang_pack_version","type":"flags.2?int"}],"type":"Config"},{"id":"-1910892683","predicate":"nearestDc","params":[{"name":"country","type":"string"},{"name":"this_dc","type":"int"},{"name":"nearest_dc","type":"int"}],"type":"NearestDc"},{"id":"497489295","predicate":"help.appUpdate","params":[{"name":"flags","type":"#"},{"name":"can_not_skip","type":"flags.0?true"},{"name":"id","type":"int"},{"name":"version","type":"string"},{"name":"text","type":"string"},{"name":"entities","type":"Vector"},{"name":"document","type":"flags.1?Document"},{"name":"url","type":"flags.2?string"}],"type":"help.AppUpdate"},{"id":"-1000708810","predicate":"help.noAppUpdate","params":[],"type":"help.AppUpdate"},{"id":"415997816","predicate":"help.inviteText","params":[{"name":"message","type":"string"}],"type":"help.InviteText"},{"id":"314359194","predicate":"updateNewEncryptedMessage","params":[{"name":"message","type":"EncryptedMessage"},{"name":"qts","type":"int"}],"type":"Update"},{"id":"386986326","predicate":"updateEncryptedChatTyping","params":[{"name":"chat_id","type":"int"}],"type":"Update"},{"id":"-1264392051","predicate":"updateEncryption","params":[{"name":"chat","type":"EncryptedChat"},{"name":"date","type":"int"}],"type":"Update"},{"id":"956179895","predicate":"updateEncryptedMessagesRead","params":[{"name":"chat_id","type":"int"},{"name":"max_date","type":"int"},{"name":"date","type":"int"}],"type":"Update"},{"id":"-1417756512","predicate":"encryptedChatEmpty","params":[{"name":"id","type":"int"}],"type":"EncryptedChat"},{"id":"1006044124","predicate":"encryptedChatWaiting","params":[{"name":"id","type":"int"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"admin_id","type":"int"},{"name":"participant_id","type":"int"}],"type":"EncryptedChat"},{"id":"1651608194","predicate":"encryptedChatRequested","params":[{"name":"flags","type":"#"},{"name":"folder_id","type":"flags.0?int"},{"name":"id","type":"int"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"admin_id","type":"int"},{"name":"participant_id","type":"int"},{"name":"g_a","type":"bytes"}],"type":"EncryptedChat"},{"id":"-94974410","predicate":"encryptedChat","params":[{"name":"id","type":"int"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"admin_id","type":"int"},{"name":"participant_id","type":"int"},{"name":"g_a_or_b","type":"bytes"},{"name":"key_fingerprint","type":"long"}],"type":"EncryptedChat"},{"id":"332848423","predicate":"encryptedChatDiscarded","params":[{"name":"id","type":"int"}],"type":"EncryptedChat"},{"id":"-247351839","predicate":"inputEncryptedChat","params":[{"name":"chat_id","type":"int"},{"name":"access_hash","type":"long"}],"type":"InputEncryptedChat"},{"id":"-1038136962","predicate":"encryptedFileEmpty","params":[],"type":"EncryptedFile"},{"id":"1248893260","predicate":"encryptedFile","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"size","type":"int"},{"name":"dc_id","type":"int"},{"name":"key_fingerprint","type":"int"}],"type":"EncryptedFile"},{"id":"406307684","predicate":"inputEncryptedFileEmpty","params":[],"type":"InputEncryptedFile"},{"id":"1690108678","predicate":"inputEncryptedFileUploaded","params":[{"name":"id","type":"long"},{"name":"parts","type":"int"},{"name":"md5_checksum","type":"string"},{"name":"key_fingerprint","type":"int"}],"type":"InputEncryptedFile"},{"id":"1511503333","predicate":"inputEncryptedFile","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputEncryptedFile"},{"id":"-182231723","predicate":"inputEncryptedFileLocation","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputFileLocation"},{"id":"-317144808","predicate":"encryptedMessage","params":[{"name":"random_id","type":"long"},{"name":"chat_id","type":"int"},{"name":"date","type":"int"},{"name":"bytes","type":"bytes"},{"name":"file","type":"EncryptedFile"}],"type":"EncryptedMessage"},{"id":"594758406","predicate":"encryptedMessageService","params":[{"name":"random_id","type":"long"},{"name":"chat_id","type":"int"},{"name":"date","type":"int"},{"name":"bytes","type":"bytes"}],"type":"EncryptedMessage"},{"id":"-1058912715","predicate":"messages.dhConfigNotModified","params":[{"name":"random","type":"bytes"}],"type":"messages.DhConfig"},{"id":"740433629","predicate":"messages.dhConfig","params":[{"name":"g","type":"int"},{"name":"p","type":"bytes"},{"name":"version","type":"int"},{"name":"random","type":"bytes"}],"type":"messages.DhConfig"},{"id":"1443858741","predicate":"messages.sentEncryptedMessage","params":[{"name":"date","type":"int"}],"type":"messages.SentEncryptedMessage"},{"id":"-1802240206","predicate":"messages.sentEncryptedFile","params":[{"name":"date","type":"int"},{"name":"file","type":"EncryptedFile"}],"type":"messages.SentEncryptedMessage"},{"id":"-95482955","predicate":"inputFileBig","params":[{"name":"id","type":"long"},{"name":"parts","type":"int"},{"name":"name","type":"string"}],"type":"InputFile"},{"id":"767652808","predicate":"inputEncryptedFileBigUploaded","params":[{"name":"id","type":"long"},{"name":"parts","type":"int"},{"name":"key_fingerprint","type":"int"}],"type":"InputEncryptedFile"},{"id":"-364179876","predicate":"updateChatParticipantAdd","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"int"},{"name":"inviter_id","type":"int"},{"name":"date","type":"int"},{"name":"version","type":"int"}],"type":"Update"},{"id":"1851755554","predicate":"updateChatParticipantDelete","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"int"},{"name":"version","type":"int"}],"type":"Update"},{"id":"-1906403213","predicate":"updateDcOptions","params":[{"name":"dc_options","type":"Vector"}],"type":"Update"},{"id":"1530447553","predicate":"inputMediaUploadedDocument","params":[{"name":"flags","type":"#"},{"name":"nosound_video","type":"flags.3?true"},{"name":"force_file","type":"flags.4?true"},{"name":"file","type":"InputFile"},{"name":"thumb","type":"flags.2?InputFile"},{"name":"mime_type","type":"string"},{"name":"attributes","type":"Vector"},{"name":"stickers","type":"flags.0?Vector"},{"name":"ttl_seconds","type":"flags.1?int"}],"type":"InputMedia"},{"id":"598418386","predicate":"inputMediaDocument","params":[{"name":"flags","type":"#"},{"name":"id","type":"InputDocument"},{"name":"ttl_seconds","type":"flags.0?int"}],"type":"InputMedia"},{"id":"-1666158377","predicate":"messageMediaDocument","params":[{"name":"flags","type":"#"},{"name":"document","type":"flags.0?Document"},{"name":"ttl_seconds","type":"flags.2?int"}],"type":"MessageMedia"},{"id":"1928391342","predicate":"inputDocumentEmpty","params":[],"type":"InputDocument"},{"id":"448771445","predicate":"inputDocument","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"file_reference","type":"bytes"}],"type":"InputDocument"},{"id":"-1160743548","predicate":"inputDocumentFileLocation","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"file_reference","type":"bytes"},{"name":"thumb_size","type":"string"}],"type":"InputFileLocation"},{"id":"922273905","predicate":"documentEmpty","params":[{"name":"id","type":"long"}],"type":"Document"},{"id":"512177195","predicate":"document","params":[{"name":"flags","type":"#"},{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"file_reference","type":"bytes"},{"name":"date","type":"int"},{"name":"mime_type","type":"string"},{"name":"size","type":"int"},{"name":"thumbs","type":"flags.0?Vector"},{"name":"video_thumbs","type":"flags.1?Vector"},{"name":"dc_id","type":"int"},{"name":"attributes","type":"Vector"}],"type":"Document"},{"id":"398898678","predicate":"help.support","params":[{"name":"phone_number","type":"string"},{"name":"user","type":"User"}],"type":"help.Support"},{"id":"-1613493288","predicate":"notifyPeer","params":[{"name":"peer","type":"Peer"}],"type":"NotifyPeer"},{"id":"-1261946036","predicate":"notifyUsers","params":[],"type":"NotifyPeer"},{"id":"-1073230141","predicate":"notifyChats","params":[],"type":"NotifyPeer"},{"id":"-1094555409","predicate":"updateNotifySettings","params":[{"name":"peer","type":"NotifyPeer"},{"name":"notify_settings","type":"PeerNotifySettings"}],"type":"Update"},{"id":"381645902","predicate":"sendMessageTypingAction","params":[],"type":"SendMessageAction"},{"id":"-44119819","predicate":"sendMessageCancelAction","params":[],"type":"SendMessageAction"},{"id":"-1584933265","predicate":"sendMessageRecordVideoAction","params":[],"type":"SendMessageAction"},{"id":"-378127636","predicate":"sendMessageUploadVideoAction","params":[{"name":"progress","type":"int"}],"type":"SendMessageAction"},{"id":"-718310409","predicate":"sendMessageRecordAudioAction","params":[],"type":"SendMessageAction"},{"id":"-212740181","predicate":"sendMessageUploadAudioAction","params":[{"name":"progress","type":"int"}],"type":"SendMessageAction"},{"id":"-774682074","predicate":"sendMessageUploadPhotoAction","params":[{"name":"progress","type":"int"}],"type":"SendMessageAction"},{"id":"-1441998364","predicate":"sendMessageUploadDocumentAction","params":[{"name":"progress","type":"int"}],"type":"SendMessageAction"},{"id":"393186209","predicate":"sendMessageGeoLocationAction","params":[],"type":"SendMessageAction"},{"id":"1653390447","predicate":"sendMessageChooseContactAction","params":[],"type":"SendMessageAction"},{"id":"-1290580579","predicate":"contacts.found","params":[{"name":"my_results","type":"Vector"},{"name":"results","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"contacts.Found"},{"id":"-337352679","predicate":"updateServiceNotification","params":[{"name":"flags","type":"#"},{"name":"popup","type":"flags.0?true"},{"name":"inbox_date","type":"flags.1?int"},{"name":"type","type":"string"},{"name":"message","type":"string"},{"name":"media","type":"MessageMedia"},{"name":"entities","type":"Vector"}],"type":"Update"},{"id":"-496024847","predicate":"userStatusRecently","params":[],"type":"UserStatus"},{"id":"129960444","predicate":"userStatusLastWeek","params":[],"type":"UserStatus"},{"id":"2011940674","predicate":"userStatusLastMonth","params":[],"type":"UserStatus"},{"id":"-298113238","predicate":"updatePrivacy","params":[{"name":"key","type":"PrivacyKey"},{"name":"rules","type":"Vector"}],"type":"Update"},{"id":"1335282456","predicate":"inputPrivacyKeyStatusTimestamp","params":[],"type":"InputPrivacyKey"},{"id":"-1137792208","predicate":"privacyKeyStatusTimestamp","params":[],"type":"PrivacyKey"},{"id":"218751099","predicate":"inputPrivacyValueAllowContacts","params":[],"type":"InputPrivacyRule"},{"id":"407582158","predicate":"inputPrivacyValueAllowAll","params":[],"type":"InputPrivacyRule"},{"id":"320652927","predicate":"inputPrivacyValueAllowUsers","params":[{"name":"users","type":"Vector"}],"type":"InputPrivacyRule"},{"id":"195371015","predicate":"inputPrivacyValueDisallowContacts","params":[],"type":"InputPrivacyRule"},{"id":"-697604407","predicate":"inputPrivacyValueDisallowAll","params":[],"type":"InputPrivacyRule"},{"id":"-1877932953","predicate":"inputPrivacyValueDisallowUsers","params":[{"name":"users","type":"Vector"}],"type":"InputPrivacyRule"},{"id":"-123988","predicate":"privacyValueAllowContacts","params":[],"type":"PrivacyRule"},{"id":"1698855810","predicate":"privacyValueAllowAll","params":[],"type":"PrivacyRule"},{"id":"1297858060","predicate":"privacyValueAllowUsers","params":[{"name":"users","type":"Vector"}],"type":"PrivacyRule"},{"id":"-125240806","predicate":"privacyValueDisallowContacts","params":[],"type":"PrivacyRule"},{"id":"-1955338397","predicate":"privacyValueDisallowAll","params":[],"type":"PrivacyRule"},{"id":"209668535","predicate":"privacyValueDisallowUsers","params":[{"name":"users","type":"Vector"}],"type":"PrivacyRule"},{"id":"1352683077","predicate":"account.privacyRules","params":[{"name":"rules","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"account.PrivacyRules"},{"id":"-1194283041","predicate":"accountDaysTTL","params":[{"name":"days","type":"int"}],"type":"AccountDaysTTL"},{"id":"314130811","predicate":"updateUserPhone","params":[{"name":"user_id","type":"int"},{"name":"phone","type":"string"}],"type":"Update"},{"id":"1815593308","predicate":"documentAttributeImageSize","params":[{"name":"w","type":"int"},{"name":"h","type":"int"}],"type":"DocumentAttribute"},{"id":"297109817","predicate":"documentAttributeAnimated","params":[],"type":"DocumentAttribute"},{"id":"1662637586","predicate":"documentAttributeSticker","params":[{"name":"flags","type":"#"},{"name":"mask","type":"flags.1?true"},{"name":"alt","type":"string"},{"name":"stickerset","type":"InputStickerSet"},{"name":"mask_coords","type":"flags.0?MaskCoords"}],"type":"DocumentAttribute"},{"id":"250621158","predicate":"documentAttributeVideo","params":[{"name":"flags","type":"#"},{"name":"round_message","type":"flags.0?true"},{"name":"supports_streaming","type":"flags.1?true"},{"name":"duration","type":"int"},{"name":"w","type":"int"},{"name":"h","type":"int"}],"type":"DocumentAttribute"},{"id":"-1739392570","predicate":"documentAttributeAudio","params":[{"name":"flags","type":"#"},{"name":"voice","type":"flags.10?true"},{"name":"duration","type":"int"},{"name":"title","type":"flags.0?string"},{"name":"performer","type":"flags.1?string"},{"name":"waveform","type":"flags.2?bytes"}],"type":"DocumentAttribute"},{"id":"358154344","predicate":"documentAttributeFilename","params":[{"name":"file_name","type":"string"}],"type":"DocumentAttribute"},{"id":"-244016606","predicate":"messages.stickersNotModified","params":[],"type":"messages.Stickers"},{"id":"-463889475","predicate":"messages.stickers","params":[{"name":"hash","type":"int"},{"name":"stickers","type":"Vector"}],"type":"messages.Stickers"},{"id":"313694676","predicate":"stickerPack","params":[{"name":"emoticon","type":"string"},{"name":"documents","type":"Vector"}],"type":"StickerPack"},{"id":"-395967805","predicate":"messages.allStickersNotModified","params":[],"type":"messages.AllStickers"},{"id":"-302170017","predicate":"messages.allStickers","params":[{"name":"hash","type":"int"},{"name":"sets","type":"Vector"}],"type":"messages.AllStickers"},{"id":"-1667805217","predicate":"updateReadHistoryInbox","params":[{"name":"flags","type":"#"},{"name":"folder_id","type":"flags.0?int"},{"name":"peer","type":"Peer"},{"name":"max_id","type":"int"},{"name":"still_unread_count","type":"int"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"}],"type":"Update"},{"id":"791617983","predicate":"updateReadHistoryOutbox","params":[{"name":"peer","type":"Peer"},{"name":"max_id","type":"int"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"}],"type":"Update"},{"id":"-2066640507","predicate":"messages.affectedMessages","params":[{"name":"pts","type":"int"},{"name":"pts_count","type":"int"}],"type":"messages.AffectedMessages"},{"id":"2139689491","predicate":"updateWebPage","params":[{"name":"webpage","type":"WebPage"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"}],"type":"Update"},{"id":"-350980120","predicate":"webPageEmpty","params":[{"name":"id","type":"long"}],"type":"WebPage"},{"id":"-981018084","predicate":"webPagePending","params":[{"name":"id","type":"long"},{"name":"date","type":"int"}],"type":"WebPage"},{"id":"-392411726","predicate":"webPage","params":[{"name":"flags","type":"#"},{"name":"id","type":"long"},{"name":"url","type":"string"},{"name":"display_url","type":"string"},{"name":"hash","type":"int"},{"name":"type","type":"flags.0?string"},{"name":"site_name","type":"flags.1?string"},{"name":"title","type":"flags.2?string"},{"name":"description","type":"flags.3?string"},{"name":"photo","type":"flags.4?Photo"},{"name":"embed_url","type":"flags.5?string"},{"name":"embed_type","type":"flags.5?string"},{"name":"embed_width","type":"flags.6?int"},{"name":"embed_height","type":"flags.6?int"},{"name":"duration","type":"flags.7?int"},{"name":"author","type":"flags.8?string"},{"name":"document","type":"flags.9?Document"},{"name":"cached_page","type":"flags.10?Page"},{"name":"attributes","type":"flags.12?Vector"}],"type":"WebPage"},{"id":"-1557277184","predicate":"messageMediaWebPage","params":[{"name":"webpage","type":"WebPage"}],"type":"MessageMedia"},{"id":"-1392388579","predicate":"authorization","params":[{"name":"flags","type":"#"},{"name":"current","type":"flags.0?true"},{"name":"official_app","type":"flags.1?true"},{"name":"password_pending","type":"flags.2?true"},{"name":"hash","type":"long"},{"name":"device_model","type":"string"},{"name":"platform","type":"string"},{"name":"system_version","type":"string"},{"name":"api_id","type":"int"},{"name":"app_name","type":"string"},{"name":"app_version","type":"string"},{"name":"date_created","type":"int"},{"name":"date_active","type":"int"},{"name":"ip","type":"string"},{"name":"country","type":"string"},{"name":"region","type":"string"}],"type":"Authorization"},{"id":"307276766","predicate":"account.authorizations","params":[{"name":"authorizations","type":"Vector"}],"type":"account.Authorizations"},{"id":"-1390001672","predicate":"account.password","params":[{"name":"flags","type":"#"},{"name":"has_recovery","type":"flags.0?true"},{"name":"has_secure_values","type":"flags.1?true"},{"name":"has_password","type":"flags.2?true"},{"name":"current_algo","type":"flags.2?PasswordKdfAlgo"},{"name":"srp_B","type":"flags.2?bytes"},{"name":"srp_id","type":"flags.2?long"},{"name":"hint","type":"flags.3?string"},{"name":"email_unconfirmed_pattern","type":"flags.4?string"},{"name":"new_algo","type":"PasswordKdfAlgo"},{"name":"new_secure_algo","type":"SecurePasswordKdfAlgo"},{"name":"secure_random","type":"bytes"}],"type":"account.Password"},{"id":"-1705233435","predicate":"account.passwordSettings","params":[{"name":"flags","type":"#"},{"name":"email","type":"flags.0?string"},{"name":"secure_settings","type":"flags.1?SecureSecretSettings"}],"type":"account.PasswordSettings"},{"id":"-1036572727","predicate":"account.passwordInputSettings","params":[{"name":"flags","type":"#"},{"name":"new_algo","type":"flags.0?PasswordKdfAlgo"},{"name":"new_password_hash","type":"flags.0?bytes"},{"name":"hint","type":"flags.0?string"},{"name":"email","type":"flags.1?string"},{"name":"new_secure_settings","type":"flags.2?SecureSecretSettings"}],"type":"account.PasswordInputSettings"},{"id":"326715557","predicate":"auth.passwordRecovery","params":[{"name":"email_pattern","type":"string"}],"type":"auth.PasswordRecovery"},{"id":"-1052959727","predicate":"inputMediaVenue","params":[{"name":"geo_point","type":"InputGeoPoint"},{"name":"title","type":"string"},{"name":"address","type":"string"},{"name":"provider","type":"string"},{"name":"venue_id","type":"string"},{"name":"venue_type","type":"string"}],"type":"InputMedia"},{"id":"784356159","predicate":"messageMediaVenue","params":[{"name":"geo","type":"GeoPoint"},{"name":"title","type":"string"},{"name":"address","type":"string"},{"name":"provider","type":"string"},{"name":"venue_id","type":"string"},{"name":"venue_type","type":"string"}],"type":"MessageMedia"},{"id":"-1551583367","predicate":"receivedNotifyMessage","params":[{"name":"id","type":"int"},{"name":"flags","type":"int"}],"type":"ReceivedNotifyMessage"},{"id":"1776236393","predicate":"chatInviteEmpty","params":[],"type":"ExportedChatInvite"},{"id":"-64092740","predicate":"chatInviteExported","params":[{"name":"link","type":"string"}],"type":"ExportedChatInvite"},{"id":"1516793212","predicate":"chatInviteAlready","params":[{"name":"chat","type":"Chat"}],"type":"ChatInvite"},{"id":"-540871282","predicate":"chatInvite","params":[{"name":"flags","type":"#"},{"name":"channel","type":"flags.0?true"},{"name":"broadcast","type":"flags.1?true"},{"name":"public","type":"flags.2?true"},{"name":"megagroup","type":"flags.3?true"},{"name":"title","type":"string"},{"name":"photo","type":"Photo"},{"name":"participants_count","type":"int"},{"name":"participants","type":"flags.4?Vector"}],"type":"ChatInvite"},{"id":"-123931160","predicate":"messageActionChatJoinedByLink","params":[{"name":"inviter_id","type":"int"}],"type":"MessageAction"},{"id":"1757493555","predicate":"updateReadMessagesContents","params":[{"name":"messages","type":"Vector"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"}],"type":"Update"},{"id":"-4838507","predicate":"inputStickerSetEmpty","params":[],"type":"InputStickerSet"},{"id":"-1645763991","predicate":"inputStickerSetID","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputStickerSet"},{"id":"-2044933984","predicate":"inputStickerSetShortName","params":[{"name":"short_name","type":"string"}],"type":"InputStickerSet"},{"id":"-290164953","predicate":"stickerSet","params":[{"name":"flags","type":"#"},{"name":"archived","type":"flags.1?true"},{"name":"official","type":"flags.2?true"},{"name":"masks","type":"flags.3?true"},{"name":"animated","type":"flags.5?true"},{"name":"installed_date","type":"flags.0?int"},{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"title","type":"string"},{"name":"short_name","type":"string"},{"name":"thumb","type":"flags.4?PhotoSize"},{"name":"thumb_dc_id","type":"flags.4?int"},{"name":"count","type":"int"},{"name":"hash","type":"int"}],"type":"StickerSet"},{"id":"-1240849242","predicate":"messages.stickerSet","params":[{"name":"set","type":"StickerSet"},{"name":"packs","type":"Vector"},{"name":"documents","type":"Vector"}],"type":"messages.StickerSet"},{"id":"-1820043071","predicate":"user","params":[{"name":"flags","type":"#"},{"name":"self","type":"flags.10?true"},{"name":"contact","type":"flags.11?true"},{"name":"mutual_contact","type":"flags.12?true"},{"name":"deleted","type":"flags.13?true"},{"name":"bot","type":"flags.14?true"},{"name":"bot_chat_history","type":"flags.15?true"},{"name":"bot_nochats","type":"flags.16?true"},{"name":"verified","type":"flags.17?true"},{"name":"restricted","type":"flags.18?true"},{"name":"min","type":"flags.20?true"},{"name":"bot_inline_geo","type":"flags.21?true"},{"name":"support","type":"flags.23?true"},{"name":"scam","type":"flags.24?true"},{"name":"apply_min_photo","type":"flags.25?true"},{"name":"id","type":"int"},{"name":"access_hash","type":"flags.0?long"},{"name":"first_name","type":"flags.1?string"},{"name":"last_name","type":"flags.2?string"},{"name":"username","type":"flags.3?string"},{"name":"phone","type":"flags.4?string"},{"name":"photo","type":"flags.5?UserProfilePhoto"},{"name":"status","type":"flags.6?UserStatus"},{"name":"bot_info_version","type":"flags.14?int"},{"name":"restriction_reason","type":"flags.18?Vector"},{"name":"bot_inline_placeholder","type":"flags.19?string"},{"name":"lang_code","type":"flags.22?string"}],"type":"User"},{"id":"-1032140601","predicate":"botCommand","params":[{"name":"command","type":"string"},{"name":"description","type":"string"}],"type":"BotCommand"},{"id":"-1729618630","predicate":"botInfo","params":[{"name":"user_id","type":"int"},{"name":"description","type":"string"},{"name":"commands","type":"Vector"}],"type":"BotInfo"},{"id":"-1560655744","predicate":"keyboardButton","params":[{"name":"text","type":"string"}],"type":"KeyboardButton"},{"id":"2002815875","predicate":"keyboardButtonRow","params":[{"name":"buttons","type":"Vector"}],"type":"KeyboardButtonRow"},{"id":"-1606526075","predicate":"replyKeyboardHide","params":[{"name":"flags","type":"#"},{"name":"selective","type":"flags.2?true"}],"type":"ReplyMarkup"},{"id":"-200242528","predicate":"replyKeyboardForceReply","params":[{"name":"flags","type":"#"},{"name":"single_use","type":"flags.1?true"},{"name":"selective","type":"flags.2?true"}],"type":"ReplyMarkup"},{"id":"889353612","predicate":"replyKeyboardMarkup","params":[{"name":"flags","type":"#"},{"name":"resize","type":"flags.0?true"},{"name":"single_use","type":"flags.1?true"},{"name":"selective","type":"flags.2?true"},{"name":"rows","type":"Vector"}],"type":"ReplyMarkup"},{"id":"2072935910","predicate":"inputPeerUser","params":[{"name":"user_id","type":"int"},{"name":"access_hash","type":"long"}],"type":"InputPeer"},{"id":"-668391402","predicate":"inputUser","params":[{"name":"user_id","type":"int"},{"name":"access_hash","type":"long"}],"type":"InputUser"},{"id":"-1148011883","predicate":"messageEntityUnknown","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity"},{"id":"-100378723","predicate":"messageEntityMention","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity"},{"id":"1868782349","predicate":"messageEntityHashtag","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity"},{"id":"1827637959","predicate":"messageEntityBotCommand","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity"},{"id":"1859134776","predicate":"messageEntityUrl","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity"},{"id":"1692693954","predicate":"messageEntityEmail","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity"},{"id":"-1117713463","predicate":"messageEntityBold","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity"},{"id":"-2106619040","predicate":"messageEntityItalic","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity"},{"id":"681706865","predicate":"messageEntityCode","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity"},{"id":"1938967520","predicate":"messageEntityPre","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"},{"name":"language","type":"string"}],"type":"MessageEntity"},{"id":"1990644519","predicate":"messageEntityTextUrl","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"},{"name":"url","type":"string"}],"type":"MessageEntity"},{"id":"301019932","predicate":"updateShortSentMessage","params":[{"name":"flags","type":"#"},{"name":"out","type":"flags.1?true"},{"name":"id","type":"int"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"},{"name":"date","type":"int"},{"name":"media","type":"flags.9?MessageMedia"},{"name":"entities","type":"flags.7?Vector"}],"type":"Updates"},{"id":"-292807034","predicate":"inputChannelEmpty","params":[],"type":"InputChannel"},{"id":"-1343524562","predicate":"inputChannel","params":[{"name":"channel_id","type":"int"},{"name":"access_hash","type":"long"}],"type":"InputChannel"},{"id":"-1109531342","predicate":"peerChannel","params":[{"name":"channel_id","type":"int"}],"type":"Peer"},{"id":"548253432","predicate":"inputPeerChannel","params":[{"name":"channel_id","type":"int"},{"name":"access_hash","type":"long"}],"type":"InputPeer"},{"id":"-753232354","predicate":"channel","params":[{"name":"flags","type":"#"},{"name":"creator","type":"flags.0?true"},{"name":"left","type":"flags.2?true"},{"name":"broadcast","type":"flags.5?true"},{"name":"verified","type":"flags.7?true"},{"name":"megagroup","type":"flags.8?true"},{"name":"restricted","type":"flags.9?true"},{"name":"signatures","type":"flags.11?true"},{"name":"min","type":"flags.12?true"},{"name":"scam","type":"flags.19?true"},{"name":"has_link","type":"flags.20?true"},{"name":"has_geo","type":"flags.21?true"},{"name":"slowmode_enabled","type":"flags.22?true"},{"name":"call_active","type":"flags.23?true"},{"name":"call_not_empty","type":"flags.24?true"},{"name":"id","type":"int"},{"name":"access_hash","type":"flags.13?long"},{"name":"title","type":"string"},{"name":"username","type":"flags.6?string"},{"name":"photo","type":"ChatPhoto"},{"name":"date","type":"int"},{"name":"version","type":"int"},{"name":"restriction_reason","type":"flags.9?Vector"},{"name":"admin_rights","type":"flags.14?ChatAdminRights"},{"name":"banned_rights","type":"flags.15?ChatBannedRights"},{"name":"default_banned_rights","type":"flags.18?ChatBannedRights"},{"name":"participants_count","type":"flags.17?int"}],"type":"Chat"},{"id":"681420594","predicate":"channelForbidden","params":[{"name":"flags","type":"#"},{"name":"broadcast","type":"flags.5?true"},{"name":"megagroup","type":"flags.8?true"},{"name":"id","type":"int"},{"name":"access_hash","type":"long"},{"name":"title","type":"string"},{"name":"until_date","type":"flags.16?int"}],"type":"Chat"},{"id":"2131196633","predicate":"contacts.resolvedPeer","params":[{"name":"peer","type":"Peer"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"contacts.ResolvedPeer"},{"id":"-253335766","predicate":"channelFull","params":[{"name":"flags","type":"#"},{"name":"can_view_participants","type":"flags.3?true"},{"name":"can_set_username","type":"flags.6?true"},{"name":"can_set_stickers","type":"flags.7?true"},{"name":"hidden_prehistory","type":"flags.10?true"},{"name":"can_set_location","type":"flags.16?true"},{"name":"has_scheduled","type":"flags.19?true"},{"name":"can_view_stats","type":"flags.20?true"},{"name":"blocked","type":"flags.22?true"},{"name":"id","type":"int"},{"name":"about","type":"string"},{"name":"participants_count","type":"flags.0?int"},{"name":"admins_count","type":"flags.1?int"},{"name":"kicked_count","type":"flags.2?int"},{"name":"banned_count","type":"flags.2?int"},{"name":"online_count","type":"flags.13?int"},{"name":"read_inbox_max_id","type":"int"},{"name":"read_outbox_max_id","type":"int"},{"name":"unread_count","type":"int"},{"name":"chat_photo","type":"Photo"},{"name":"notify_settings","type":"PeerNotifySettings"},{"name":"exported_invite","type":"ExportedChatInvite"},{"name":"bot_info","type":"Vector"},{"name":"migrated_from_chat_id","type":"flags.4?int"},{"name":"migrated_from_max_id","type":"flags.4?int"},{"name":"pinned_msg_id","type":"flags.5?int"},{"name":"stickerset","type":"flags.8?StickerSet"},{"name":"available_min_id","type":"flags.9?int"},{"name":"folder_id","type":"flags.11?int"},{"name":"linked_chat_id","type":"flags.14?int"},{"name":"location","type":"flags.15?ChannelLocation"},{"name":"slowmode_seconds","type":"flags.17?int"},{"name":"slowmode_next_send_date","type":"flags.18?int"},{"name":"stats_dc","type":"flags.12?int"},{"name":"pts","type":"int"}],"type":"ChatFull"},{"id":"182649427","predicate":"messageRange","params":[{"name":"min_id","type":"int"},{"name":"max_id","type":"int"}],"type":"MessageRange"},{"id":"1682413576","predicate":"messages.channelMessages","params":[{"name":"flags","type":"#"},{"name":"inexact","type":"flags.1?true"},{"name":"pts","type":"int"},{"name":"count","type":"int"},{"name":"offset_id_offset","type":"flags.2?int"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Messages"},{"id":"-1781355374","predicate":"messageActionChannelCreate","params":[{"name":"title","type":"string"}],"type":"MessageAction"},{"id":"-352032773","predicate":"updateChannelTooLong","params":[{"name":"flags","type":"#"},{"name":"channel_id","type":"int"},{"name":"pts","type":"flags.0?int"}],"type":"Update"},{"id":"-1227598250","predicate":"updateChannel","params":[{"name":"channel_id","type":"int"}],"type":"Update"},{"id":"1656358105","predicate":"updateNewChannelMessage","params":[{"name":"message","type":"Message"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"}],"type":"Update"},{"id":"856380452","predicate":"updateReadChannelInbox","params":[{"name":"flags","type":"#"},{"name":"folder_id","type":"flags.0?int"},{"name":"channel_id","type":"int"},{"name":"max_id","type":"int"},{"name":"still_unread_count","type":"int"},{"name":"pts","type":"int"}],"type":"Update"},{"id":"-1015733815","predicate":"updateDeleteChannelMessages","params":[{"name":"channel_id","type":"int"},{"name":"messages","type":"Vector"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"}],"type":"Update"},{"id":"-1734268085","predicate":"updateChannelMessageViews","params":[{"name":"channel_id","type":"int"},{"name":"id","type":"int"},{"name":"views","type":"int"}],"type":"Update"},{"id":"1041346555","predicate":"updates.channelDifferenceEmpty","params":[{"name":"flags","type":"#"},{"name":"final","type":"flags.0?true"},{"name":"pts","type":"int"},{"name":"timeout","type":"flags.1?int"}],"type":"updates.ChannelDifference"},{"id":"-1531132162","predicate":"updates.channelDifferenceTooLong","params":[{"name":"flags","type":"#"},{"name":"final","type":"flags.0?true"},{"name":"timeout","type":"flags.1?int"},{"name":"dialog","type":"Dialog"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"updates.ChannelDifference"},{"id":"543450958","predicate":"updates.channelDifference","params":[{"name":"flags","type":"#"},{"name":"final","type":"flags.0?true"},{"name":"pts","type":"int"},{"name":"timeout","type":"flags.1?int"},{"name":"new_messages","type":"Vector"},{"name":"other_updates","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"updates.ChannelDifference"},{"id":"-1798033689","predicate":"channelMessagesFilterEmpty","params":[],"type":"ChannelMessagesFilter"},{"id":"-847783593","predicate":"channelMessagesFilter","params":[{"name":"flags","type":"#"},{"name":"exclude_new_messages","type":"flags.1?true"},{"name":"ranges","type":"Vector"}],"type":"ChannelMessagesFilter"},{"id":"367766557","predicate":"channelParticipant","params":[{"name":"user_id","type":"int"},{"name":"date","type":"int"}],"type":"ChannelParticipant"},{"id":"-1557620115","predicate":"channelParticipantSelf","params":[{"name":"user_id","type":"int"},{"name":"inviter_id","type":"int"},{"name":"date","type":"int"}],"type":"ChannelParticipant"},{"id":"1149094475","predicate":"channelParticipantCreator","params":[{"name":"flags","type":"#"},{"name":"user_id","type":"int"},{"name":"admin_rights","type":"ChatAdminRights"},{"name":"rank","type":"flags.0?string"}],"type":"ChannelParticipant"},{"id":"-566281095","predicate":"channelParticipantsRecent","params":[],"type":"ChannelParticipantsFilter"},{"id":"-1268741783","predicate":"channelParticipantsAdmins","params":[],"type":"ChannelParticipantsFilter"},{"id":"-1548400251","predicate":"channelParticipantsKicked","params":[{"name":"q","type":"string"}],"type":"ChannelParticipantsFilter"},{"id":"-177282392","predicate":"channels.channelParticipants","params":[{"name":"count","type":"int"},{"name":"participants","type":"Vector"},{"name":"users","type":"Vector"}],"type":"channels.ChannelParticipants"},{"id":"-791039645","predicate":"channels.channelParticipant","params":[{"name":"participant","type":"ChannelParticipant"},{"name":"users","type":"Vector"}],"type":"channels.ChannelParticipant"},{"id":"-636267638","predicate":"chatParticipantCreator","params":[{"name":"user_id","type":"int"}],"type":"ChatParticipant"},{"id":"-489233354","predicate":"chatParticipantAdmin","params":[{"name":"user_id","type":"int"},{"name":"inviter_id","type":"int"},{"name":"date","type":"int"}],"type":"ChatParticipant"},{"id":"-1232070311","predicate":"updateChatParticipantAdmin","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"int"},{"name":"is_admin","type":"Bool"},{"name":"version","type":"int"}],"type":"Update"},{"id":"1371385889","predicate":"messageActionChatMigrateTo","params":[{"name":"channel_id","type":"int"}],"type":"MessageAction"},{"id":"-1336546578","predicate":"messageActionChannelMigrateFrom","params":[{"name":"title","type":"string"},{"name":"chat_id","type":"int"}],"type":"MessageAction"},{"id":"-1328445861","predicate":"channelParticipantsBots","params":[],"type":"ChannelParticipantsFilter"},{"id":"2013922064","predicate":"help.termsOfService","params":[{"name":"flags","type":"#"},{"name":"popup","type":"flags.0?true"},{"name":"id","type":"DataJSON"},{"name":"text","type":"string"},{"name":"entities","type":"Vector"},{"name":"min_age_confirm","type":"flags.1?int"}],"type":"help.TermsOfService"},{"id":"1753886890","predicate":"updateNewStickerSet","params":[{"name":"stickerset","type":"messages.StickerSet"}],"type":"Update"},{"id":"196268545","predicate":"updateStickerSetsOrder","params":[{"name":"flags","type":"#"},{"name":"masks","type":"flags.0?true"},{"name":"order","type":"Vector"}],"type":"Update"},{"id":"1135492588","predicate":"updateStickerSets","params":[],"type":"Update"},{"id":"-402498398","predicate":"messages.savedGifsNotModified","params":[],"type":"messages.SavedGifs"},{"id":"772213157","predicate":"messages.savedGifs","params":[{"name":"hash","type":"int"},{"name":"gifs","type":"Vector"}],"type":"messages.SavedGifs"},{"id":"-1821035490","predicate":"updateSavedGifs","params":[],"type":"Update"},{"id":"864077702","predicate":"inputBotInlineMessageMediaAuto","params":[{"name":"flags","type":"#"},{"name":"message","type":"string"},{"name":"entities","type":"flags.1?Vector"},{"name":"reply_markup","type":"flags.2?ReplyMarkup"}],"type":"InputBotInlineMessage"},{"id":"1036876423","predicate":"inputBotInlineMessageText","params":[{"name":"flags","type":"#"},{"name":"no_webpage","type":"flags.0?true"},{"name":"message","type":"string"},{"name":"entities","type":"flags.1?Vector"},{"name":"reply_markup","type":"flags.2?ReplyMarkup"}],"type":"InputBotInlineMessage"},{"id":"-2000710887","predicate":"inputBotInlineResult","params":[{"name":"flags","type":"#"},{"name":"id","type":"string"},{"name":"type","type":"string"},{"name":"title","type":"flags.1?string"},{"name":"description","type":"flags.2?string"},{"name":"url","type":"flags.3?string"},{"name":"thumb","type":"flags.4?InputWebDocument"},{"name":"content","type":"flags.5?InputWebDocument"},{"name":"send_message","type":"InputBotInlineMessage"}],"type":"InputBotInlineResult"},{"id":"1984755728","predicate":"botInlineMessageMediaAuto","params":[{"name":"flags","type":"#"},{"name":"message","type":"string"},{"name":"entities","type":"flags.1?Vector"},{"name":"reply_markup","type":"flags.2?ReplyMarkup"}],"type":"BotInlineMessage"},{"id":"-1937807902","predicate":"botInlineMessageText","params":[{"name":"flags","type":"#"},{"name":"no_webpage","type":"flags.0?true"},{"name":"message","type":"string"},{"name":"entities","type":"flags.1?Vector"},{"name":"reply_markup","type":"flags.2?ReplyMarkup"}],"type":"BotInlineMessage"},{"id":"295067450","predicate":"botInlineResult","params":[{"name":"flags","type":"#"},{"name":"id","type":"string"},{"name":"type","type":"string"},{"name":"title","type":"flags.1?string"},{"name":"description","type":"flags.2?string"},{"name":"url","type":"flags.3?string"},{"name":"thumb","type":"flags.4?WebDocument"},{"name":"content","type":"flags.5?WebDocument"},{"name":"send_message","type":"BotInlineMessage"}],"type":"BotInlineResult"},{"id":"-1803769784","predicate":"messages.botResults","params":[{"name":"flags","type":"#"},{"name":"gallery","type":"flags.0?true"},{"name":"query_id","type":"long"},{"name":"next_offset","type":"flags.1?string"},{"name":"switch_pm","type":"flags.2?InlineBotSwitchPM"},{"name":"results","type":"Vector"},{"name":"cache_time","type":"int"},{"name":"users","type":"Vector"}],"type":"messages.BotResults"},{"id":"1417832080","predicate":"updateBotInlineQuery","params":[{"name":"flags","type":"#"},{"name":"query_id","type":"long"},{"name":"user_id","type":"int"},{"name":"query","type":"string"},{"name":"geo","type":"flags.0?GeoPoint"},{"name":"offset","type":"string"}],"type":"Update"},{"id":"239663460","predicate":"updateBotInlineSend","params":[{"name":"flags","type":"#"},{"name":"user_id","type":"int"},{"name":"query","type":"string"},{"name":"geo","type":"flags.0?GeoPoint"},{"name":"id","type":"string"},{"name":"msg_id","type":"flags.1?InputBotInlineMessageID"}],"type":"Update"},{"id":"1358283666","predicate":"inputMessagesFilterVoice","params":[],"type":"MessagesFilter"},{"id":"928101534","predicate":"inputMessagesFilterMusic","params":[],"type":"MessagesFilter"},{"id":"-1107622874","predicate":"inputPrivacyKeyChatInvite","params":[],"type":"InputPrivacyKey"},{"id":"1343122938","predicate":"privacyKeyChatInvite","params":[],"type":"PrivacyKey"},{"id":"1571494644","predicate":"exportedMessageLink","params":[{"name":"link","type":"string"},{"name":"html","type":"string"}],"type":"ExportedMessageLink"},{"id":"1601666510","predicate":"messageFwdHeader","params":[{"name":"flags","type":"#"},{"name":"imported","type":"flags.7?true"},{"name":"from_id","type":"flags.0?Peer"},{"name":"from_name","type":"flags.5?string"},{"name":"date","type":"int"},{"name":"channel_post","type":"flags.2?int"},{"name":"post_author","type":"flags.3?string"},{"name":"saved_from_peer","type":"flags.4?Peer"},{"name":"saved_from_msg_id","type":"flags.4?int"},{"name":"psa_type","type":"flags.6?string"}],"type":"MessageFwdHeader"},{"id":"457133559","predicate":"updateEditChannelMessage","params":[{"name":"message","type":"Message"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"}],"type":"Update"},{"id":"-1799538451","predicate":"messageActionPinMessage","params":[],"type":"MessageAction"},{"id":"1923290508","predicate":"auth.codeTypeSms","params":[],"type":"auth.CodeType"},{"id":"1948046307","predicate":"auth.codeTypeCall","params":[],"type":"auth.CodeType"},{"id":"577556219","predicate":"auth.codeTypeFlashCall","params":[],"type":"auth.CodeType"},{"id":"1035688326","predicate":"auth.sentCodeTypeApp","params":[{"name":"length","type":"int"}],"type":"auth.SentCodeType"},{"id":"-1073693790","predicate":"auth.sentCodeTypeSms","params":[{"name":"length","type":"int"}],"type":"auth.SentCodeType"},{"id":"1398007207","predicate":"auth.sentCodeTypeCall","params":[{"name":"length","type":"int"}],"type":"auth.SentCodeType"},{"id":"-1425815847","predicate":"auth.sentCodeTypeFlashCall","params":[{"name":"pattern","type":"string"}],"type":"auth.SentCodeType"},{"id":"629866245","predicate":"keyboardButtonUrl","params":[{"name":"text","type":"string"},{"name":"url","type":"string"}],"type":"KeyboardButton"},{"id":"901503851","predicate":"keyboardButtonCallback","params":[{"name":"flags","type":"#"},{"name":"requires_password","type":"flags.0?true"},{"name":"text","type":"string"},{"name":"data","type":"bytes"}],"type":"KeyboardButton"},{"id":"-1318425559","predicate":"keyboardButtonRequestPhone","params":[{"name":"text","type":"string"}],"type":"KeyboardButton"},{"id":"-59151553","predicate":"keyboardButtonRequestGeoLocation","params":[{"name":"text","type":"string"}],"type":"KeyboardButton"},{"id":"90744648","predicate":"keyboardButtonSwitchInline","params":[{"name":"flags","type":"#"},{"name":"same_peer","type":"flags.0?true"},{"name":"text","type":"string"},{"name":"query","type":"string"}],"type":"KeyboardButton"},{"id":"1218642516","predicate":"replyInlineMarkup","params":[{"name":"rows","type":"Vector"}],"type":"ReplyMarkup"},{"id":"911761060","predicate":"messages.botCallbackAnswer","params":[{"name":"flags","type":"#"},{"name":"alert","type":"flags.1?true"},{"name":"has_url","type":"flags.3?true"},{"name":"native_ui","type":"flags.4?true"},{"name":"message","type":"flags.0?string"},{"name":"url","type":"flags.2?string"},{"name":"cache_time","type":"int"}],"type":"messages.BotCallbackAnswer"},{"id":"-415938591","predicate":"updateBotCallbackQuery","params":[{"name":"flags","type":"#"},{"name":"query_id","type":"long"},{"name":"user_id","type":"int"},{"name":"peer","type":"Peer"},{"name":"msg_id","type":"int"},{"name":"chat_instance","type":"long"},{"name":"data","type":"flags.0?bytes"},{"name":"game_short_name","type":"flags.1?string"}],"type":"Update"},{"id":"649453030","predicate":"messages.messageEditData","params":[{"name":"flags","type":"#"},{"name":"caption","type":"flags.0?true"}],"type":"messages.MessageEditData"},{"id":"-469536605","predicate":"updateEditMessage","params":[{"name":"message","type":"Message"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"}],"type":"Update"},{"id":"-1768777083","predicate":"inputBotInlineMessageMediaGeo","params":[{"name":"flags","type":"#"},{"name":"geo_point","type":"InputGeoPoint"},{"name":"heading","type":"flags.0?int"},{"name":"period","type":"flags.1?int"},{"name":"proximity_notification_radius","type":"flags.3?int"},{"name":"reply_markup","type":"flags.2?ReplyMarkup"}],"type":"InputBotInlineMessage"},{"id":"1098628881","predicate":"inputBotInlineMessageMediaVenue","params":[{"name":"flags","type":"#"},{"name":"geo_point","type":"InputGeoPoint"},{"name":"title","type":"string"},{"name":"address","type":"string"},{"name":"provider","type":"string"},{"name":"venue_id","type":"string"},{"name":"venue_type","type":"string"},{"name":"reply_markup","type":"flags.2?ReplyMarkup"}],"type":"InputBotInlineMessage"},{"id":"-1494368259","predicate":"inputBotInlineMessageMediaContact","params":[{"name":"flags","type":"#"},{"name":"phone_number","type":"string"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"vcard","type":"string"},{"name":"reply_markup","type":"flags.2?ReplyMarkup"}],"type":"InputBotInlineMessage"},{"id":"85477117","predicate":"botInlineMessageMediaGeo","params":[{"name":"flags","type":"#"},{"name":"geo","type":"GeoPoint"},{"name":"heading","type":"flags.0?int"},{"name":"period","type":"flags.1?int"},{"name":"proximity_notification_radius","type":"flags.3?int"},{"name":"reply_markup","type":"flags.2?ReplyMarkup"}],"type":"BotInlineMessage"},{"id":"-1970903652","predicate":"botInlineMessageMediaVenue","params":[{"name":"flags","type":"#"},{"name":"geo","type":"GeoPoint"},{"name":"title","type":"string"},{"name":"address","type":"string"},{"name":"provider","type":"string"},{"name":"venue_id","type":"string"},{"name":"venue_type","type":"string"},{"name":"reply_markup","type":"flags.2?ReplyMarkup"}],"type":"BotInlineMessage"},{"id":"416402882","predicate":"botInlineMessageMediaContact","params":[{"name":"flags","type":"#"},{"name":"phone_number","type":"string"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"vcard","type":"string"},{"name":"reply_markup","type":"flags.2?ReplyMarkup"}],"type":"BotInlineMessage"},{"id":"-1462213465","predicate":"inputBotInlineResultPhoto","params":[{"name":"id","type":"string"},{"name":"type","type":"string"},{"name":"photo","type":"InputPhoto"},{"name":"send_message","type":"InputBotInlineMessage"}],"type":"InputBotInlineResult"},{"id":"-459324","predicate":"inputBotInlineResultDocument","params":[{"name":"flags","type":"#"},{"name":"id","type":"string"},{"name":"type","type":"string"},{"name":"title","type":"flags.1?string"},{"name":"description","type":"flags.2?string"},{"name":"document","type":"InputDocument"},{"name":"send_message","type":"InputBotInlineMessage"}],"type":"InputBotInlineResult"},{"id":"400266251","predicate":"botInlineMediaResult","params":[{"name":"flags","type":"#"},{"name":"id","type":"string"},{"name":"type","type":"string"},{"name":"photo","type":"flags.0?Photo"},{"name":"document","type":"flags.1?Document"},{"name":"title","type":"flags.2?string"},{"name":"description","type":"flags.3?string"},{"name":"send_message","type":"BotInlineMessage"}],"type":"BotInlineResult"},{"id":"-1995686519","predicate":"inputBotInlineMessageID","params":[{"name":"dc_id","type":"int"},{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputBotInlineMessageID"},{"id":"-103646630","predicate":"updateInlineBotCallbackQuery","params":[{"name":"flags","type":"#"},{"name":"query_id","type":"long"},{"name":"user_id","type":"int"},{"name":"msg_id","type":"InputBotInlineMessageID"},{"name":"chat_instance","type":"long"},{"name":"data","type":"flags.0?bytes"},{"name":"game_short_name","type":"flags.1?string"}],"type":"Update"},{"id":"1008755359","predicate":"inlineBotSwitchPM","params":[{"name":"text","type":"string"},{"name":"start_param","type":"string"}],"type":"InlineBotSwitchPM"},{"id":"863093588","predicate":"messages.peerDialogs","params":[{"name":"dialogs","type":"Vector"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"state","type":"updates.State"}],"type":"messages.PeerDialogs"},{"id":"-305282981","predicate":"topPeer","params":[{"name":"peer","type":"Peer"},{"name":"rating","type":"double"}],"type":"TopPeer"},{"id":"-1419371685","predicate":"topPeerCategoryBotsPM","params":[],"type":"TopPeerCategory"},{"id":"344356834","predicate":"topPeerCategoryBotsInline","params":[],"type":"TopPeerCategory"},{"id":"104314861","predicate":"topPeerCategoryCorrespondents","params":[],"type":"TopPeerCategory"},{"id":"-1122524854","predicate":"topPeerCategoryGroups","params":[],"type":"TopPeerCategory"},{"id":"371037736","predicate":"topPeerCategoryChannels","params":[],"type":"TopPeerCategory"},{"id":"-75283823","predicate":"topPeerCategoryPeers","params":[{"name":"category","type":"TopPeerCategory"},{"name":"count","type":"int"},{"name":"peers","type":"Vector"}],"type":"TopPeerCategoryPeers"},{"id":"-567906571","predicate":"contacts.topPeersNotModified","params":[],"type":"contacts.TopPeers"},{"id":"1891070632","predicate":"contacts.topPeers","params":[{"name":"categories","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"contacts.TopPeers"},{"id":"892193368","predicate":"messageEntityMentionName","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"},{"name":"user_id","type":"int"}],"type":"MessageEntity"},{"id":"546203849","predicate":"inputMessageEntityMentionName","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"},{"name":"user_id","type":"InputUser"}],"type":"MessageEntity"},{"id":"975236280","predicate":"inputMessagesFilterChatPhotos","params":[],"type":"MessagesFilter"},{"id":"634833351","predicate":"updateReadChannelOutbox","params":[{"name":"channel_id","type":"int"},{"name":"max_id","type":"int"}],"type":"Update"},{"id":"-299124375","predicate":"updateDraftMessage","params":[{"name":"peer","type":"Peer"},{"name":"draft","type":"DraftMessage"}],"type":"Update"},{"id":"453805082","predicate":"draftMessageEmpty","params":[{"name":"flags","type":"#"},{"name":"date","type":"flags.0?int"}],"type":"DraftMessage"},{"id":"-40996577","predicate":"draftMessage","params":[{"name":"flags","type":"#"},{"name":"no_webpage","type":"flags.1?true"},{"name":"reply_to_msg_id","type":"flags.0?int"},{"name":"message","type":"string"},{"name":"entities","type":"flags.3?Vector"},{"name":"date","type":"int"}],"type":"DraftMessage"},{"id":"-1615153660","predicate":"messageActionHistoryClear","params":[],"type":"MessageAction"},{"id":"-958657434","predicate":"messages.featuredStickersNotModified","params":[{"name":"count","type":"int"}],"type":"messages.FeaturedStickers"},{"id":"-1230257343","predicate":"messages.featuredStickers","params":[{"name":"hash","type":"int"},{"name":"count","type":"int"},{"name":"sets","type":"Vector"},{"name":"unread","type":"Vector"}],"type":"messages.FeaturedStickers"},{"id":"1461528386","predicate":"updateReadFeaturedStickers","params":[],"type":"Update"},{"id":"186120336","predicate":"messages.recentStickersNotModified","params":[],"type":"messages.RecentStickers"},{"id":"586395571","predicate":"messages.recentStickers","params":[{"name":"hash","type":"int"},{"name":"packs","type":"Vector"},{"name":"stickers","type":"Vector"},{"name":"dates","type":"Vector"}],"type":"messages.RecentStickers"},{"id":"-1706939360","predicate":"updateRecentStickers","params":[],"type":"Update"},{"id":"1338747336","predicate":"messages.archivedStickers","params":[{"name":"count","type":"int"},{"name":"sets","type":"Vector"}],"type":"messages.ArchivedStickers"},{"id":"946083368","predicate":"messages.stickerSetInstallResultSuccess","params":[],"type":"messages.StickerSetInstallResult"},{"id":"904138920","predicate":"messages.stickerSetInstallResultArchive","params":[{"name":"sets","type":"Vector"}],"type":"messages.StickerSetInstallResult"},{"id":"1678812626","predicate":"stickerSetCovered","params":[{"name":"set","type":"StickerSet"},{"name":"cover","type":"Document"}],"type":"StickerSetCovered"},{"id":"-1574314746","predicate":"updateConfig","params":[],"type":"Update"},{"id":"861169551","predicate":"updatePtsChanged","params":[],"type":"Update"},{"id":"-440664550","predicate":"inputMediaPhotoExternal","params":[{"name":"flags","type":"#"},{"name":"url","type":"string"},{"name":"ttl_seconds","type":"flags.0?int"}],"type":"InputMedia"},{"id":"-78455655","predicate":"inputMediaDocumentExternal","params":[{"name":"flags","type":"#"},{"name":"url","type":"string"},{"name":"ttl_seconds","type":"flags.0?int"}],"type":"InputMedia"},{"id":"872932635","predicate":"stickerSetMultiCovered","params":[{"name":"set","type":"StickerSet"},{"name":"covers","type":"Vector"}],"type":"StickerSetCovered"},{"id":"-1361650766","predicate":"maskCoords","params":[{"name":"n","type":"int"},{"name":"x","type":"double"},{"name":"y","type":"double"},{"name":"zoom","type":"double"}],"type":"MaskCoords"},{"id":"-1744710921","predicate":"documentAttributeHasStickers","params":[],"type":"DocumentAttribute"},{"id":"1251549527","predicate":"inputStickeredMediaPhoto","params":[{"name":"id","type":"InputPhoto"}],"type":"InputStickeredMedia"},{"id":"70813275","predicate":"inputStickeredMediaDocument","params":[{"name":"id","type":"InputDocument"}],"type":"InputStickeredMedia"},{"id":"-1107729093","predicate":"game","params":[{"name":"flags","type":"#"},{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"short_name","type":"string"},{"name":"title","type":"string"},{"name":"description","type":"string"},{"name":"photo","type":"Photo"},{"name":"document","type":"flags.0?Document"}],"type":"Game"},{"id":"1336154098","predicate":"inputBotInlineResultGame","params":[{"name":"id","type":"string"},{"name":"short_name","type":"string"},{"name":"send_message","type":"InputBotInlineMessage"}],"type":"InputBotInlineResult"},{"id":"1262639204","predicate":"inputBotInlineMessageGame","params":[{"name":"flags","type":"#"},{"name":"reply_markup","type":"flags.2?ReplyMarkup"}],"type":"InputBotInlineMessage"},{"id":"-38694904","predicate":"messageMediaGame","params":[{"name":"game","type":"Game"}],"type":"MessageMedia"},{"id":"-750828557","predicate":"inputMediaGame","params":[{"name":"id","type":"InputGame"}],"type":"InputMedia"},{"id":"53231223","predicate":"inputGameID","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputGame"},{"id":"-1020139510","predicate":"inputGameShortName","params":[{"name":"bot_id","type":"InputUser"},{"name":"short_name","type":"string"}],"type":"InputGame"},{"id":"1358175439","predicate":"keyboardButtonGame","params":[{"name":"text","type":"string"}],"type":"KeyboardButton"},{"id":"-1834538890","predicate":"messageActionGameScore","params":[{"name":"game_id","type":"long"},{"name":"score","type":"int"}],"type":"MessageAction"},{"id":"1493171408","predicate":"highScore","params":[{"name":"pos","type":"int"},{"name":"user_id","type":"int"},{"name":"score","type":"int"}],"type":"HighScore"},{"id":"-1707344487","predicate":"messages.highScores","params":[{"name":"scores","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.HighScores"},{"id":"1258196845","predicate":"updates.differenceTooLong","params":[{"name":"pts","type":"int"}],"type":"updates.Difference"},{"id":"1081547008","predicate":"updateChannelWebPage","params":[{"name":"channel_id","type":"int"},{"name":"webpage","type":"WebPage"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"}],"type":"Update"},{"id":"-1663561404","predicate":"messages.chatsSlice","params":[{"name":"count","type":"int"},{"name":"chats","type":"Vector"}],"type":"messages.Chats"},{"id":"-599948721","predicate":"textEmpty","params":[],"type":"RichText"},{"id":"1950782688","predicate":"textPlain","params":[{"name":"text","type":"string"}],"type":"RichText"},{"id":"1730456516","predicate":"textBold","params":[{"name":"text","type":"RichText"}],"type":"RichText"},{"id":"-653089380","predicate":"textItalic","params":[{"name":"text","type":"RichText"}],"type":"RichText"},{"id":"-1054465340","predicate":"textUnderline","params":[{"name":"text","type":"RichText"}],"type":"RichText"},{"id":"-1678197867","predicate":"textStrike","params":[{"name":"text","type":"RichText"}],"type":"RichText"},{"id":"1816074681","predicate":"textFixed","params":[{"name":"text","type":"RichText"}],"type":"RichText"},{"id":"1009288385","predicate":"textUrl","params":[{"name":"text","type":"RichText"},{"name":"url","type":"string"},{"name":"webpage_id","type":"long"}],"type":"RichText"},{"id":"-564523562","predicate":"textEmail","params":[{"name":"text","type":"RichText"},{"name":"email","type":"string"}],"type":"RichText"},{"id":"2120376535","predicate":"textConcat","params":[{"name":"texts","type":"Vector"}],"type":"RichText"},{"id":"324435594","predicate":"pageBlockUnsupported","params":[],"type":"PageBlock"},{"id":"1890305021","predicate":"pageBlockTitle","params":[{"name":"text","type":"RichText"}],"type":"PageBlock"},{"id":"-1879401953","predicate":"pageBlockSubtitle","params":[{"name":"text","type":"RichText"}],"type":"PageBlock"},{"id":"-1162877472","predicate":"pageBlockAuthorDate","params":[{"name":"author","type":"RichText"},{"name":"published_date","type":"int"}],"type":"PageBlock"},{"id":"-1076861716","predicate":"pageBlockHeader","params":[{"name":"text","type":"RichText"}],"type":"PageBlock"},{"id":"-248793375","predicate":"pageBlockSubheader","params":[{"name":"text","type":"RichText"}],"type":"PageBlock"},{"id":"1182402406","predicate":"pageBlockParagraph","params":[{"name":"text","type":"RichText"}],"type":"PageBlock"},{"id":"-1066346178","predicate":"pageBlockPreformatted","params":[{"name":"text","type":"RichText"},{"name":"language","type":"string"}],"type":"PageBlock"},{"id":"1216809369","predicate":"pageBlockFooter","params":[{"name":"text","type":"RichText"}],"type":"PageBlock"},{"id":"-618614392","predicate":"pageBlockDivider","params":[],"type":"PageBlock"},{"id":"-837994576","predicate":"pageBlockAnchor","params":[{"name":"name","type":"string"}],"type":"PageBlock"},{"id":"-454524911","predicate":"pageBlockList","params":[{"name":"items","type":"Vector"}],"type":"PageBlock"},{"id":"641563686","predicate":"pageBlockBlockquote","params":[{"name":"text","type":"RichText"},{"name":"caption","type":"RichText"}],"type":"PageBlock"},{"id":"1329878739","predicate":"pageBlockPullquote","params":[{"name":"text","type":"RichText"},{"name":"caption","type":"RichText"}],"type":"PageBlock"},{"id":"391759200","predicate":"pageBlockPhoto","params":[{"name":"flags","type":"#"},{"name":"photo_id","type":"long"},{"name":"caption","type":"PageCaption"},{"name":"url","type":"flags.0?string"},{"name":"webpage_id","type":"flags.0?long"}],"type":"PageBlock"},{"id":"2089805750","predicate":"pageBlockVideo","params":[{"name":"flags","type":"#"},{"name":"autoplay","type":"flags.0?true"},{"name":"loop","type":"flags.1?true"},{"name":"video_id","type":"long"},{"name":"caption","type":"PageCaption"}],"type":"PageBlock"},{"id":"972174080","predicate":"pageBlockCover","params":[{"name":"cover","type":"PageBlock"}],"type":"PageBlock"},{"id":"-1468953147","predicate":"pageBlockEmbed","params":[{"name":"flags","type":"#"},{"name":"full_width","type":"flags.0?true"},{"name":"allow_scrolling","type":"flags.3?true"},{"name":"url","type":"flags.1?string"},{"name":"html","type":"flags.2?string"},{"name":"poster_photo_id","type":"flags.4?long"},{"name":"w","type":"flags.5?int"},{"name":"h","type":"flags.5?int"},{"name":"caption","type":"PageCaption"}],"type":"PageBlock"},{"id":"-229005301","predicate":"pageBlockEmbedPost","params":[{"name":"url","type":"string"},{"name":"webpage_id","type":"long"},{"name":"author_photo_id","type":"long"},{"name":"author","type":"string"},{"name":"date","type":"int"},{"name":"blocks","type":"Vector"},{"name":"caption","type":"PageCaption"}],"type":"PageBlock"},{"id":"1705048653","predicate":"pageBlockCollage","params":[{"name":"items","type":"Vector"},{"name":"caption","type":"PageCaption"}],"type":"PageBlock"},{"id":"52401552","predicate":"pageBlockSlideshow","params":[{"name":"items","type":"Vector"},{"name":"caption","type":"PageCaption"}],"type":"PageBlock"},{"id":"1930545681","predicate":"webPageNotModified","params":[{"name":"flags","type":"#"},{"name":"cached_page_views","type":"flags.0?int"}],"type":"WebPage"},{"id":"-88417185","predicate":"inputPrivacyKeyPhoneCall","params":[],"type":"InputPrivacyKey"},{"id":"1030105979","predicate":"privacyKeyPhoneCall","params":[],"type":"PrivacyKey"},{"id":"-580219064","predicate":"sendMessageGamePlayAction","params":[],"type":"SendMessageAction"},{"id":"-2048646399","predicate":"phoneCallDiscardReasonMissed","params":[],"type":"PhoneCallDiscardReason"},{"id":"-527056480","predicate":"phoneCallDiscardReasonDisconnect","params":[],"type":"PhoneCallDiscardReason"},{"id":"1471006352","predicate":"phoneCallDiscardReasonHangup","params":[],"type":"PhoneCallDiscardReason"},{"id":"-84416311","predicate":"phoneCallDiscardReasonBusy","params":[],"type":"PhoneCallDiscardReason"},{"id":"1852826908","predicate":"updateDialogPinned","params":[{"name":"flags","type":"#"},{"name":"pinned","type":"flags.0?true"},{"name":"folder_id","type":"flags.1?int"},{"name":"peer","type":"DialogPeer"}],"type":"Update"},{"id":"-99664734","predicate":"updatePinnedDialogs","params":[{"name":"flags","type":"#"},{"name":"folder_id","type":"flags.1?int"},{"name":"order","type":"flags.0?Vector"}],"type":"Update"},{"id":"2104790276","predicate":"dataJSON","params":[{"name":"data","type":"string"}],"type":"DataJSON"},{"id":"-2095595325","predicate":"updateBotWebhookJSON","params":[{"name":"data","type":"DataJSON"}],"type":"Update"},{"id":"-1684914010","predicate":"updateBotWebhookJSONQuery","params":[{"name":"query_id","type":"long"},{"name":"data","type":"DataJSON"},{"name":"timeout","type":"int"}],"type":"Update"},{"id":"-886477832","predicate":"labeledPrice","params":[{"name":"label","type":"string"},{"name":"amount","type":"long"}],"type":"LabeledPrice"},{"id":"-1022713000","predicate":"invoice","params":[{"name":"flags","type":"#"},{"name":"test","type":"flags.0?true"},{"name":"name_requested","type":"flags.1?true"},{"name":"phone_requested","type":"flags.2?true"},{"name":"email_requested","type":"flags.3?true"},{"name":"shipping_address_requested","type":"flags.4?true"},{"name":"flexible","type":"flags.5?true"},{"name":"phone_to_provider","type":"flags.6?true"},{"name":"email_to_provider","type":"flags.7?true"},{"name":"currency","type":"string"},{"name":"prices","type":"Vector"}],"type":"Invoice"},{"id":"-186607933","predicate":"inputMediaInvoice","params":[{"name":"flags","type":"#"},{"name":"title","type":"string"},{"name":"description","type":"string"},{"name":"photo","type":"flags.0?InputWebDocument"},{"name":"invoice","type":"Invoice"},{"name":"payload","type":"bytes"},{"name":"provider","type":"string"},{"name":"provider_data","type":"DataJSON"},{"name":"start_param","type":"string"}],"type":"InputMedia"},{"id":"-368917890","predicate":"paymentCharge","params":[{"name":"id","type":"string"},{"name":"provider_charge_id","type":"string"}],"type":"PaymentCharge"},{"id":"-1892568281","predicate":"messageActionPaymentSentMe","params":[{"name":"flags","type":"#"},{"name":"currency","type":"string"},{"name":"total_amount","type":"long"},{"name":"payload","type":"bytes"},{"name":"info","type":"flags.0?PaymentRequestedInfo"},{"name":"shipping_option_id","type":"flags.1?string"},{"name":"charge","type":"PaymentCharge"}],"type":"MessageAction"},{"id":"-2074799289","predicate":"messageMediaInvoice","params":[{"name":"flags","type":"#"},{"name":"shipping_address_requested","type":"flags.1?true"},{"name":"test","type":"flags.3?true"},{"name":"title","type":"string"},{"name":"description","type":"string"},{"name":"photo","type":"flags.0?WebDocument"},{"name":"receipt_msg_id","type":"flags.2?int"},{"name":"currency","type":"string"},{"name":"total_amount","type":"long"},{"name":"start_param","type":"string"}],"type":"MessageMedia"},{"id":"512535275","predicate":"postAddress","params":[{"name":"street_line1","type":"string"},{"name":"street_line2","type":"string"},{"name":"city","type":"string"},{"name":"state","type":"string"},{"name":"country_iso2","type":"string"},{"name":"post_code","type":"string"}],"type":"PostAddress"},{"id":"-1868808300","predicate":"paymentRequestedInfo","params":[{"name":"flags","type":"#"},{"name":"name","type":"flags.0?string"},{"name":"phone","type":"flags.1?string"},{"name":"email","type":"flags.2?string"},{"name":"shipping_address","type":"flags.3?PostAddress"}],"type":"PaymentRequestedInfo"},{"id":"-1344716869","predicate":"keyboardButtonBuy","params":[{"name":"text","type":"string"}],"type":"KeyboardButton"},{"id":"1080663248","predicate":"messageActionPaymentSent","params":[{"name":"currency","type":"string"},{"name":"total_amount","type":"long"}],"type":"MessageAction"},{"id":"-842892769","predicate":"paymentSavedCredentialsCard","params":[{"name":"id","type":"string"},{"name":"title","type":"string"}],"type":"PaymentSavedCredentials"},{"id":"475467473","predicate":"webDocument","params":[{"name":"url","type":"string"},{"name":"access_hash","type":"long"},{"name":"size","type":"int"},{"name":"mime_type","type":"string"},{"name":"attributes","type":"Vector"}],"type":"WebDocument"},{"id":"-1678949555","predicate":"inputWebDocument","params":[{"name":"url","type":"string"},{"name":"size","type":"int"},{"name":"mime_type","type":"string"},{"name":"attributes","type":"Vector"}],"type":"InputWebDocument"},{"id":"-1036396922","predicate":"inputWebFileLocation","params":[{"name":"url","type":"string"},{"name":"access_hash","type":"long"}],"type":"InputWebFileLocation"},{"id":"568808380","predicate":"upload.webFile","params":[{"name":"size","type":"int"},{"name":"mime_type","type":"string"},{"name":"file_type","type":"storage.FileType"},{"name":"mtime","type":"int"},{"name":"bytes","type":"bytes"}],"type":"upload.WebFile"},{"id":"1062645411","predicate":"payments.paymentForm","params":[{"name":"flags","type":"#"},{"name":"can_save_credentials","type":"flags.2?true"},{"name":"password_missing","type":"flags.3?true"},{"name":"bot_id","type":"int"},{"name":"invoice","type":"Invoice"},{"name":"provider_id","type":"int"},{"name":"url","type":"string"},{"name":"native_provider","type":"flags.4?string"},{"name":"native_params","type":"flags.4?DataJSON"},{"name":"saved_info","type":"flags.0?PaymentRequestedInfo"},{"name":"saved_credentials","type":"flags.1?PaymentSavedCredentials"},{"name":"users","type":"Vector"}],"type":"payments.PaymentForm"},{"id":"-784000893","predicate":"payments.validatedRequestedInfo","params":[{"name":"flags","type":"#"},{"name":"id","type":"flags.0?string"},{"name":"shipping_options","type":"flags.1?Vector"}],"type":"payments.ValidatedRequestedInfo"},{"id":"1314881805","predicate":"payments.paymentResult","params":[{"name":"updates","type":"Updates"}],"type":"payments.PaymentResult"},{"id":"1342771681","predicate":"payments.paymentReceipt","params":[{"name":"flags","type":"#"},{"name":"date","type":"int"},{"name":"bot_id","type":"int"},{"name":"invoice","type":"Invoice"},{"name":"provider_id","type":"int"},{"name":"info","type":"flags.0?PaymentRequestedInfo"},{"name":"shipping","type":"flags.1?ShippingOption"},{"name":"currency","type":"string"},{"name":"total_amount","type":"long"},{"name":"credentials_title","type":"string"},{"name":"users","type":"Vector"}],"type":"payments.PaymentReceipt"},{"id":"-74456004","predicate":"payments.savedInfo","params":[{"name":"flags","type":"#"},{"name":"has_saved_credentials","type":"flags.1?true"},{"name":"saved_info","type":"flags.0?PaymentRequestedInfo"}],"type":"payments.SavedInfo"},{"id":"-1056001329","predicate":"inputPaymentCredentialsSaved","params":[{"name":"id","type":"string"},{"name":"tmp_password","type":"bytes"}],"type":"InputPaymentCredentials"},{"id":"873977640","predicate":"inputPaymentCredentials","params":[{"name":"flags","type":"#"},{"name":"save","type":"flags.0?true"},{"name":"data","type":"DataJSON"}],"type":"InputPaymentCredentials"},{"id":"-614138572","predicate":"account.tmpPassword","params":[{"name":"tmp_password","type":"bytes"},{"name":"valid_until","type":"int"}],"type":"account.TmpPassword"},{"id":"-1239335713","predicate":"shippingOption","params":[{"name":"id","type":"string"},{"name":"title","type":"string"},{"name":"prices","type":"Vector"}],"type":"ShippingOption"},{"id":"-523384512","predicate":"updateBotShippingQuery","params":[{"name":"query_id","type":"long"},{"name":"user_id","type":"int"},{"name":"payload","type":"bytes"},{"name":"shipping_address","type":"PostAddress"}],"type":"Update"},{"id":"1563376297","predicate":"updateBotPrecheckoutQuery","params":[{"name":"flags","type":"#"},{"name":"query_id","type":"long"},{"name":"user_id","type":"int"},{"name":"payload","type":"bytes"},{"name":"info","type":"flags.0?PaymentRequestedInfo"},{"name":"shipping_option_id","type":"flags.1?string"},{"name":"currency","type":"string"},{"name":"total_amount","type":"long"}],"type":"Update"},{"id":"-6249322","predicate":"inputStickerSetItem","params":[{"name":"flags","type":"#"},{"name":"document","type":"InputDocument"},{"name":"emoji","type":"string"},{"name":"mask_coords","type":"flags.0?MaskCoords"}],"type":"InputStickerSetItem"},{"id":"-1425052898","predicate":"updatePhoneCall","params":[{"name":"phone_call","type":"PhoneCall"}],"type":"Update"},{"id":"506920429","predicate":"inputPhoneCall","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputPhoneCall"},{"id":"1399245077","predicate":"phoneCallEmpty","params":[{"name":"id","type":"long"}],"type":"PhoneCall"},{"id":"462375633","predicate":"phoneCallWaiting","params":[{"name":"flags","type":"#"},{"name":"video","type":"flags.6?true"},{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"admin_id","type":"int"},{"name":"participant_id","type":"int"},{"name":"protocol","type":"PhoneCallProtocol"},{"name":"receive_date","type":"flags.0?int"}],"type":"PhoneCall"},{"id":"-2014659757","predicate":"phoneCallRequested","params":[{"name":"flags","type":"#"},{"name":"video","type":"flags.6?true"},{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"admin_id","type":"int"},{"name":"participant_id","type":"int"},{"name":"g_a_hash","type":"bytes"},{"name":"protocol","type":"PhoneCallProtocol"}],"type":"PhoneCall"},{"id":"-1719909046","predicate":"phoneCallAccepted","params":[{"name":"flags","type":"#"},{"name":"video","type":"flags.6?true"},{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"admin_id","type":"int"},{"name":"participant_id","type":"int"},{"name":"g_b","type":"bytes"},{"name":"protocol","type":"PhoneCallProtocol"}],"type":"PhoneCall"},{"id":"-2025673089","predicate":"phoneCall","params":[{"name":"flags","type":"#"},{"name":"p2p_allowed","type":"flags.5?true"},{"name":"video","type":"flags.6?true"},{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"admin_id","type":"int"},{"name":"participant_id","type":"int"},{"name":"g_a_or_b","type":"bytes"},{"name":"key_fingerprint","type":"long"},{"name":"protocol","type":"PhoneCallProtocol"},{"name":"connections","type":"Vector"},{"name":"start_date","type":"int"}],"type":"PhoneCall"},{"id":"1355435489","predicate":"phoneCallDiscarded","params":[{"name":"flags","type":"#"},{"name":"need_rating","type":"flags.2?true"},{"name":"need_debug","type":"flags.3?true"},{"name":"video","type":"flags.6?true"},{"name":"id","type":"long"},{"name":"reason","type":"flags.0?PhoneCallDiscardReason"},{"name":"duration","type":"flags.1?int"}],"type":"PhoneCall"},{"id":"-1655957568","predicate":"phoneConnection","params":[{"name":"id","type":"long"},{"name":"ip","type":"string"},{"name":"ipv6","type":"string"},{"name":"port","type":"int"},{"name":"peer_tag","type":"bytes"}],"type":"PhoneConnection"},{"id":"-58224696","predicate":"phoneCallProtocol","params":[{"name":"flags","type":"#"},{"name":"udp_p2p","type":"flags.0?true"},{"name":"udp_reflector","type":"flags.1?true"},{"name":"min_layer","type":"int"},{"name":"max_layer","type":"int"},{"name":"library_versions","type":"Vector"}],"type":"PhoneCallProtocol"},{"id":"-326966976","predicate":"phone.phoneCall","params":[{"name":"phone_call","type":"PhoneCall"},{"name":"users","type":"Vector"}],"type":"phone.PhoneCall"},{"id":"-2134272152","predicate":"inputMessagesFilterPhoneCalls","params":[{"name":"flags","type":"#"},{"name":"missed","type":"flags.0?true"}],"type":"MessagesFilter"},{"id":"-2132731265","predicate":"messageActionPhoneCall","params":[{"name":"flags","type":"#"},{"name":"video","type":"flags.2?true"},{"name":"call_id","type":"long"},{"name":"reason","type":"flags.0?PhoneCallDiscardReason"},{"name":"duration","type":"flags.1?int"}],"type":"MessageAction"},{"id":"2054952868","predicate":"inputMessagesFilterRoundVoice","params":[],"type":"MessagesFilter"},{"id":"-1253451181","predicate":"inputMessagesFilterRoundVideo","params":[],"type":"MessagesFilter"},{"id":"-1997373508","predicate":"sendMessageRecordRoundAction","params":[],"type":"SendMessageAction"},{"id":"608050278","predicate":"sendMessageUploadRoundAction","params":[{"name":"progress","type":"int"}],"type":"SendMessageAction"},{"id":"-242427324","predicate":"upload.fileCdnRedirect","params":[{"name":"dc_id","type":"int"},{"name":"file_token","type":"bytes"},{"name":"encryption_key","type":"bytes"},{"name":"encryption_iv","type":"bytes"},{"name":"file_hashes","type":"Vector"}],"type":"upload.File"},{"id":"-290921362","predicate":"upload.cdnFileReuploadNeeded","params":[{"name":"request_token","type":"bytes"}],"type":"upload.CdnFile"},{"id":"-1449145777","predicate":"upload.cdnFile","params":[{"name":"bytes","type":"bytes"}],"type":"upload.CdnFile"},{"id":"-914167110","predicate":"cdnPublicKey","params":[{"name":"dc_id","type":"int"},{"name":"public_key","type":"string"}],"type":"CdnPublicKey"},{"id":"1462101002","predicate":"cdnConfig","params":[{"name":"public_keys","type":"Vector"}],"type":"CdnConfig"},{"id":"-283684427","predicate":"pageBlockChannel","params":[{"name":"channel","type":"Chat"}],"type":"PageBlock"},{"id":"-892239370","predicate":"langPackString","params":[{"name":"key","type":"string"},{"name":"value","type":"string"}],"type":"LangPackString"},{"id":"1816636575","predicate":"langPackStringPluralized","params":[{"name":"flags","type":"#"},{"name":"key","type":"string"},{"name":"zero_value","type":"flags.0?string"},{"name":"one_value","type":"flags.1?string"},{"name":"two_value","type":"flags.2?string"},{"name":"few_value","type":"flags.3?string"},{"name":"many_value","type":"flags.4?string"},{"name":"other_value","type":"string"}],"type":"LangPackString"},{"id":"695856818","predicate":"langPackStringDeleted","params":[{"name":"key","type":"string"}],"type":"LangPackString"},{"id":"-209337866","predicate":"langPackDifference","params":[{"name":"lang_code","type":"string"},{"name":"from_version","type":"int"},{"name":"version","type":"int"},{"name":"strings","type":"Vector"}],"type":"LangPackDifference"},{"id":"-288727837","predicate":"langPackLanguage","params":[{"name":"flags","type":"#"},{"name":"official","type":"flags.0?true"},{"name":"rtl","type":"flags.2?true"},{"name":"beta","type":"flags.3?true"},{"name":"name","type":"string"},{"name":"native_name","type":"string"},{"name":"lang_code","type":"string"},{"name":"base_lang_code","type":"flags.1?string"},{"name":"plural_code","type":"string"},{"name":"strings_count","type":"int"},{"name":"translated_count","type":"int"},{"name":"translations_url","type":"string"}],"type":"LangPackLanguage"},{"id":"1180041828","predicate":"updateLangPackTooLong","params":[{"name":"lang_code","type":"string"}],"type":"Update"},{"id":"1442983757","predicate":"updateLangPack","params":[{"name":"difference","type":"LangPackDifference"}],"type":"Update"},{"id":"-859915345","predicate":"channelParticipantAdmin","params":[{"name":"flags","type":"#"},{"name":"can_edit","type":"flags.0?true"},{"name":"self","type":"flags.1?true"},{"name":"user_id","type":"int"},{"name":"inviter_id","type":"flags.1?int"},{"name":"promoted_by","type":"int"},{"name":"date","type":"int"},{"name":"admin_rights","type":"ChatAdminRights"},{"name":"rank","type":"flags.2?string"}],"type":"ChannelParticipant"},{"id":"470789295","predicate":"channelParticipantBanned","params":[{"name":"flags","type":"#"},{"name":"left","type":"flags.0?true"},{"name":"user_id","type":"int"},{"name":"kicked_by","type":"int"},{"name":"date","type":"int"},{"name":"banned_rights","type":"ChatBannedRights"}],"type":"ChannelParticipant"},{"id":"338142689","predicate":"channelParticipantsBanned","params":[{"name":"q","type":"string"}],"type":"ChannelParticipantsFilter"},{"id":"106343499","predicate":"channelParticipantsSearch","params":[{"name":"q","type":"string"}],"type":"ChannelParticipantsFilter"},{"id":"-421545947","predicate":"channelAdminLogEventActionChangeTitle","params":[{"name":"prev_value","type":"string"},{"name":"new_value","type":"string"}],"type":"ChannelAdminLogEventAction"},{"id":"1427671598","predicate":"channelAdminLogEventActionChangeAbout","params":[{"name":"prev_value","type":"string"},{"name":"new_value","type":"string"}],"type":"ChannelAdminLogEventAction"},{"id":"1783299128","predicate":"channelAdminLogEventActionChangeUsername","params":[{"name":"prev_value","type":"string"},{"name":"new_value","type":"string"}],"type":"ChannelAdminLogEventAction"},{"id":"1129042607","predicate":"channelAdminLogEventActionChangePhoto","params":[{"name":"prev_photo","type":"Photo"},{"name":"new_photo","type":"Photo"}],"type":"ChannelAdminLogEventAction"},{"id":"460916654","predicate":"channelAdminLogEventActionToggleInvites","params":[{"name":"new_value","type":"Bool"}],"type":"ChannelAdminLogEventAction"},{"id":"648939889","predicate":"channelAdminLogEventActionToggleSignatures","params":[{"name":"new_value","type":"Bool"}],"type":"ChannelAdminLogEventAction"},{"id":"-370660328","predicate":"channelAdminLogEventActionUpdatePinned","params":[{"name":"message","type":"Message"}],"type":"ChannelAdminLogEventAction"},{"id":"1889215493","predicate":"channelAdminLogEventActionEditMessage","params":[{"name":"prev_message","type":"Message"},{"name":"new_message","type":"Message"}],"type":"ChannelAdminLogEventAction"},{"id":"1121994683","predicate":"channelAdminLogEventActionDeleteMessage","params":[{"name":"message","type":"Message"}],"type":"ChannelAdminLogEventAction"},{"id":"405815507","predicate":"channelAdminLogEventActionParticipantJoin","params":[],"type":"ChannelAdminLogEventAction"},{"id":"-124291086","predicate":"channelAdminLogEventActionParticipantLeave","params":[],"type":"ChannelAdminLogEventAction"},{"id":"-484690728","predicate":"channelAdminLogEventActionParticipantInvite","params":[{"name":"participant","type":"ChannelParticipant"}],"type":"ChannelAdminLogEventAction"},{"id":"-422036098","predicate":"channelAdminLogEventActionParticipantToggleBan","params":[{"name":"prev_participant","type":"ChannelParticipant"},{"name":"new_participant","type":"ChannelParticipant"}],"type":"ChannelAdminLogEventAction"},{"id":"-714643696","predicate":"channelAdminLogEventActionParticipantToggleAdmin","params":[{"name":"prev_participant","type":"ChannelParticipant"},{"name":"new_participant","type":"ChannelParticipant"}],"type":"ChannelAdminLogEventAction"},{"id":"995769920","predicate":"channelAdminLogEvent","params":[{"name":"id","type":"long"},{"name":"date","type":"int"},{"name":"user_id","type":"int"},{"name":"action","type":"ChannelAdminLogEventAction"}],"type":"ChannelAdminLogEvent"},{"id":"-309659827","predicate":"channels.adminLogResults","params":[{"name":"events","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"channels.AdminLogResults"},{"id":"-368018716","predicate":"channelAdminLogEventsFilter","params":[{"name":"flags","type":"#"},{"name":"join","type":"flags.0?true"},{"name":"leave","type":"flags.1?true"},{"name":"invite","type":"flags.2?true"},{"name":"ban","type":"flags.3?true"},{"name":"unban","type":"flags.4?true"},{"name":"kick","type":"flags.5?true"},{"name":"unkick","type":"flags.6?true"},{"name":"promote","type":"flags.7?true"},{"name":"demote","type":"flags.8?true"},{"name":"info","type":"flags.9?true"},{"name":"settings","type":"flags.10?true"},{"name":"pinned","type":"flags.11?true"},{"name":"edit","type":"flags.12?true"},{"name":"delete","type":"flags.13?true"},{"name":"group_call","type":"flags.14?true"},{"name":"invites","type":"flags.15?true"}],"type":"ChannelAdminLogEventsFilter"},{"id":"511092620","predicate":"topPeerCategoryPhoneCalls","params":[],"type":"TopPeerCategory"},{"id":"-2143067670","predicate":"pageBlockAudio","params":[{"name":"audio_id","type":"long"},{"name":"caption","type":"PageCaption"}],"type":"PageBlock"},{"id":"1558266229","predicate":"popularContact","params":[{"name":"client_id","type":"long"},{"name":"importers","type":"int"}],"type":"PopularContact"},{"id":"1200788123","predicate":"messageActionScreenshotTaken","params":[],"type":"MessageAction"},{"id":"-1634752813","predicate":"messages.favedStickersNotModified","params":[],"type":"messages.FavedStickers"},{"id":"-209768682","predicate":"messages.favedStickers","params":[{"name":"hash","type":"int"},{"name":"packs","type":"Vector"},{"name":"stickers","type":"Vector"}],"type":"messages.FavedStickers"},{"id":"-451831443","predicate":"updateFavedStickers","params":[],"type":"Update"},{"id":"-1987495099","predicate":"updateChannelReadMessagesContents","params":[{"name":"channel_id","type":"int"},{"name":"messages","type":"Vector"}],"type":"Update"},{"id":"-1040652646","predicate":"inputMessagesFilterMyMentions","params":[],"type":"MessagesFilter"},{"id":"1887741886","predicate":"updateContactsReset","params":[],"type":"Update"},{"id":"-1312568665","predicate":"channelAdminLogEventActionChangeStickerSet","params":[{"name":"prev_stickerset","type":"InputStickerSet"},{"name":"new_stickerset","type":"InputStickerSet"}],"type":"ChannelAdminLogEventAction"},{"id":"-85549226","predicate":"messageActionCustomAction","params":[{"name":"message","type":"string"}],"type":"MessageAction"},{"id":"178373535","predicate":"inputPaymentCredentialsApplePay","params":[{"name":"payment_data","type":"DataJSON"}],"type":"InputPaymentCredentials"},{"id":"-905587442","predicate":"inputPaymentCredentialsAndroidPay","params":[{"name":"payment_token","type":"DataJSON"},{"name":"google_transaction_id","type":"string"}],"type":"InputPaymentCredentials"},{"id":"-419271411","predicate":"inputMessagesFilterGeo","params":[],"type":"MessagesFilter"},{"id":"-530392189","predicate":"inputMessagesFilterContacts","params":[],"type":"MessagesFilter"},{"id":"1893427255","predicate":"updateChannelAvailableMessages","params":[{"name":"channel_id","type":"int"},{"name":"available_min_id","type":"int"}],"type":"Update"},{"id":"1599903217","predicate":"channelAdminLogEventActionTogglePreHistoryHidden","params":[{"name":"new_value","type":"Bool"}],"type":"ChannelAdminLogEventAction"},{"id":"-1759532989","predicate":"inputMediaGeoLive","params":[{"name":"flags","type":"#"},{"name":"stopped","type":"flags.0?true"},{"name":"geo_point","type":"InputGeoPoint"},{"name":"heading","type":"flags.2?int"},{"name":"period","type":"flags.1?int"},{"name":"proximity_notification_radius","type":"flags.3?int"}],"type":"InputMedia"},{"id":"-1186937242","predicate":"messageMediaGeoLive","params":[{"name":"flags","type":"#"},{"name":"geo","type":"GeoPoint"},{"name":"heading","type":"flags.0?int"},{"name":"period","type":"int"},{"name":"proximity_notification_radius","type":"flags.1?int"}],"type":"MessageMedia"},{"id":"1189204285","predicate":"recentMeUrlUnknown","params":[{"name":"url","type":"string"}],"type":"RecentMeUrl"},{"id":"-1917045962","predicate":"recentMeUrlUser","params":[{"name":"url","type":"string"},{"name":"user_id","type":"int"}],"type":"RecentMeUrl"},{"id":"-1608834311","predicate":"recentMeUrlChat","params":[{"name":"url","type":"string"},{"name":"chat_id","type":"int"}],"type":"RecentMeUrl"},{"id":"-347535331","predicate":"recentMeUrlChatInvite","params":[{"name":"url","type":"string"},{"name":"chat_invite","type":"ChatInvite"}],"type":"RecentMeUrl"},{"id":"-1140172836","predicate":"recentMeUrlStickerSet","params":[{"name":"url","type":"string"},{"name":"set","type":"StickerSetCovered"}],"type":"RecentMeUrl"},{"id":"235081943","predicate":"help.recentMeUrls","params":[{"name":"urls","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"help.RecentMeUrls"},{"id":"-266911767","predicate":"channels.channelParticipantsNotModified","params":[],"type":"channels.ChannelParticipants"},{"id":"1951620897","predicate":"messages.messagesNotModified","params":[{"name":"count","type":"int"}],"type":"messages.Messages"},{"id":"482797855","predicate":"inputSingleMedia","params":[{"name":"flags","type":"#"},{"name":"media","type":"InputMedia"},{"name":"random_id","type":"long"},{"name":"message","type":"string"},{"name":"entities","type":"flags.0?Vector"}],"type":"InputSingleMedia"},{"id":"-892779534","predicate":"webAuthorization","params":[{"name":"hash","type":"long"},{"name":"bot_id","type":"int"},{"name":"domain","type":"string"},{"name":"browser","type":"string"},{"name":"platform","type":"string"},{"name":"date_created","type":"int"},{"name":"date_active","type":"int"},{"name":"ip","type":"string"},{"name":"region","type":"string"}],"type":"WebAuthorization"},{"id":"-313079300","predicate":"account.webAuthorizations","params":[{"name":"authorizations","type":"Vector"},{"name":"users","type":"Vector"}],"type":"account.WebAuthorizations"},{"id":"-1502174430","predicate":"inputMessageID","params":[{"name":"id","type":"int"}],"type":"InputMessage"},{"id":"-1160215659","predicate":"inputMessageReplyTo","params":[{"name":"id","type":"int"}],"type":"InputMessage"},{"id":"-2037963464","predicate":"inputMessagePinned","params":[],"type":"InputMessage"},{"id":"-1687559349","predicate":"messageEntityPhone","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity"},{"id":"1280209983","predicate":"messageEntityCashtag","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity"},{"id":"-1410748418","predicate":"messageActionBotAllowed","params":[{"name":"domain","type":"string"}],"type":"MessageAction"},{"id":"-55902537","predicate":"inputDialogPeer","params":[{"name":"peer","type":"InputPeer"}],"type":"InputDialogPeer"},{"id":"-445792507","predicate":"dialogPeer","params":[{"name":"peer","type":"Peer"}],"type":"DialogPeer"},{"id":"223655517","predicate":"messages.foundStickerSetsNotModified","params":[],"type":"messages.FoundStickerSets"},{"id":"1359533640","predicate":"messages.foundStickerSets","params":[{"name":"hash","type":"int"},{"name":"sets","type":"Vector"}],"type":"messages.FoundStickerSets"},{"id":"1648543603","predicate":"fileHash","params":[{"name":"offset","type":"int"},{"name":"limit","type":"int"},{"name":"hash","type":"bytes"}],"type":"FileHash"},{"id":"-104284986","predicate":"webDocumentNoProxy","params":[{"name":"url","type":"string"},{"name":"size","type":"int"},{"name":"mime_type","type":"string"},{"name":"attributes","type":"Vector"}],"type":"WebDocument"},{"id":"1968737087","predicate":"inputClientProxy","params":[{"name":"address","type":"string"},{"name":"port","type":"int"}],"type":"InputClientProxy"},{"id":"-483352705","predicate":"help.termsOfServiceUpdateEmpty","params":[{"name":"expires","type":"int"}],"type":"help.TermsOfServiceUpdate"},{"id":"686618977","predicate":"help.termsOfServiceUpdate","params":[{"name":"expires","type":"int"},{"name":"terms_of_service","type":"help.TermsOfService"}],"type":"help.TermsOfServiceUpdate"},{"id":"859091184","predicate":"inputSecureFileUploaded","params":[{"name":"id","type":"long"},{"name":"parts","type":"int"},{"name":"md5_checksum","type":"string"},{"name":"file_hash","type":"bytes"},{"name":"secret","type":"bytes"}],"type":"InputSecureFile"},{"id":"1399317950","predicate":"inputSecureFile","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputSecureFile"},{"id":"-876089816","predicate":"inputSecureFileLocation","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputFileLocation"},{"id":"1679398724","predicate":"secureFileEmpty","params":[],"type":"SecureFile"},{"id":"-534283678","predicate":"secureFile","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"size","type":"int"},{"name":"dc_id","type":"int"},{"name":"date","type":"int"},{"name":"file_hash","type":"bytes"},{"name":"secret","type":"bytes"}],"type":"SecureFile"},{"id":"-1964327229","predicate":"secureData","params":[{"name":"data","type":"bytes"},{"name":"data_hash","type":"bytes"},{"name":"secret","type":"bytes"}],"type":"SecureData"},{"id":"2103482845","predicate":"securePlainPhone","params":[{"name":"phone","type":"string"}],"type":"SecurePlainData"},{"id":"569137759","predicate":"securePlainEmail","params":[{"name":"email","type":"string"}],"type":"SecurePlainData"},{"id":"-1658158621","predicate":"secureValueTypePersonalDetails","params":[],"type":"SecureValueType"},{"id":"1034709504","predicate":"secureValueTypePassport","params":[],"type":"SecureValueType"},{"id":"115615172","predicate":"secureValueTypeDriverLicense","params":[],"type":"SecureValueType"},{"id":"-1596951477","predicate":"secureValueTypeIdentityCard","params":[],"type":"SecureValueType"},{"id":"-1717268701","predicate":"secureValueTypeInternalPassport","params":[],"type":"SecureValueType"},{"id":"-874308058","predicate":"secureValueTypeAddress","params":[],"type":"SecureValueType"},{"id":"-63531698","predicate":"secureValueTypeUtilityBill","params":[],"type":"SecureValueType"},{"id":"-1995211763","predicate":"secureValueTypeBankStatement","params":[],"type":"SecureValueType"},{"id":"-1954007928","predicate":"secureValueTypeRentalAgreement","params":[],"type":"SecureValueType"},{"id":"-1713143702","predicate":"secureValueTypePassportRegistration","params":[],"type":"SecureValueType"},{"id":"-368907213","predicate":"secureValueTypeTemporaryRegistration","params":[],"type":"SecureValueType"},{"id":"-1289704741","predicate":"secureValueTypePhone","params":[],"type":"SecureValueType"},{"id":"-1908627474","predicate":"secureValueTypeEmail","params":[],"type":"SecureValueType"},{"id":"411017418","predicate":"secureValue","params":[{"name":"flags","type":"#"},{"name":"type","type":"SecureValueType"},{"name":"data","type":"flags.0?SecureData"},{"name":"front_side","type":"flags.1?SecureFile"},{"name":"reverse_side","type":"flags.2?SecureFile"},{"name":"selfie","type":"flags.3?SecureFile"},{"name":"translation","type":"flags.6?Vector"},{"name":"files","type":"flags.4?Vector"},{"name":"plain_data","type":"flags.5?SecurePlainData"},{"name":"hash","type":"bytes"}],"type":"SecureValue"},{"id":"-618540889","predicate":"inputSecureValue","params":[{"name":"flags","type":"#"},{"name":"type","type":"SecureValueType"},{"name":"data","type":"flags.0?SecureData"},{"name":"front_side","type":"flags.1?InputSecureFile"},{"name":"reverse_side","type":"flags.2?InputSecureFile"},{"name":"selfie","type":"flags.3?InputSecureFile"},{"name":"translation","type":"flags.6?Vector"},{"name":"files","type":"flags.4?Vector"},{"name":"plain_data","type":"flags.5?SecurePlainData"}],"type":"InputSecureValue"},{"id":"-316748368","predicate":"secureValueHash","params":[{"name":"type","type":"SecureValueType"},{"name":"hash","type":"bytes"}],"type":"SecureValueHash"},{"id":"-391902247","predicate":"secureValueErrorData","params":[{"name":"type","type":"SecureValueType"},{"name":"data_hash","type":"bytes"},{"name":"field","type":"string"},{"name":"text","type":"string"}],"type":"SecureValueError"},{"id":"12467706","predicate":"secureValueErrorFrontSide","params":[{"name":"type","type":"SecureValueType"},{"name":"file_hash","type":"bytes"},{"name":"text","type":"string"}],"type":"SecureValueError"},{"id":"-2037765467","predicate":"secureValueErrorReverseSide","params":[{"name":"type","type":"SecureValueType"},{"name":"file_hash","type":"bytes"},{"name":"text","type":"string"}],"type":"SecureValueError"},{"id":"-449327402","predicate":"secureValueErrorSelfie","params":[{"name":"type","type":"SecureValueType"},{"name":"file_hash","type":"bytes"},{"name":"text","type":"string"}],"type":"SecureValueError"},{"id":"2054162547","predicate":"secureValueErrorFile","params":[{"name":"type","type":"SecureValueType"},{"name":"file_hash","type":"bytes"},{"name":"text","type":"string"}],"type":"SecureValueError"},{"id":"1717706985","predicate":"secureValueErrorFiles","params":[{"name":"type","type":"SecureValueType"},{"name":"file_hash","type":"Vector"},{"name":"text","type":"string"}],"type":"SecureValueError"},{"id":"871426631","predicate":"secureCredentialsEncrypted","params":[{"name":"data","type":"bytes"},{"name":"hash","type":"bytes"},{"name":"secret","type":"bytes"}],"type":"SecureCredentialsEncrypted"},{"id":"-1389486888","predicate":"account.authorizationForm","params":[{"name":"flags","type":"#"},{"name":"required_types","type":"Vector"},{"name":"values","type":"Vector"},{"name":"errors","type":"Vector"},{"name":"users","type":"Vector"},{"name":"privacy_policy_url","type":"flags.0?string"}],"type":"account.AuthorizationForm"},{"id":"-2128640689","predicate":"account.sentEmailCode","params":[{"name":"email_pattern","type":"string"},{"name":"length","type":"int"}],"type":"account.SentEmailCode"},{"id":"455635795","predicate":"messageActionSecureValuesSentMe","params":[{"name":"values","type":"Vector"},{"name":"credentials","type":"SecureCredentialsEncrypted"}],"type":"MessageAction"},{"id":"-648257196","predicate":"messageActionSecureValuesSent","params":[{"name":"types","type":"Vector"}],"type":"MessageAction"},{"id":"1722786150","predicate":"help.deepLinkInfoEmpty","params":[],"type":"help.DeepLinkInfo"},{"id":"1783556146","predicate":"help.deepLinkInfo","params":[{"name":"flags","type":"#"},{"name":"update_app","type":"flags.0?true"},{"name":"message","type":"string"},{"name":"entities","type":"flags.1?Vector"}],"type":"help.DeepLinkInfo"},{"id":"289586518","predicate":"savedPhoneContact","params":[{"name":"phone","type":"string"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"date","type":"int"}],"type":"SavedContact"},{"id":"1304052993","predicate":"account.takeout","params":[{"name":"id","type":"long"}],"type":"account.Takeout"},{"id":"700340377","predicate":"inputTakeoutFileLocation","params":[],"type":"InputFileLocation"},{"id":"-513517117","predicate":"updateDialogUnreadMark","params":[{"name":"flags","type":"#"},{"name":"unread","type":"flags.0?true"},{"name":"peer","type":"DialogPeer"}],"type":"Update"},{"id":"-253500010","predicate":"messages.dialogsNotModified","params":[{"name":"count","type":"int"}],"type":"messages.Dialogs"},{"id":"-1625153079","predicate":"inputWebFileGeoPointLocation","params":[{"name":"geo_point","type":"InputGeoPoint"},{"name":"access_hash","type":"long"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"zoom","type":"int"},{"name":"scale","type":"int"}],"type":"InputWebFileLocation"},{"id":"-1255369827","predicate":"contacts.topPeersDisabled","params":[],"type":"contacts.TopPeers"},{"id":"-1685456582","predicate":"inputReportReasonCopyright","params":[],"type":"ReportReason"},{"id":"-732254058","predicate":"passwordKdfAlgoUnknown","params":[],"type":"PasswordKdfAlgo"},{"id":"4883767","predicate":"securePasswordKdfAlgoUnknown","params":[],"type":"SecurePasswordKdfAlgo"},{"id":"-1141711456","predicate":"securePasswordKdfAlgoPBKDF2HMACSHA512iter100000","params":[{"name":"salt","type":"bytes"}],"type":"SecurePasswordKdfAlgo"},{"id":"-2042159726","predicate":"securePasswordKdfAlgoSHA512","params":[{"name":"salt","type":"bytes"}],"type":"SecurePasswordKdfAlgo"},{"id":"354925740","predicate":"secureSecretSettings","params":[{"name":"secure_algo","type":"SecurePasswordKdfAlgo"},{"name":"secure_secret","type":"bytes"},{"name":"secure_secret_id","type":"long"}],"type":"SecureSecretSettings"},{"id":"982592842","predicate":"passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow","params":[{"name":"salt1","type":"bytes"},{"name":"salt2","type":"bytes"},{"name":"g","type":"int"},{"name":"p","type":"bytes"}],"type":"PasswordKdfAlgo"},{"id":"-1736378792","predicate":"inputCheckPasswordEmpty","params":[],"type":"InputCheckPasswordSRP"},{"id":"-763367294","predicate":"inputCheckPasswordSRP","params":[{"name":"srp_id","type":"long"},{"name":"A","type":"bytes"},{"name":"M1","type":"bytes"}],"type":"InputCheckPasswordSRP"},{"id":"-2036501105","predicate":"secureValueError","params":[{"name":"type","type":"SecureValueType"},{"name":"hash","type":"bytes"},{"name":"text","type":"string"}],"type":"SecureValueError"},{"id":"-1592506512","predicate":"secureValueErrorTranslationFile","params":[{"name":"type","type":"SecureValueType"},{"name":"file_hash","type":"bytes"},{"name":"text","type":"string"}],"type":"SecureValueError"},{"id":"878931416","predicate":"secureValueErrorTranslationFiles","params":[{"name":"type","type":"SecureValueType"},{"name":"file_hash","type":"Vector"},{"name":"text","type":"string"}],"type":"SecureValueError"},{"id":"-2103600678","predicate":"secureRequiredType","params":[{"name":"flags","type":"#"},{"name":"native_names","type":"flags.0?true"},{"name":"selfie_required","type":"flags.1?true"},{"name":"translation_required","type":"flags.2?true"},{"name":"type","type":"SecureValueType"}],"type":"SecureRequiredType"},{"id":"41187252","predicate":"secureRequiredTypeOneOf","params":[{"name":"types","type":"Vector"}],"type":"SecureRequiredType"},{"id":"-1078332329","predicate":"help.passportConfigNotModified","params":[],"type":"help.PassportConfig"},{"id":"-1600596305","predicate":"help.passportConfig","params":[{"name":"hash","type":"int"},{"name":"countries_langs","type":"DataJSON"}],"type":"help.PassportConfig"},{"id":"488313413","predicate":"inputAppEvent","params":[{"name":"time","type":"double"},{"name":"type","type":"string"},{"name":"peer","type":"long"},{"name":"data","type":"JSONValue"}],"type":"InputAppEvent"},{"id":"-1059185703","predicate":"jsonObjectValue","params":[{"name":"key","type":"string"},{"name":"value","type":"JSONValue"}],"type":"JSONObjectValue"},{"id":"1064139624","predicate":"jsonNull","params":[],"type":"JSONValue"},{"id":"-952869270","predicate":"jsonBool","params":[{"name":"value","type":"Bool"}],"type":"JSONValue"},{"id":"736157604","predicate":"jsonNumber","params":[{"name":"value","type":"double"}],"type":"JSONValue"},{"id":"-1222740358","predicate":"jsonString","params":[{"name":"value","type":"string"}],"type":"JSONValue"},{"id":"-146520221","predicate":"jsonArray","params":[{"name":"value","type":"Vector"}],"type":"JSONValue"},{"id":"-1715350371","predicate":"jsonObject","params":[{"name":"value","type":"Vector"}],"type":"JSONValue"},{"id":"-1311015810","predicate":"inputNotifyBroadcasts","params":[],"type":"InputNotifyPeer"},{"id":"-703403793","predicate":"notifyBroadcasts","params":[],"type":"NotifyPeer"},{"id":"-311786236","predicate":"textSubscript","params":[{"name":"text","type":"RichText"}],"type":"RichText"},{"id":"-939827711","predicate":"textSuperscript","params":[{"name":"text","type":"RichText"}],"type":"RichText"},{"id":"55281185","predicate":"textMarked","params":[{"name":"text","type":"RichText"}],"type":"RichText"},{"id":"483104362","predicate":"textPhone","params":[{"name":"text","type":"RichText"},{"name":"phone","type":"string"}],"type":"RichText"},{"id":"136105807","predicate":"textImage","params":[{"name":"document_id","type":"long"},{"name":"w","type":"int"},{"name":"h","type":"int"}],"type":"RichText"},{"id":"504660880","predicate":"pageBlockKicker","params":[{"name":"text","type":"RichText"}],"type":"PageBlock"},{"id":"878078826","predicate":"pageTableCell","params":[{"name":"flags","type":"#"},{"name":"header","type":"flags.0?true"},{"name":"align_center","type":"flags.3?true"},{"name":"align_right","type":"flags.4?true"},{"name":"valign_middle","type":"flags.5?true"},{"name":"valign_bottom","type":"flags.6?true"},{"name":"text","type":"flags.7?RichText"},{"name":"colspan","type":"flags.1?int"},{"name":"rowspan","type":"flags.2?int"}],"type":"PageTableCell"},{"id":"-524237339","predicate":"pageTableRow","params":[{"name":"cells","type":"Vector"}],"type":"PageTableRow"},{"id":"-1085412734","predicate":"pageBlockTable","params":[{"name":"flags","type":"#"},{"name":"bordered","type":"flags.0?true"},{"name":"striped","type":"flags.1?true"},{"name":"title","type":"RichText"},{"name":"rows","type":"Vector"}],"type":"PageBlock"},{"id":"1869903447","predicate":"pageCaption","params":[{"name":"text","type":"RichText"},{"name":"credit","type":"RichText"}],"type":"PageCaption"},{"id":"-1188055347","predicate":"pageListItemText","params":[{"name":"text","type":"RichText"}],"type":"PageListItem"},{"id":"635466748","predicate":"pageListItemBlocks","params":[{"name":"blocks","type":"Vector"}],"type":"PageListItem"},{"id":"1577484359","predicate":"pageListOrderedItemText","params":[{"name":"num","type":"string"},{"name":"text","type":"RichText"}],"type":"PageListOrderedItem"},{"id":"-1730311882","predicate":"pageListOrderedItemBlocks","params":[{"name":"num","type":"string"},{"name":"blocks","type":"Vector"}],"type":"PageListOrderedItem"},{"id":"-1702174239","predicate":"pageBlockOrderedList","params":[{"name":"items","type":"Vector"}],"type":"PageBlock"},{"id":"1987480557","predicate":"pageBlockDetails","params":[{"name":"flags","type":"#"},{"name":"open","type":"flags.0?true"},{"name":"blocks","type":"Vector"},{"name":"title","type":"RichText"}],"type":"PageBlock"},{"id":"-1282352120","predicate":"pageRelatedArticle","params":[{"name":"flags","type":"#"},{"name":"url","type":"string"},{"name":"webpage_id","type":"long"},{"name":"title","type":"flags.0?string"},{"name":"description","type":"flags.1?string"},{"name":"photo_id","type":"flags.2?long"},{"name":"author","type":"flags.3?string"},{"name":"published_date","type":"flags.4?int"}],"type":"PageRelatedArticle"},{"id":"370236054","predicate":"pageBlockRelatedArticles","params":[{"name":"title","type":"RichText"},{"name":"articles","type":"Vector"}],"type":"PageBlock"},{"id":"-1538310410","predicate":"pageBlockMap","params":[{"name":"geo","type":"GeoPoint"},{"name":"zoom","type":"int"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"caption","type":"PageCaption"}],"type":"PageBlock"},{"id":"-1738178803","predicate":"page","params":[{"name":"flags","type":"#"},{"name":"part","type":"flags.0?true"},{"name":"rtl","type":"flags.1?true"},{"name":"v2","type":"flags.2?true"},{"name":"url","type":"string"},{"name":"blocks","type":"Vector"},{"name":"photos","type":"Vector"},{"name":"documents","type":"Vector"},{"name":"views","type":"flags.3?int"}],"type":"Page"},{"id":"-610373422","predicate":"inputPrivacyKeyPhoneP2P","params":[],"type":"InputPrivacyKey"},{"id":"961092808","predicate":"privacyKeyPhoneP2P","params":[],"type":"PrivacyKey"},{"id":"894777186","predicate":"textAnchor","params":[{"name":"text","type":"RichText"},{"name":"name","type":"string"}],"type":"RichText"},{"id":"-1945767479","predicate":"help.supportName","params":[{"name":"name","type":"string"}],"type":"help.SupportName"},{"id":"-206688531","predicate":"help.userInfoEmpty","params":[],"type":"help.UserInfo"},{"id":"32192344","predicate":"help.userInfo","params":[{"name":"message","type":"string"},{"name":"entities","type":"Vector"},{"name":"author","type":"string"},{"name":"date","type":"int"}],"type":"help.UserInfo"},{"id":"-202219658","predicate":"messageActionContactSignUp","params":[],"type":"MessageAction"},{"id":"-1398708869","predicate":"updateMessagePoll","params":[{"name":"flags","type":"#"},{"name":"poll_id","type":"long"},{"name":"poll","type":"flags.0?Poll"},{"name":"results","type":"PollResults"}],"type":"Update"},{"id":"1823064809","predicate":"pollAnswer","params":[{"name":"text","type":"string"},{"name":"option","type":"bytes"}],"type":"PollAnswer"},{"id":"-2032041631","predicate":"poll","params":[{"name":"id","type":"long"},{"name":"flags","type":"#"},{"name":"closed","type":"flags.0?true"},{"name":"public_voters","type":"flags.1?true"},{"name":"multiple_choice","type":"flags.2?true"},{"name":"quiz","type":"flags.3?true"},{"name":"question","type":"string"},{"name":"answers","type":"Vector"},{"name":"close_period","type":"flags.4?int"},{"name":"close_date","type":"flags.5?int"}],"type":"Poll"},{"id":"997055186","predicate":"pollAnswerVoters","params":[{"name":"flags","type":"#"},{"name":"chosen","type":"flags.0?true"},{"name":"correct","type":"flags.1?true"},{"name":"option","type":"bytes"},{"name":"voters","type":"int"}],"type":"PollAnswerVoters"},{"id":"-1159937629","predicate":"pollResults","params":[{"name":"flags","type":"#"},{"name":"min","type":"flags.0?true"},{"name":"results","type":"flags.1?Vector"},{"name":"total_voters","type":"flags.2?int"},{"name":"recent_voters","type":"flags.3?Vector"},{"name":"solution","type":"flags.4?string"},{"name":"solution_entities","type":"flags.4?Vector"}],"type":"PollResults"},{"id":"261416433","predicate":"inputMediaPoll","params":[{"name":"flags","type":"#"},{"name":"poll","type":"Poll"},{"name":"correct_answers","type":"flags.0?Vector"},{"name":"solution","type":"flags.1?string"},{"name":"solution_entities","type":"flags.1?Vector"}],"type":"InputMedia"},{"id":"1272375192","predicate":"messageMediaPoll","params":[{"name":"poll","type":"Poll"},{"name":"results","type":"PollResults"}],"type":"MessageMedia"},{"id":"-264117680","predicate":"chatOnlines","params":[{"name":"onlines","type":"int"}],"type":"ChatOnlines"},{"id":"1202287072","predicate":"statsURL","params":[{"name":"url","type":"string"}],"type":"StatsURL"},{"id":"-525288402","predicate":"photoStrippedSize","params":[{"name":"type","type":"string"},{"name":"bytes","type":"bytes"}],"type":"PhotoSize"},{"id":"1605510357","predicate":"chatAdminRights","params":[{"name":"flags","type":"#"},{"name":"change_info","type":"flags.0?true"},{"name":"post_messages","type":"flags.1?true"},{"name":"edit_messages","type":"flags.2?true"},{"name":"delete_messages","type":"flags.3?true"},{"name":"ban_users","type":"flags.4?true"},{"name":"invite_users","type":"flags.5?true"},{"name":"pin_messages","type":"flags.7?true"},{"name":"add_admins","type":"flags.9?true"},{"name":"anonymous","type":"flags.10?true"},{"name":"manage_call","type":"flags.11?true"},{"name":"other","type":"flags.12?true"}],"type":"ChatAdminRights"},{"id":"-1626209256","predicate":"chatBannedRights","params":[{"name":"flags","type":"#"},{"name":"view_messages","type":"flags.0?true"},{"name":"send_messages","type":"flags.1?true"},{"name":"send_media","type":"flags.2?true"},{"name":"send_stickers","type":"flags.3?true"},{"name":"send_gifs","type":"flags.4?true"},{"name":"send_games","type":"flags.5?true"},{"name":"send_inline","type":"flags.6?true"},{"name":"embed_links","type":"flags.7?true"},{"name":"send_polls","type":"flags.8?true"},{"name":"change_info","type":"flags.10?true"},{"name":"invite_users","type":"flags.15?true"},{"name":"pin_messages","type":"flags.17?true"},{"name":"until_date","type":"int"}],"type":"ChatBannedRights"},{"id":"1421875280","predicate":"updateChatDefaultBannedRights","params":[{"name":"peer","type":"Peer"},{"name":"default_banned_rights","type":"ChatBannedRights"},{"name":"version","type":"int"}],"type":"Update"},{"id":"-433014407","predicate":"inputWallPaper","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputWallPaper"},{"id":"1913199744","predicate":"inputWallPaperSlug","params":[{"name":"slug","type":"string"}],"type":"InputWallPaper"},{"id":"-1150621555","predicate":"channelParticipantsContacts","params":[{"name":"q","type":"string"}],"type":"ChannelParticipantsFilter"},{"id":"771095562","predicate":"channelAdminLogEventActionDefaultBannedRights","params":[{"name":"prev_banned_rights","type":"ChatBannedRights"},{"name":"new_banned_rights","type":"ChatBannedRights"}],"type":"ChannelAdminLogEventAction"},{"id":"-1895328189","predicate":"channelAdminLogEventActionStopPoll","params":[{"name":"message","type":"Message"}],"type":"ChannelAdminLogEventAction"},{"id":"471437699","predicate":"account.wallPapersNotModified","params":[],"type":"account.WallPapers"},{"id":"1881892265","predicate":"account.wallPapers","params":[{"name":"hash","type":"int"},{"name":"wallpapers","type":"Vector"}],"type":"account.WallPapers"},{"id":"-557924733","predicate":"codeSettings","params":[{"name":"flags","type":"#"},{"name":"allow_flashcall","type":"flags.0?true"},{"name":"current_number","type":"flags.1?true"},{"name":"allow_app_hash","type":"flags.4?true"}],"type":"CodeSettings"},{"id":"84438264","predicate":"wallPaperSettings","params":[{"name":"flags","type":"#"},{"name":"blur","type":"flags.1?true"},{"name":"motion","type":"flags.2?true"},{"name":"background_color","type":"flags.0?int"},{"name":"second_background_color","type":"flags.4?int"},{"name":"intensity","type":"flags.3?int"},{"name":"rotation","type":"flags.4?int"}],"type":"WallPaperSettings"},{"id":"-532532493","predicate":"autoDownloadSettings","params":[{"name":"flags","type":"#"},{"name":"disabled","type":"flags.0?true"},{"name":"video_preload_large","type":"flags.1?true"},{"name":"audio_preload_next","type":"flags.2?true"},{"name":"phonecalls_less_data","type":"flags.3?true"},{"name":"photo_size_max","type":"int"},{"name":"video_size_max","type":"int"},{"name":"file_size_max","type":"int"},{"name":"video_upload_maxbitrate","type":"int"}],"type":"AutoDownloadSettings"},{"id":"1674235686","predicate":"account.autoDownloadSettings","params":[{"name":"low","type":"AutoDownloadSettings"},{"name":"medium","type":"AutoDownloadSettings"},{"name":"high","type":"AutoDownloadSettings"}],"type":"account.AutoDownloadSettings"},{"id":"-709641735","predicate":"emojiKeyword","params":[{"name":"keyword","type":"string"},{"name":"emoticons","type":"Vector"}],"type":"EmojiKeyword"},{"id":"594408994","predicate":"emojiKeywordDeleted","params":[{"name":"keyword","type":"string"},{"name":"emoticons","type":"Vector"}],"type":"EmojiKeyword"},{"id":"1556570557","predicate":"emojiKeywordsDifference","params":[{"name":"lang_code","type":"string"},{"name":"from_version","type":"int"},{"name":"version","type":"int"},{"name":"keywords","type":"Vector"}],"type":"EmojiKeywordsDifference"},{"id":"-1519029347","predicate":"emojiURL","params":[{"name":"url","type":"string"}],"type":"EmojiURL"},{"id":"-1275374751","predicate":"emojiLanguage","params":[{"name":"lang_code","type":"string"}],"type":"EmojiLanguage"},{"id":"-1529000952","predicate":"inputPrivacyKeyForwards","params":[],"type":"InputPrivacyKey"},{"id":"1777096355","predicate":"privacyKeyForwards","params":[],"type":"PrivacyKey"},{"id":"1461304012","predicate":"inputPrivacyKeyProfilePhoto","params":[],"type":"InputPrivacyKey"},{"id":"-1777000467","predicate":"privacyKeyProfilePhoto","params":[],"type":"PrivacyKey"},{"id":"-1132476723","predicate":"fileLocationToBeDeprecated","params":[{"name":"volume_id","type":"long"},{"name":"local_id","type":"int"}],"type":"FileLocation"},{"id":"1075322878","predicate":"inputPhotoFileLocation","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"file_reference","type":"bytes"},{"name":"thumb_size","type":"string"}],"type":"InputFileLocation"},{"id":"-667654413","predicate":"inputPhotoLegacyFileLocation","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"file_reference","type":"bytes"},{"name":"volume_id","type":"long"},{"name":"local_id","type":"int"},{"name":"secret","type":"long"}],"type":"InputFileLocation"},{"id":"668375447","predicate":"inputPeerPhotoFileLocation","params":[{"name":"flags","type":"#"},{"name":"big","type":"flags.0?true"},{"name":"peer","type":"InputPeer"},{"name":"volume_id","type":"long"},{"name":"local_id","type":"int"}],"type":"InputFileLocation"},{"id":"230353641","predicate":"inputStickerSetThumb","params":[{"name":"stickerset","type":"InputStickerSet"},{"name":"volume_id","type":"long"},{"name":"local_id","type":"int"}],"type":"InputFileLocation"},{"id":"-11252123","predicate":"folder","params":[{"name":"flags","type":"#"},{"name":"autofill_new_broadcasts","type":"flags.0?true"},{"name":"autofill_public_groups","type":"flags.1?true"},{"name":"autofill_new_correspondents","type":"flags.2?true"},{"name":"id","type":"int"},{"name":"title","type":"string"},{"name":"photo","type":"flags.3?ChatPhoto"}],"type":"Folder"},{"id":"1908216652","predicate":"dialogFolder","params":[{"name":"flags","type":"#"},{"name":"pinned","type":"flags.2?true"},{"name":"folder","type":"Folder"},{"name":"peer","type":"Peer"},{"name":"top_message","type":"int"},{"name":"unread_muted_peers_count","type":"int"},{"name":"unread_unmuted_peers_count","type":"int"},{"name":"unread_muted_messages_count","type":"int"},{"name":"unread_unmuted_messages_count","type":"int"}],"type":"Dialog"},{"id":"1684014375","predicate":"inputDialogPeerFolder","params":[{"name":"folder_id","type":"int"}],"type":"InputDialogPeer"},{"id":"1363483106","predicate":"dialogPeerFolder","params":[{"name":"folder_id","type":"int"}],"type":"DialogPeer"},{"id":"-70073706","predicate":"inputFolderPeer","params":[{"name":"peer","type":"InputPeer"},{"name":"folder_id","type":"int"}],"type":"InputFolderPeer"},{"id":"-373643672","predicate":"folderPeer","params":[{"name":"peer","type":"Peer"},{"name":"folder_id","type":"int"}],"type":"FolderPeer"},{"id":"422972864","predicate":"updateFolderPeers","params":[{"name":"folder_peers","type":"Vector"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"}],"type":"Update"},{"id":"756118935","predicate":"inputUserFromMessage","params":[{"name":"peer","type":"InputPeer"},{"name":"msg_id","type":"int"},{"name":"user_id","type":"int"}],"type":"InputUser"},{"id":"707290417","predicate":"inputChannelFromMessage","params":[{"name":"peer","type":"InputPeer"},{"name":"msg_id","type":"int"},{"name":"channel_id","type":"int"}],"type":"InputChannel"},{"id":"398123750","predicate":"inputPeerUserFromMessage","params":[{"name":"peer","type":"InputPeer"},{"name":"msg_id","type":"int"},{"name":"user_id","type":"int"}],"type":"InputPeer"},{"id":"-1667893317","predicate":"inputPeerChannelFromMessage","params":[{"name":"peer","type":"InputPeer"},{"name":"msg_id","type":"int"},{"name":"channel_id","type":"int"}],"type":"InputPeer"},{"id":"55761658","predicate":"inputPrivacyKeyPhoneNumber","params":[],"type":"InputPrivacyKey"},{"id":"-778378131","predicate":"privacyKeyPhoneNumber","params":[],"type":"PrivacyKey"},{"id":"-1472172887","predicate":"topPeerCategoryForwardUsers","params":[],"type":"TopPeerCategory"},{"id":"-68239120","predicate":"topPeerCategoryForwardChats","params":[],"type":"TopPeerCategory"},{"id":"-1569748965","predicate":"channelAdminLogEventActionChangeLinkedChat","params":[{"name":"prev_value","type":"int"},{"name":"new_value","type":"int"}],"type":"ChannelAdminLogEventAction"},{"id":"-398136321","predicate":"messages.searchCounter","params":[{"name":"flags","type":"#"},{"name":"inexact","type":"flags.1?true"},{"name":"filter","type":"MessagesFilter"},{"name":"count","type":"int"}],"type":"messages.SearchCounter"},{"id":"280464681","predicate":"keyboardButtonUrlAuth","params":[{"name":"flags","type":"#"},{"name":"text","type":"string"},{"name":"fwd_text","type":"flags.0?string"},{"name":"url","type":"string"},{"name":"button_id","type":"int"}],"type":"KeyboardButton"},{"id":"-802258988","predicate":"inputKeyboardButtonUrlAuth","params":[{"name":"flags","type":"#"},{"name":"request_write_access","type":"flags.0?true"},{"name":"text","type":"string"},{"name":"fwd_text","type":"flags.1?string"},{"name":"url","type":"string"},{"name":"bot","type":"InputUser"}],"type":"KeyboardButton"},{"id":"-1831650802","predicate":"urlAuthResultRequest","params":[{"name":"flags","type":"#"},{"name":"request_write_access","type":"flags.0?true"},{"name":"bot","type":"User"},{"name":"domain","type":"string"}],"type":"UrlAuthResult"},{"id":"-1886646706","predicate":"urlAuthResultAccepted","params":[{"name":"url","type":"string"}],"type":"UrlAuthResult"},{"id":"-1445536993","predicate":"urlAuthResultDefault","params":[],"type":"UrlAuthResult"},{"id":"1283572154","predicate":"inputPrivacyValueAllowChatParticipants","params":[{"name":"chats","type":"Vector"}],"type":"InputPrivacyRule"},{"id":"-668769361","predicate":"inputPrivacyValueDisallowChatParticipants","params":[{"name":"chats","type":"Vector"}],"type":"InputPrivacyRule"},{"id":"415136107","predicate":"privacyValueAllowChatParticipants","params":[{"name":"chats","type":"Vector"}],"type":"PrivacyRule"},{"id":"-1397881200","predicate":"privacyValueDisallowChatParticipants","params":[{"name":"chats","type":"Vector"}],"type":"PrivacyRule"},{"id":"-1672577397","predicate":"messageEntityUnderline","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity"},{"id":"-1090087980","predicate":"messageEntityStrike","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity"},{"id":"34469328","predicate":"messageEntityBlockquote","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity"},{"id":"1786671974","predicate":"updatePeerSettings","params":[{"name":"peer","type":"Peer"},{"name":"settings","type":"PeerSettings"}],"type":"Update"},{"id":"-1078612597","predicate":"channelLocationEmpty","params":[],"type":"ChannelLocation"},{"id":"547062491","predicate":"channelLocation","params":[{"name":"geo_point","type":"GeoPoint"},{"name":"address","type":"string"}],"type":"ChannelLocation"},{"id":"-901375139","predicate":"peerLocated","params":[{"name":"peer","type":"Peer"},{"name":"expires","type":"int"},{"name":"distance","type":"int"}],"type":"PeerLocated"},{"id":"-1263546448","predicate":"updatePeerLocated","params":[{"name":"peers","type":"Vector"}],"type":"Update"},{"id":"241923758","predicate":"channelAdminLogEventActionChangeLocation","params":[{"name":"prev_value","type":"ChannelLocation"},{"name":"new_value","type":"ChannelLocation"}],"type":"ChannelAdminLogEventAction"},{"id":"-606798099","predicate":"inputReportReasonGeoIrrelevant","params":[],"type":"ReportReason"},{"id":"1401984889","predicate":"channelAdminLogEventActionToggleSlowMode","params":[{"name":"prev_value","type":"int"},{"name":"new_value","type":"int"}],"type":"ChannelAdminLogEventAction"},{"id":"1148485274","predicate":"auth.authorizationSignUpRequired","params":[{"name":"flags","type":"#"},{"name":"terms_of_service","type":"flags.0?help.TermsOfService"}],"type":"auth.Authorization"},{"id":"-666824391","predicate":"payments.paymentVerificationNeeded","params":[{"name":"url","type":"string"}],"type":"payments.PaymentResult"},{"id":"42402760","predicate":"inputStickerSetAnimatedEmoji","params":[],"type":"InputStickerSet"},{"id":"967122427","predicate":"updateNewScheduledMessage","params":[{"name":"message","type":"Message"}],"type":"Update"},{"id":"-1870238482","predicate":"updateDeleteScheduledMessages","params":[{"name":"peer","type":"Peer"},{"name":"messages","type":"Vector"}],"type":"Update"},{"id":"-797791052","predicate":"restrictionReason","params":[{"name":"platform","type":"string"},{"name":"reason","type":"string"},{"name":"text","type":"string"}],"type":"RestrictionReason"},{"id":"1012306921","predicate":"inputTheme","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputTheme"},{"id":"-175567375","predicate":"inputThemeSlug","params":[{"name":"slug","type":"string"}],"type":"InputTheme"},{"id":"42930452","predicate":"theme","params":[{"name":"flags","type":"#"},{"name":"creator","type":"flags.0?true"},{"name":"default","type":"flags.1?true"},{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"slug","type":"string"},{"name":"title","type":"string"},{"name":"document","type":"flags.2?Document"},{"name":"settings","type":"flags.3?ThemeSettings"},{"name":"installs_count","type":"int"}],"type":"Theme"},{"id":"-199313886","predicate":"account.themesNotModified","params":[],"type":"account.Themes"},{"id":"2137482273","predicate":"account.themes","params":[{"name":"hash","type":"int"},{"name":"themes","type":"Vector"}],"type":"account.Themes"},{"id":"-2112423005","predicate":"updateTheme","params":[{"name":"theme","type":"Theme"}],"type":"Update"},{"id":"-786326563","predicate":"inputPrivacyKeyAddedByPhone","params":[],"type":"InputPrivacyKey"},{"id":"1124062251","predicate":"privacyKeyAddedByPhone","params":[],"type":"PrivacyKey"},{"id":"-2027964103","predicate":"updateGeoLiveViewed","params":[{"name":"peer","type":"Peer"},{"name":"msg_id","type":"int"}],"type":"Update"},{"id":"1448076945","predicate":"updateLoginToken","params":[],"type":"Update"},{"id":"1654593920","predicate":"auth.loginToken","params":[{"name":"expires","type":"int"},{"name":"token","type":"bytes"}],"type":"auth.LoginToken"},{"id":"110008598","predicate":"auth.loginTokenMigrateTo","params":[{"name":"dc_id","type":"int"},{"name":"token","type":"bytes"}],"type":"auth.LoginToken"},{"id":"957176926","predicate":"auth.loginTokenSuccess","params":[{"name":"authorization","type":"auth.Authorization"}],"type":"auth.LoginToken"},{"id":"1474462241","predicate":"account.contentSettings","params":[{"name":"flags","type":"#"},{"name":"sensitive_enabled","type":"flags.0?true"},{"name":"sensitive_can_change","type":"flags.1?true"}],"type":"account.ContentSettings"},{"id":"-1456996667","predicate":"messages.inactiveChats","params":[{"name":"dates","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.InactiveChats"},{"id":"-1012849566","predicate":"baseThemeClassic","params":[],"type":"BaseTheme"},{"id":"-69724536","predicate":"baseThemeDay","params":[],"type":"BaseTheme"},{"id":"-1212997976","predicate":"baseThemeNight","params":[],"type":"BaseTheme"},{"id":"1834973166","predicate":"baseThemeTinted","params":[],"type":"BaseTheme"},{"id":"1527845466","predicate":"baseThemeArctic","params":[],"type":"BaseTheme"},{"id":"-2077770836","predicate":"inputWallPaperNoFile","params":[],"type":"InputWallPaper"},{"id":"-1963717851","predicate":"wallPaperNoFile","params":[{"name":"flags","type":"#"},{"name":"default","type":"flags.1?true"},{"name":"dark","type":"flags.4?true"},{"name":"settings","type":"flags.2?WallPaperSettings"}],"type":"WallPaper"},{"id":"-1118798639","predicate":"inputThemeSettings","params":[{"name":"flags","type":"#"},{"name":"base_theme","type":"BaseTheme"},{"name":"accent_color","type":"int"},{"name":"message_top_color","type":"flags.0?int"},{"name":"message_bottom_color","type":"flags.0?int"},{"name":"wallpaper","type":"flags.1?InputWallPaper"},{"name":"wallpaper_settings","type":"flags.1?WallPaperSettings"}],"type":"InputThemeSettings"},{"id":"-1676371894","predicate":"themeSettings","params":[{"name":"flags","type":"#"},{"name":"base_theme","type":"BaseTheme"},{"name":"accent_color","type":"int"},{"name":"message_top_color","type":"flags.0?int"},{"name":"message_bottom_color","type":"flags.0?int"},{"name":"wallpaper","type":"flags.1?WallPaper"}],"type":"ThemeSettings"},{"id":"1421174295","predicate":"webPageAttributeTheme","params":[{"name":"flags","type":"#"},{"name":"documents","type":"flags.0?Vector"},{"name":"settings","type":"flags.1?ThemeSettings"}],"type":"WebPageAttribute"},{"id":"1123585836","predicate":"updateMessagePollVote","params":[{"name":"poll_id","type":"long"},{"name":"user_id","type":"int"},{"name":"options","type":"Vector"}],"type":"Update"},{"id":"-1567730343","predicate":"messageUserVote","params":[{"name":"user_id","type":"int"},{"name":"option","type":"bytes"},{"name":"date","type":"int"}],"type":"MessageUserVote"},{"id":"909603888","predicate":"messageUserVoteInputOption","params":[{"name":"user_id","type":"int"},{"name":"date","type":"int"}],"type":"MessageUserVote"},{"id":"244310238","predicate":"messageUserVoteMultiple","params":[{"name":"user_id","type":"int"},{"name":"options","type":"Vector"},{"name":"date","type":"int"}],"type":"MessageUserVote"},{"id":"136574537","predicate":"messages.votesList","params":[{"name":"flags","type":"#"},{"name":"count","type":"int"},{"name":"votes","type":"Vector"},{"name":"users","type":"Vector"},{"name":"next_offset","type":"flags.0?string"}],"type":"messages.VotesList"},{"id":"-1144565411","predicate":"keyboardButtonRequestPoll","params":[{"name":"flags","type":"#"},{"name":"quiz","type":"flags.0?Bool"},{"name":"text","type":"string"}],"type":"KeyboardButton"},{"id":"1981704948","predicate":"messageEntityBankCard","params":[{"name":"offset","type":"int"},{"name":"length","type":"int"}],"type":"MessageEntity"},{"id":"-177732982","predicate":"bankCardOpenUrl","params":[{"name":"url","type":"string"},{"name":"name","type":"string"}],"type":"BankCardOpenUrl"},{"id":"1042605427","predicate":"payments.bankCardData","params":[{"name":"title","type":"string"},{"name":"open_urls","type":"Vector"}],"type":"payments.BankCardData"},{"id":"-118740917","predicate":"peerSelfLocated","params":[{"name":"expires","type":"int"}],"type":"PeerLocated"},{"id":"1949890536","predicate":"dialogFilter","params":[{"name":"flags","type":"#"},{"name":"contacts","type":"flags.0?true"},{"name":"non_contacts","type":"flags.1?true"},{"name":"groups","type":"flags.2?true"},{"name":"broadcasts","type":"flags.3?true"},{"name":"bots","type":"flags.4?true"},{"name":"exclude_muted","type":"flags.11?true"},{"name":"exclude_read","type":"flags.12?true"},{"name":"exclude_archived","type":"flags.13?true"},{"name":"id","type":"int"},{"name":"title","type":"string"},{"name":"emoticon","type":"flags.25?string"},{"name":"pinned_peers","type":"Vector"},{"name":"include_peers","type":"Vector"},{"name":"exclude_peers","type":"Vector"}],"type":"DialogFilter"},{"id":"2004110666","predicate":"dialogFilterSuggested","params":[{"name":"filter","type":"DialogFilter"},{"name":"description","type":"string"}],"type":"DialogFilterSuggested"},{"id":"654302845","predicate":"updateDialogFilter","params":[{"name":"flags","type":"#"},{"name":"id","type":"int"},{"name":"filter","type":"flags.0?DialogFilter"}],"type":"Update"},{"id":"-1512627963","predicate":"updateDialogFilterOrder","params":[{"name":"order","type":"Vector"}],"type":"Update"},{"id":"889491791","predicate":"updateDialogFilters","params":[],"type":"Update"},{"id":"-1237848657","predicate":"statsDateRangeDays","params":[{"name":"min_date","type":"int"},{"name":"max_date","type":"int"}],"type":"StatsDateRangeDays"},{"id":"-884757282","predicate":"statsAbsValueAndPrev","params":[{"name":"current","type":"double"},{"name":"previous","type":"double"}],"type":"StatsAbsValueAndPrev"},{"id":"-875679776","predicate":"statsPercentValue","params":[{"name":"part","type":"double"},{"name":"total","type":"double"}],"type":"StatsPercentValue"},{"id":"1244130093","predicate":"statsGraphAsync","params":[{"name":"token","type":"string"}],"type":"StatsGraph"},{"id":"-1092839390","predicate":"statsGraphError","params":[{"name":"error","type":"string"}],"type":"StatsGraph"},{"id":"-1901828938","predicate":"statsGraph","params":[{"name":"flags","type":"#"},{"name":"json","type":"DataJSON"},{"name":"zoom_token","type":"flags.0?string"}],"type":"StatsGraph"},{"id":"-1387279939","predicate":"messageInteractionCounters","params":[{"name":"msg_id","type":"int"},{"name":"views","type":"int"},{"name":"forwards","type":"int"}],"type":"MessageInteractionCounters"},{"id":"-1107852396","predicate":"stats.broadcastStats","params":[{"name":"period","type":"StatsDateRangeDays"},{"name":"followers","type":"StatsAbsValueAndPrev"},{"name":"views_per_post","type":"StatsAbsValueAndPrev"},{"name":"shares_per_post","type":"StatsAbsValueAndPrev"},{"name":"enabled_notifications","type":"StatsPercentValue"},{"name":"growth_graph","type":"StatsGraph"},{"name":"followers_graph","type":"StatsGraph"},{"name":"mute_graph","type":"StatsGraph"},{"name":"top_hours_graph","type":"StatsGraph"},{"name":"interactions_graph","type":"StatsGraph"},{"name":"iv_interactions_graph","type":"StatsGraph"},{"name":"views_by_source_graph","type":"StatsGraph"},{"name":"new_followers_by_source_graph","type":"StatsGraph"},{"name":"languages_graph","type":"StatsGraph"},{"name":"recent_message_interactions","type":"Vector"}],"type":"stats.BroadcastStats"},{"id":"-428884101","predicate":"inputMediaDice","params":[{"name":"emoticon","type":"string"}],"type":"InputMedia"},{"id":"1065280907","predicate":"messageMediaDice","params":[{"name":"value","type":"int"},{"name":"emoticon","type":"string"}],"type":"MessageMedia"},{"id":"-427863538","predicate":"inputStickerSetDice","params":[{"name":"emoticon","type":"string"}],"type":"InputStickerSet"},{"id":"-1728664459","predicate":"help.promoDataEmpty","params":[{"name":"expires","type":"int"}],"type":"help.PromoData"},{"id":"-1942390465","predicate":"help.promoData","params":[{"name":"flags","type":"#"},{"name":"proxy","type":"flags.0?true"},{"name":"expires","type":"int"},{"name":"peer","type":"Peer"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"psa_type","type":"flags.1?string"},{"name":"psa_message","type":"flags.2?string"}],"type":"help.PromoData"},{"id":"-399391402","predicate":"videoSize","params":[{"name":"flags","type":"#"},{"name":"type","type":"string"},{"name":"location","type":"FileLocation"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"size","type":"int"},{"name":"video_start_ts","type":"flags.0?double"}],"type":"VideoSize"},{"id":"643940105","predicate":"updatePhoneCallSignalingData","params":[{"name":"phone_call_id","type":"long"},{"name":"data","type":"bytes"}],"type":"Update"},{"id":"1634294960","predicate":"chatInvitePeek","params":[{"name":"chat","type":"Chat"},{"name":"expires","type":"int"}],"type":"ChatInvite"},{"id":"418631927","predicate":"statsGroupTopPoster","params":[{"name":"user_id","type":"int"},{"name":"messages","type":"int"},{"name":"avg_chars","type":"int"}],"type":"StatsGroupTopPoster"},{"id":"1611985938","predicate":"statsGroupTopAdmin","params":[{"name":"user_id","type":"int"},{"name":"deleted","type":"int"},{"name":"kicked","type":"int"},{"name":"banned","type":"int"}],"type":"StatsGroupTopAdmin"},{"id":"831924812","predicate":"statsGroupTopInviter","params":[{"name":"user_id","type":"int"},{"name":"invitations","type":"int"}],"type":"StatsGroupTopInviter"},{"id":"-276825834","predicate":"stats.megagroupStats","params":[{"name":"period","type":"StatsDateRangeDays"},{"name":"members","type":"StatsAbsValueAndPrev"},{"name":"messages","type":"StatsAbsValueAndPrev"},{"name":"viewers","type":"StatsAbsValueAndPrev"},{"name":"posters","type":"StatsAbsValueAndPrev"},{"name":"growth_graph","type":"StatsGraph"},{"name":"members_graph","type":"StatsGraph"},{"name":"new_members_by_source_graph","type":"StatsGraph"},{"name":"languages_graph","type":"StatsGraph"},{"name":"messages_graph","type":"StatsGraph"},{"name":"actions_graph","type":"StatsGraph"},{"name":"top_hours_graph","type":"StatsGraph"},{"name":"weekdays_graph","type":"StatsGraph"},{"name":"top_posters","type":"Vector"},{"name":"top_admins","type":"Vector"},{"name":"top_inviters","type":"Vector"},{"name":"users","type":"Vector"}],"type":"stats.MegagroupStats"},{"id":"-1096616924","predicate":"globalPrivacySettings","params":[{"name":"flags","type":"#"},{"name":"archive_and_mute_new_noncontact_peers","type":"flags.0?Bool"}],"type":"GlobalPrivacySettings"},{"id":"1667228533","predicate":"phoneConnectionWebrtc","params":[{"name":"flags","type":"#"},{"name":"turn","type":"flags.0?true"},{"name":"stun","type":"flags.1?true"},{"name":"id","type":"long"},{"name":"ip","type":"string"},{"name":"ipv6","type":"string"},{"name":"port","type":"int"},{"name":"username","type":"string"},{"name":"password","type":"string"}],"type":"PhoneConnection"},{"id":"1107543535","predicate":"help.countryCode","params":[{"name":"flags","type":"#"},{"name":"country_code","type":"string"},{"name":"prefixes","type":"flags.0?Vector"},{"name":"patterns","type":"flags.1?Vector"}],"type":"help.CountryCode"},{"id":"-1014526429","predicate":"help.country","params":[{"name":"flags","type":"#"},{"name":"hidden","type":"flags.0?true"},{"name":"iso2","type":"string"},{"name":"default_name","type":"string"},{"name":"name","type":"flags.1?string"},{"name":"country_codes","type":"Vector"}],"type":"help.Country"},{"id":"-1815339214","predicate":"help.countriesListNotModified","params":[],"type":"help.CountriesList"},{"id":"-2016381538","predicate":"help.countriesList","params":[{"name":"countries","type":"Vector"},{"name":"hash","type":"int"}],"type":"help.CountriesList"},{"id":"1163625789","predicate":"messageViews","params":[{"name":"flags","type":"#"},{"name":"views","type":"flags.0?int"},{"name":"forwards","type":"flags.1?int"},{"name":"replies","type":"flags.2?MessageReplies"}],"type":"MessageViews"},{"id":"1854571743","predicate":"updateChannelMessageForwards","params":[{"name":"channel_id","type":"int"},{"name":"id","type":"int"},{"name":"forwards","type":"int"}],"type":"Update"},{"id":"1520986705","predicate":"photoSizeProgressive","params":[{"name":"type","type":"string"},{"name":"location","type":"FileLocation"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"sizes","type":"Vector"}],"type":"PhotoSize"},{"id":"-1228606141","predicate":"messages.messageViews","params":[{"name":"views","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.MessageViews"},{"id":"482860628","predicate":"updateReadChannelDiscussionInbox","params":[{"name":"flags","type":"#"},{"name":"channel_id","type":"int"},{"name":"top_msg_id","type":"int"},{"name":"read_max_id","type":"int"},{"name":"broadcast_id","type":"flags.0?int"},{"name":"broadcast_post","type":"flags.0?int"}],"type":"Update"},{"id":"1178116716","predicate":"updateReadChannelDiscussionOutbox","params":[{"name":"channel_id","type":"int"},{"name":"top_msg_id","type":"int"},{"name":"read_max_id","type":"int"}],"type":"Update"},{"id":"-170029155","predicate":"messages.discussionMessage","params":[{"name":"flags","type":"#"},{"name":"messages","type":"Vector"},{"name":"max_id","type":"flags.0?int"},{"name":"read_inbox_max_id","type":"flags.1?int"},{"name":"read_outbox_max_id","type":"flags.2?int"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.DiscussionMessage"},{"id":"-1495959709","predicate":"messageReplyHeader","params":[{"name":"flags","type":"#"},{"name":"reply_to_msg_id","type":"int"},{"name":"reply_to_peer_id","type":"flags.0?Peer"},{"name":"reply_to_top_id","type":"flags.1?int"}],"type":"MessageReplyHeader"},{"id":"1093204652","predicate":"messageReplies","params":[{"name":"flags","type":"#"},{"name":"comments","type":"flags.0?true"},{"name":"replies","type":"int"},{"name":"replies_pts","type":"int"},{"name":"recent_repliers","type":"flags.1?Vector"},{"name":"channel_id","type":"flags.0?int"},{"name":"max_id","type":"flags.2?int"},{"name":"read_max_id","type":"flags.3?int"}],"type":"MessageReplies"},{"id":"610945826","predicate":"updatePeerBlocked","params":[{"name":"peer_id","type":"Peer"},{"name":"blocked","type":"Bool"}],"type":"Update"},{"id":"-386039788","predicate":"peerBlocked","params":[{"name":"peer_id","type":"Peer"},{"name":"date","type":"int"}],"type":"PeerBlocked"},{"id":"-13975905","predicate":"updateChannelUserTyping","params":[{"name":"flags","type":"#"},{"name":"channel_id","type":"int"},{"name":"top_msg_id","type":"flags.0?int"},{"name":"user_id","type":"int"},{"name":"action","type":"SendMessageAction"}],"type":"Update"},{"id":"-1392895362","predicate":"inputMessageCallbackQuery","params":[{"name":"id","type":"int"},{"name":"query_id","type":"long"}],"type":"InputMessage"},{"id":"-1010402965","predicate":"channelParticipantLeft","params":[{"name":"user_id","type":"int"}],"type":"ChannelParticipant"},{"id":"-531931925","predicate":"channelParticipantsMentions","params":[{"name":"flags","type":"#"},{"name":"q","type":"flags.0?string"},{"name":"top_msg_id","type":"flags.1?int"}],"type":"ChannelParticipantsFilter"},{"id":"-309990731","predicate":"updatePinnedMessages","params":[{"name":"flags","type":"#"},{"name":"pinned","type":"flags.0?true"},{"name":"peer","type":"Peer"},{"name":"messages","type":"Vector"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"}],"type":"Update"},{"id":"-2054649973","predicate":"updatePinnedChannelMessages","params":[{"name":"flags","type":"#"},{"name":"pinned","type":"flags.0?true"},{"name":"channel_id","type":"int"},{"name":"messages","type":"Vector"},{"name":"pts","type":"int"},{"name":"pts_count","type":"int"}],"type":"Update"},{"id":"464520273","predicate":"inputMessagesFilterPinned","params":[],"type":"MessagesFilter"},{"id":"-1986399595","predicate":"stats.messageStats","params":[{"name":"views_graph","type":"StatsGraph"}],"type":"stats.MessageStats"},{"id":"-1730095465","predicate":"messageActionGeoProximityReached","params":[{"name":"from_id","type":"Peer"},{"name":"to_id","type":"Peer"},{"name":"distance","type":"int"}],"type":"MessageAction"},{"id":"-668906175","predicate":"photoPathSize","params":[{"name":"type","type":"string"},{"name":"bytes","type":"bytes"}],"type":"PhotoSize"}],"methods":[{"id":"-878758099","method":"invokeAfterMsg","params":[{"name":"msg_id","type":"long"},{"name":"query","type":"!X"}],"type":"X"},{"id":"1036301552","method":"invokeAfterMsgs","params":[{"name":"msg_ids","type":"Vector"},{"name":"query","type":"!X"}],"type":"X"},{"id":"-1502141361","method":"auth.sendCode","params":[{"name":"phone_number","type":"string"},{"name":"api_id","type":"int"},{"name":"api_hash","type":"string"},{"name":"settings","type":"CodeSettings"}],"type":"auth.SentCode"},{"id":"-2131827673","method":"auth.signUp","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"}],"type":"auth.Authorization"},{"id":"-1126886015","method":"auth.signIn","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"},{"name":"phone_code","type":"string"}],"type":"auth.Authorization"},{"id":"1461180992","method":"auth.logOut","params":[],"type":"Bool"},{"id":"-1616179942","method":"auth.resetAuthorizations","params":[],"type":"Bool"},{"id":"-440401971","method":"auth.exportAuthorization","params":[{"name":"dc_id","type":"int"}],"type":"auth.ExportedAuthorization"},{"id":"-470837741","method":"auth.importAuthorization","params":[{"name":"id","type":"int"},{"name":"bytes","type":"bytes"}],"type":"auth.Authorization"},{"id":"-841733627","method":"auth.bindTempAuthKey","params":[{"name":"perm_auth_key_id","type":"long"},{"name":"nonce","type":"long"},{"name":"expires_at","type":"int"},{"name":"encrypted_message","type":"bytes"}],"type":"Bool"},{"id":"1754754159","method":"account.registerDevice","params":[{"name":"flags","type":"#"},{"name":"no_muted","type":"flags.0?true"},{"name":"token_type","type":"int"},{"name":"token","type":"string"},{"name":"app_sandbox","type":"Bool"},{"name":"secret","type":"bytes"},{"name":"other_uids","type":"Vector"}],"type":"Bool"},{"id":"813089983","method":"account.unregisterDevice","params":[{"name":"token_type","type":"int"},{"name":"token","type":"string"},{"name":"other_uids","type":"Vector"}],"type":"Bool"},{"id":"-2067899501","method":"account.updateNotifySettings","params":[{"name":"peer","type":"InputNotifyPeer"},{"name":"settings","type":"InputPeerNotifySettings"}],"type":"Bool"},{"id":"313765169","method":"account.getNotifySettings","params":[{"name":"peer","type":"InputNotifyPeer"}],"type":"PeerNotifySettings"},{"id":"-612493497","method":"account.resetNotifySettings","params":[],"type":"Bool"},{"id":"2018596725","method":"account.updateProfile","params":[{"name":"flags","type":"#"},{"name":"first_name","type":"flags.0?string"},{"name":"last_name","type":"flags.1?string"},{"name":"about","type":"flags.2?string"}],"type":"User"},{"id":"1713919532","method":"account.updateStatus","params":[{"name":"offline","type":"Bool"}],"type":"Bool"},{"id":"-1430579357","method":"account.getWallPapers","params":[{"name":"hash","type":"int"}],"type":"account.WallPapers"},{"id":"-1374118561","method":"account.reportPeer","params":[{"name":"peer","type":"InputPeer"},{"name":"reason","type":"ReportReason"}],"type":"Bool"},{"id":"227648840","method":"users.getUsers","params":[{"name":"id","type":"Vector"}],"type":"Vector"},{"id":"-902781519","method":"users.getFullUser","params":[{"name":"id","type":"InputUser"}],"type":"UserFull"},{"id":"749357634","method":"contacts.getContactIDs","params":[{"name":"hash","type":"int"}],"type":"Vector"},{"id":"-995929106","method":"contacts.getStatuses","params":[],"type":"Vector"},{"id":"-1071414113","method":"contacts.getContacts","params":[{"name":"hash","type":"int"}],"type":"contacts.Contacts"},{"id":"746589157","method":"contacts.importContacts","params":[{"name":"contacts","type":"Vector"}],"type":"contacts.ImportedContacts"},{"id":"157945344","method":"contacts.deleteContacts","params":[{"name":"id","type":"Vector"}],"type":"Updates"},{"id":"269745566","method":"contacts.deleteByPhones","params":[{"name":"phones","type":"Vector"}],"type":"Bool"},{"id":"1758204945","method":"contacts.block","params":[{"name":"id","type":"InputPeer"}],"type":"Bool"},{"id":"-1096393392","method":"contacts.unblock","params":[{"name":"id","type":"InputPeer"}],"type":"Bool"},{"id":"-176409329","method":"contacts.getBlocked","params":[{"name":"offset","type":"int"},{"name":"limit","type":"int"}],"type":"contacts.Blocked"},{"id":"1673946374","method":"messages.getMessages","params":[{"name":"id","type":"Vector"}],"type":"messages.Messages"},{"id":"-1594999949","method":"messages.getDialogs","params":[{"name":"flags","type":"#"},{"name":"exclude_pinned","type":"flags.0?true"},{"name":"folder_id","type":"flags.1?int"},{"name":"offset_date","type":"int"},{"name":"offset_id","type":"int"},{"name":"offset_peer","type":"InputPeer"},{"name":"limit","type":"int"},{"name":"hash","type":"int"}],"type":"messages.Dialogs"},{"id":"-591691168","method":"messages.getHistory","params":[{"name":"peer","type":"InputPeer"},{"name":"offset_id","type":"int"},{"name":"offset_date","type":"int"},{"name":"add_offset","type":"int"},{"name":"limit","type":"int"},{"name":"max_id","type":"int"},{"name":"min_id","type":"int"},{"name":"hash","type":"int"}],"type":"messages.Messages"},{"id":"204812012","method":"messages.search","params":[{"name":"flags","type":"#"},{"name":"peer","type":"InputPeer"},{"name":"q","type":"string"},{"name":"from_id","type":"flags.0?InputPeer"},{"name":"top_msg_id","type":"flags.1?int"},{"name":"filter","type":"MessagesFilter"},{"name":"min_date","type":"int"},{"name":"max_date","type":"int"},{"name":"offset_id","type":"int"},{"name":"add_offset","type":"int"},{"name":"limit","type":"int"},{"name":"max_id","type":"int"},{"name":"min_id","type":"int"},{"name":"hash","type":"int"}],"type":"messages.Messages"},{"id":"238054714","method":"messages.readHistory","params":[{"name":"peer","type":"InputPeer"},{"name":"max_id","type":"int"}],"type":"messages.AffectedMessages"},{"id":"469850889","method":"messages.deleteHistory","params":[{"name":"flags","type":"#"},{"name":"just_clear","type":"flags.0?true"},{"name":"revoke","type":"flags.1?true"},{"name":"peer","type":"InputPeer"},{"name":"max_id","type":"int"}],"type":"messages.AffectedHistory"},{"id":"-443640366","method":"messages.deleteMessages","params":[{"name":"flags","type":"#"},{"name":"revoke","type":"flags.0?true"},{"name":"id","type":"Vector"}],"type":"messages.AffectedMessages"},{"id":"94983360","method":"messages.receivedMessages","params":[{"name":"max_id","type":"int"}],"type":"Vector"},{"id":"1486110434","method":"messages.setTyping","params":[{"name":"flags","type":"#"},{"name":"peer","type":"InputPeer"},{"name":"top_msg_id","type":"flags.0?int"},{"name":"action","type":"SendMessageAction"}],"type":"Bool"},{"id":"1376532592","method":"messages.sendMessage","params":[{"name":"flags","type":"#"},{"name":"no_webpage","type":"flags.1?true"},{"name":"silent","type":"flags.5?true"},{"name":"background","type":"flags.6?true"},{"name":"clear_draft","type":"flags.7?true"},{"name":"peer","type":"InputPeer"},{"name":"reply_to_msg_id","type":"flags.0?int"},{"name":"message","type":"string"},{"name":"random_id","type":"long"},{"name":"reply_markup","type":"flags.2?ReplyMarkup"},{"name":"entities","type":"flags.3?Vector"},{"name":"schedule_date","type":"flags.10?int"}],"type":"Updates"},{"id":"881978281","method":"messages.sendMedia","params":[{"name":"flags","type":"#"},{"name":"silent","type":"flags.5?true"},{"name":"background","type":"flags.6?true"},{"name":"clear_draft","type":"flags.7?true"},{"name":"peer","type":"InputPeer"},{"name":"reply_to_msg_id","type":"flags.0?int"},{"name":"media","type":"InputMedia"},{"name":"message","type":"string"},{"name":"random_id","type":"long"},{"name":"reply_markup","type":"flags.2?ReplyMarkup"},{"name":"entities","type":"flags.3?Vector"},{"name":"schedule_date","type":"flags.10?int"}],"type":"Updates"},{"id":"-637606386","method":"messages.forwardMessages","params":[{"name":"flags","type":"#"},{"name":"silent","type":"flags.5?true"},{"name":"background","type":"flags.6?true"},{"name":"with_my_score","type":"flags.8?true"},{"name":"from_peer","type":"InputPeer"},{"name":"id","type":"Vector"},{"name":"random_id","type":"Vector"},{"name":"to_peer","type":"InputPeer"},{"name":"schedule_date","type":"flags.10?int"}],"type":"Updates"},{"id":"-820669733","method":"messages.reportSpam","params":[{"name":"peer","type":"InputPeer"}],"type":"Bool"},{"id":"913498268","method":"messages.getPeerSettings","params":[{"name":"peer","type":"InputPeer"}],"type":"PeerSettings"},{"id":"-1115507112","method":"messages.report","params":[{"name":"peer","type":"InputPeer"},{"name":"id","type":"Vector"},{"name":"reason","type":"ReportReason"}],"type":"Bool"},{"id":"1013621127","method":"messages.getChats","params":[{"name":"id","type":"Vector"}],"type":"messages.Chats"},{"id":"998448230","method":"messages.getFullChat","params":[{"name":"chat_id","type":"int"}],"type":"messages.ChatFull"},{"id":"-599447467","method":"messages.editChatTitle","params":[{"name":"chat_id","type":"int"},{"name":"title","type":"string"}],"type":"Updates"},{"id":"-900957736","method":"messages.editChatPhoto","params":[{"name":"chat_id","type":"int"},{"name":"photo","type":"InputChatPhoto"}],"type":"Updates"},{"id":"-106911223","method":"messages.addChatUser","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"InputUser"},{"name":"fwd_limit","type":"int"}],"type":"Updates"},{"id":"-530505962","method":"messages.deleteChatUser","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"InputUser"}],"type":"Updates"},{"id":"164303470","method":"messages.createChat","params":[{"name":"users","type":"Vector"},{"name":"title","type":"string"}],"type":"Updates"},{"id":"-304838614","method":"updates.getState","params":[],"type":"updates.State"},{"id":"630429265","method":"updates.getDifference","params":[{"name":"flags","type":"#"},{"name":"pts","type":"int"},{"name":"pts_total_limit","type":"flags.0?int"},{"name":"date","type":"int"},{"name":"qts","type":"int"}],"type":"updates.Difference"},{"id":"1926525996","method":"photos.updateProfilePhoto","params":[{"name":"id","type":"InputPhoto"}],"type":"photos.Photo"},{"id":"-1980559511","method":"photos.uploadProfilePhoto","params":[{"name":"flags","type":"#"},{"name":"file","type":"flags.0?InputFile"},{"name":"video","type":"flags.1?InputFile"},{"name":"video_start_ts","type":"flags.2?double"}],"type":"photos.Photo"},{"id":"-2016444625","method":"photos.deletePhotos","params":[{"name":"id","type":"Vector"}],"type":"Vector"},{"id":"-1291540959","method":"upload.saveFilePart","params":[{"name":"file_id","type":"long"},{"name":"file_part","type":"int"},{"name":"bytes","type":"bytes"}],"type":"Bool"},{"id":"-1319462148","method":"upload.getFile","params":[{"name":"flags","type":"#"},{"name":"precise","type":"flags.0?true"},{"name":"cdn_supported","type":"flags.1?true"},{"name":"location","type":"InputFileLocation"},{"name":"offset","type":"int"},{"name":"limit","type":"int"}],"type":"upload.File"},{"id":"-990308245","method":"help.getConfig","params":[],"type":"Config"},{"id":"531836966","method":"help.getNearestDc","params":[],"type":"NearestDc"},{"id":"1378703997","method":"help.getAppUpdate","params":[{"name":"source","type":"string"}],"type":"help.AppUpdate"},{"id":"1295590211","method":"help.getInviteText","params":[],"type":"help.InviteText"},{"id":"-1848823128","method":"photos.getUserPhotos","params":[{"name":"user_id","type":"InputUser"},{"name":"offset","type":"int"},{"name":"max_id","type":"long"},{"name":"limit","type":"int"}],"type":"photos.Photos"},{"id":"651135312","method":"messages.getDhConfig","params":[{"name":"version","type":"int"},{"name":"random_length","type":"int"}],"type":"messages.DhConfig"},{"id":"-162681021","method":"messages.requestEncryption","params":[{"name":"user_id","type":"InputUser"},{"name":"random_id","type":"int"},{"name":"g_a","type":"bytes"}],"type":"EncryptedChat"},{"id":"1035731989","method":"messages.acceptEncryption","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"g_b","type":"bytes"},{"name":"key_fingerprint","type":"long"}],"type":"EncryptedChat"},{"id":"-304536635","method":"messages.discardEncryption","params":[{"name":"chat_id","type":"int"}],"type":"Bool"},{"id":"2031374829","method":"messages.setEncryptedTyping","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"typing","type":"Bool"}],"type":"Bool"},{"id":"2135648522","method":"messages.readEncryptedHistory","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"max_date","type":"int"}],"type":"Bool"},{"id":"1157265941","method":"messages.sendEncrypted","params":[{"name":"flags","type":"#"},{"name":"silent","type":"flags.0?true"},{"name":"peer","type":"InputEncryptedChat"},{"name":"random_id","type":"long"},{"name":"data","type":"bytes"}],"type":"messages.SentEncryptedMessage"},{"id":"1431914525","method":"messages.sendEncryptedFile","params":[{"name":"flags","type":"#"},{"name":"silent","type":"flags.0?true"},{"name":"peer","type":"InputEncryptedChat"},{"name":"random_id","type":"long"},{"name":"data","type":"bytes"},{"name":"file","type":"InputEncryptedFile"}],"type":"messages.SentEncryptedMessage"},{"id":"852769188","method":"messages.sendEncryptedService","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"random_id","type":"long"},{"name":"data","type":"bytes"}],"type":"messages.SentEncryptedMessage"},{"id":"1436924774","method":"messages.receivedQueue","params":[{"name":"max_qts","type":"int"}],"type":"Vector"},{"id":"1259113487","method":"messages.reportEncryptedSpam","params":[{"name":"peer","type":"InputEncryptedChat"}],"type":"Bool"},{"id":"-562337987","method":"upload.saveBigFilePart","params":[{"name":"file_id","type":"long"},{"name":"file_part","type":"int"},{"name":"file_total_parts","type":"int"},{"name":"bytes","type":"bytes"}],"type":"Bool"},{"id":"-1043505495","method":"initConnection","params":[{"name":"flags","type":"#"},{"name":"api_id","type":"int"},{"name":"device_model","type":"string"},{"name":"system_version","type":"string"},{"name":"app_version","type":"string"},{"name":"system_lang_code","type":"string"},{"name":"lang_pack","type":"string"},{"name":"lang_code","type":"string"},{"name":"proxy","type":"flags.0?InputClientProxy"},{"name":"params","type":"flags.1?JSONValue"},{"name":"query","type":"!X"}],"type":"X"},{"id":"-1663104819","method":"help.getSupport","params":[],"type":"help.Support"},{"id":"916930423","method":"messages.readMessageContents","params":[{"name":"id","type":"Vector"}],"type":"messages.AffectedMessages"},{"id":"655677548","method":"account.checkUsername","params":[{"name":"username","type":"string"}],"type":"Bool"},{"id":"1040964988","method":"account.updateUsername","params":[{"name":"username","type":"string"}],"type":"User"},{"id":"301470424","method":"contacts.search","params":[{"name":"q","type":"string"},{"name":"limit","type":"int"}],"type":"contacts.Found"},{"id":"-623130288","method":"account.getPrivacy","params":[{"name":"key","type":"InputPrivacyKey"}],"type":"account.PrivacyRules"},{"id":"-906486552","method":"account.setPrivacy","params":[{"name":"key","type":"InputPrivacyKey"},{"name":"rules","type":"Vector"}],"type":"account.PrivacyRules"},{"id":"1099779595","method":"account.deleteAccount","params":[{"name":"reason","type":"string"}],"type":"Bool"},{"id":"150761757","method":"account.getAccountTTL","params":[],"type":"AccountDaysTTL"},{"id":"608323678","method":"account.setAccountTTL","params":[{"name":"ttl","type":"AccountDaysTTL"}],"type":"Bool"},{"id":"-627372787","method":"invokeWithLayer","params":[{"name":"layer","type":"int"},{"name":"query","type":"!X"}],"type":"X"},{"id":"-113456221","method":"contacts.resolveUsername","params":[{"name":"username","type":"string"}],"type":"contacts.ResolvedPeer"},{"id":"-2108208411","method":"account.sendChangePhoneCode","params":[{"name":"phone_number","type":"string"},{"name":"settings","type":"CodeSettings"}],"type":"auth.SentCode"},{"id":"1891839707","method":"account.changePhone","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"},{"name":"phone_code","type":"string"}],"type":"User"},{"id":"71126828","method":"messages.getStickers","params":[{"name":"emoticon","type":"string"},{"name":"hash","type":"int"}],"type":"messages.Stickers"},{"id":"479598769","method":"messages.getAllStickers","params":[{"name":"hash","type":"int"}],"type":"messages.AllStickers"},{"id":"954152242","method":"account.updateDeviceLocked","params":[{"name":"period","type":"int"}],"type":"Bool"},{"id":"1738800940","method":"auth.importBotAuthorization","params":[{"name":"flags","type":"int"},{"name":"api_id","type":"int"},{"name":"api_hash","type":"string"},{"name":"bot_auth_token","type":"string"}],"type":"auth.Authorization"},{"id":"-1956073268","method":"messages.getWebPagePreview","params":[{"name":"flags","type":"#"},{"name":"message","type":"string"},{"name":"entities","type":"flags.3?Vector"}],"type":"MessageMedia"},{"id":"-484392616","method":"account.getAuthorizations","params":[],"type":"account.Authorizations"},{"id":"-545786948","method":"account.resetAuthorization","params":[{"name":"hash","type":"long"}],"type":"Bool"},{"id":"1418342645","method":"account.getPassword","params":[],"type":"account.Password"},{"id":"-1663767815","method":"account.getPasswordSettings","params":[{"name":"password","type":"InputCheckPasswordSRP"}],"type":"account.PasswordSettings"},{"id":"-1516564433","method":"account.updatePasswordSettings","params":[{"name":"password","type":"InputCheckPasswordSRP"},{"name":"new_settings","type":"account.PasswordInputSettings"}],"type":"Bool"},{"id":"-779399914","method":"auth.checkPassword","params":[{"name":"password","type":"InputCheckPasswordSRP"}],"type":"auth.Authorization"},{"id":"-661144474","method":"auth.requestPasswordRecovery","params":[],"type":"auth.PasswordRecovery"},{"id":"1319464594","method":"auth.recoverPassword","params":[{"name":"code","type":"string"}],"type":"auth.Authorization"},{"id":"-1080796745","method":"invokeWithoutUpdates","params":[{"name":"query","type":"!X"}],"type":"X"},{"id":"234312524","method":"messages.exportChatInvite","params":[{"name":"peer","type":"InputPeer"}],"type":"ExportedChatInvite"},{"id":"1051570619","method":"messages.checkChatInvite","params":[{"name":"hash","type":"string"}],"type":"ChatInvite"},{"id":"1817183516","method":"messages.importChatInvite","params":[{"name":"hash","type":"string"}],"type":"Updates"},{"id":"639215886","method":"messages.getStickerSet","params":[{"name":"stickerset","type":"InputStickerSet"}],"type":"messages.StickerSet"},{"id":"-946871200","method":"messages.installStickerSet","params":[{"name":"stickerset","type":"InputStickerSet"},{"name":"archived","type":"Bool"}],"type":"messages.StickerSetInstallResult"},{"id":"-110209570","method":"messages.uninstallStickerSet","params":[{"name":"stickerset","type":"InputStickerSet"}],"type":"Bool"},{"id":"-421563528","method":"messages.startBot","params":[{"name":"bot","type":"InputUser"},{"name":"peer","type":"InputPeer"},{"name":"random_id","type":"long"},{"name":"start_param","type":"string"}],"type":"Updates"},{"id":"-1877938321","method":"help.getAppChangelog","params":[{"name":"prev_app_version","type":"string"}],"type":"Updates"},{"id":"1468322785","method":"messages.getMessagesViews","params":[{"name":"peer","type":"InputPeer"},{"name":"id","type":"Vector"},{"name":"increment","type":"Bool"}],"type":"messages.MessageViews"},{"id":"-871347913","method":"channels.readHistory","params":[{"name":"channel","type":"InputChannel"},{"name":"max_id","type":"int"}],"type":"Bool"},{"id":"-2067661490","method":"channels.deleteMessages","params":[{"name":"channel","type":"InputChannel"},{"name":"id","type":"Vector"}],"type":"messages.AffectedMessages"},{"id":"-787622117","method":"channels.deleteUserHistory","params":[{"name":"channel","type":"InputChannel"},{"name":"user_id","type":"InputUser"}],"type":"messages.AffectedHistory"},{"id":"-32999408","method":"channels.reportSpam","params":[{"name":"channel","type":"InputChannel"},{"name":"user_id","type":"InputUser"},{"name":"id","type":"Vector"}],"type":"Bool"},{"id":"-1383294429","method":"channels.getMessages","params":[{"name":"channel","type":"InputChannel"},{"name":"id","type":"Vector"}],"type":"messages.Messages"},{"id":"306054633","method":"channels.getParticipants","params":[{"name":"channel","type":"InputChannel"},{"name":"filter","type":"ChannelParticipantsFilter"},{"name":"offset","type":"int"},{"name":"limit","type":"int"},{"name":"hash","type":"int"}],"type":"channels.ChannelParticipants"},{"id":"1416484774","method":"channels.getParticipant","params":[{"name":"channel","type":"InputChannel"},{"name":"user_id","type":"InputUser"}],"type":"channels.ChannelParticipant"},{"id":"176122811","method":"channels.getChannels","params":[{"name":"id","type":"Vector"}],"type":"messages.Chats"},{"id":"141781513","method":"channels.getFullChannel","params":[{"name":"channel","type":"InputChannel"}],"type":"messages.ChatFull"},{"id":"1029681423","method":"channels.createChannel","params":[{"name":"flags","type":"#"},{"name":"broadcast","type":"flags.0?true"},{"name":"megagroup","type":"flags.1?true"},{"name":"for_import","type":"flags.3?true"},{"name":"title","type":"string"},{"name":"about","type":"string"},{"name":"geo_point","type":"flags.2?InputGeoPoint"},{"name":"address","type":"flags.2?string"}],"type":"Updates"},{"id":"-751007486","method":"channels.editAdmin","params":[{"name":"channel","type":"InputChannel"},{"name":"user_id","type":"InputUser"},{"name":"admin_rights","type":"ChatAdminRights"},{"name":"rank","type":"string"}],"type":"Updates"},{"id":"1450044624","method":"channels.editTitle","params":[{"name":"channel","type":"InputChannel"},{"name":"title","type":"string"}],"type":"Updates"},{"id":"-248621111","method":"channels.editPhoto","params":[{"name":"channel","type":"InputChannel"},{"name":"photo","type":"InputChatPhoto"}],"type":"Updates"},{"id":"283557164","method":"channels.checkUsername","params":[{"name":"channel","type":"InputChannel"},{"name":"username","type":"string"}],"type":"Bool"},{"id":"890549214","method":"channels.updateUsername","params":[{"name":"channel","type":"InputChannel"},{"name":"username","type":"string"}],"type":"Bool"},{"id":"615851205","method":"channels.joinChannel","params":[{"name":"channel","type":"InputChannel"}],"type":"Updates"},{"id":"-130635115","method":"channels.leaveChannel","params":[{"name":"channel","type":"InputChannel"}],"type":"Updates"},{"id":"429865580","method":"channels.inviteToChannel","params":[{"name":"channel","type":"InputChannel"},{"name":"users","type":"Vector"}],"type":"Updates"},{"id":"-1072619549","method":"channels.deleteChannel","params":[{"name":"channel","type":"InputChannel"}],"type":"Updates"},{"id":"51854712","method":"updates.getChannelDifference","params":[{"name":"flags","type":"#"},{"name":"force","type":"flags.0?true"},{"name":"channel","type":"InputChannel"},{"name":"filter","type":"ChannelMessagesFilter"},{"name":"pts","type":"int"},{"name":"limit","type":"int"}],"type":"updates.ChannelDifference"},{"id":"-1444503762","method":"messages.editChatAdmin","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"InputUser"},{"name":"is_admin","type":"Bool"}],"type":"Bool"},{"id":"363051235","method":"messages.migrateChat","params":[{"name":"chat_id","type":"int"}],"type":"Updates"},{"id":"1271290010","method":"messages.searchGlobal","params":[{"name":"flags","type":"#"},{"name":"folder_id","type":"flags.0?int"},{"name":"q","type":"string"},{"name":"filter","type":"MessagesFilter"},{"name":"min_date","type":"int"},{"name":"max_date","type":"int"},{"name":"offset_rate","type":"int"},{"name":"offset_peer","type":"InputPeer"},{"name":"offset_id","type":"int"},{"name":"limit","type":"int"}],"type":"messages.Messages"},{"id":"2016638777","method":"messages.reorderStickerSets","params":[{"name":"flags","type":"#"},{"name":"masks","type":"flags.0?true"},{"name":"order","type":"Vector"}],"type":"Bool"},{"id":"864953444","method":"messages.getDocumentByHash","params":[{"name":"sha256","type":"bytes"},{"name":"size","type":"int"},{"name":"mime_type","type":"string"}],"type":"Document"},{"id":"-2084618926","method":"messages.getSavedGifs","params":[{"name":"hash","type":"int"}],"type":"messages.SavedGifs"},{"id":"846868683","method":"messages.saveGif","params":[{"name":"id","type":"InputDocument"},{"name":"unsave","type":"Bool"}],"type":"Bool"},{"id":"1364105629","method":"messages.getInlineBotResults","params":[{"name":"flags","type":"#"},{"name":"bot","type":"InputUser"},{"name":"peer","type":"InputPeer"},{"name":"geo_point","type":"flags.0?InputGeoPoint"},{"name":"query","type":"string"},{"name":"offset","type":"string"}],"type":"messages.BotResults"},{"id":"-346119674","method":"messages.setInlineBotResults","params":[{"name":"flags","type":"#"},{"name":"gallery","type":"flags.0?true"},{"name":"private","type":"flags.1?true"},{"name":"query_id","type":"long"},{"name":"results","type":"Vector"},{"name":"cache_time","type":"int"},{"name":"next_offset","type":"flags.2?string"},{"name":"switch_pm","type":"flags.3?InlineBotSwitchPM"}],"type":"Bool"},{"id":"570955184","method":"messages.sendInlineBotResult","params":[{"name":"flags","type":"#"},{"name":"silent","type":"flags.5?true"},{"name":"background","type":"flags.6?true"},{"name":"clear_draft","type":"flags.7?true"},{"name":"hide_via","type":"flags.11?true"},{"name":"peer","type":"InputPeer"},{"name":"reply_to_msg_id","type":"flags.0?int"},{"name":"random_id","type":"long"},{"name":"query_id","type":"long"},{"name":"id","type":"string"},{"name":"schedule_date","type":"flags.10?int"}],"type":"Updates"},{"id":"-432034325","method":"channels.exportMessageLink","params":[{"name":"flags","type":"#"},{"name":"grouped","type":"flags.0?true"},{"name":"thread","type":"flags.1?true"},{"name":"channel","type":"InputChannel"},{"name":"id","type":"int"}],"type":"ExportedMessageLink"},{"id":"527021574","method":"channels.toggleSignatures","params":[{"name":"channel","type":"InputChannel"},{"name":"enabled","type":"Bool"}],"type":"Updates"},{"id":"1056025023","method":"auth.resendCode","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"}],"type":"auth.SentCode"},{"id":"520357240","method":"auth.cancelCode","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"}],"type":"Bool"},{"id":"-39416522","method":"messages.getMessageEditData","params":[{"name":"peer","type":"InputPeer"},{"name":"id","type":"int"}],"type":"messages.MessageEditData"},{"id":"1224152952","method":"messages.editMessage","params":[{"name":"flags","type":"#"},{"name":"no_webpage","type":"flags.1?true"},{"name":"peer","type":"InputPeer"},{"name":"id","type":"int"},{"name":"message","type":"flags.11?string"},{"name":"media","type":"flags.14?InputMedia"},{"name":"reply_markup","type":"flags.2?ReplyMarkup"},{"name":"entities","type":"flags.3?Vector"},{"name":"schedule_date","type":"flags.15?int"}],"type":"Updates"},{"id":"-2091549254","method":"messages.editInlineBotMessage","params":[{"name":"flags","type":"#"},{"name":"no_webpage","type":"flags.1?true"},{"name":"id","type":"InputBotInlineMessageID"},{"name":"message","type":"flags.11?string"},{"name":"media","type":"flags.14?InputMedia"},{"name":"reply_markup","type":"flags.2?ReplyMarkup"},{"name":"entities","type":"flags.3?Vector"}],"type":"Bool"},{"id":"-1824339449","method":"messages.getBotCallbackAnswer","params":[{"name":"flags","type":"#"},{"name":"game","type":"flags.1?true"},{"name":"peer","type":"InputPeer"},{"name":"msg_id","type":"int"},{"name":"data","type":"flags.0?bytes"},{"name":"password","type":"flags.2?InputCheckPasswordSRP"}],"type":"messages.BotCallbackAnswer"},{"id":"-712043766","method":"messages.setBotCallbackAnswer","params":[{"name":"flags","type":"#"},{"name":"alert","type":"flags.1?true"},{"name":"query_id","type":"long"},{"name":"message","type":"flags.0?string"},{"name":"url","type":"flags.2?string"},{"name":"cache_time","type":"int"}],"type":"Bool"},{"id":"-728224331","method":"contacts.getTopPeers","params":[{"name":"flags","type":"#"},{"name":"correspondents","type":"flags.0?true"},{"name":"bots_pm","type":"flags.1?true"},{"name":"bots_inline","type":"flags.2?true"},{"name":"phone_calls","type":"flags.3?true"},{"name":"forward_users","type":"flags.4?true"},{"name":"forward_chats","type":"flags.5?true"},{"name":"groups","type":"flags.10?true"},{"name":"channels","type":"flags.15?true"},{"name":"offset","type":"int"},{"name":"limit","type":"int"},{"name":"hash","type":"int"}],"type":"contacts.TopPeers"},{"id":"451113900","method":"contacts.resetTopPeerRating","params":[{"name":"category","type":"TopPeerCategory"},{"name":"peer","type":"InputPeer"}],"type":"Bool"},{"id":"-462373635","method":"messages.getPeerDialogs","params":[{"name":"peers","type":"Vector"}],"type":"messages.PeerDialogs"},{"id":"-1137057461","method":"messages.saveDraft","params":[{"name":"flags","type":"#"},{"name":"no_webpage","type":"flags.1?true"},{"name":"reply_to_msg_id","type":"flags.0?int"},{"name":"peer","type":"InputPeer"},{"name":"message","type":"string"},{"name":"entities","type":"flags.3?Vector"}],"type":"Bool"},{"id":"1782549861","method":"messages.getAllDrafts","params":[],"type":"Updates"},{"id":"766298703","method":"messages.getFeaturedStickers","params":[{"name":"hash","type":"int"}],"type":"messages.FeaturedStickers"},{"id":"1527873830","method":"messages.readFeaturedStickers","params":[{"name":"id","type":"Vector"}],"type":"Bool"},{"id":"1587647177","method":"messages.getRecentStickers","params":[{"name":"flags","type":"#"},{"name":"attached","type":"flags.0?true"},{"name":"hash","type":"int"}],"type":"messages.RecentStickers"},{"id":"958863608","method":"messages.saveRecentSticker","params":[{"name":"flags","type":"#"},{"name":"attached","type":"flags.0?true"},{"name":"id","type":"InputDocument"},{"name":"unsave","type":"Bool"}],"type":"Bool"},{"id":"-1986437075","method":"messages.clearRecentStickers","params":[{"name":"flags","type":"#"},{"name":"attached","type":"flags.0?true"}],"type":"Bool"},{"id":"1475442322","method":"messages.getArchivedStickers","params":[{"name":"flags","type":"#"},{"name":"masks","type":"flags.0?true"},{"name":"offset_id","type":"long"},{"name":"limit","type":"int"}],"type":"messages.ArchivedStickers"},{"id":"457157256","method":"account.sendConfirmPhoneCode","params":[{"name":"hash","type":"string"},{"name":"settings","type":"CodeSettings"}],"type":"auth.SentCode"},{"id":"1596029123","method":"account.confirmPhone","params":[{"name":"phone_code_hash","type":"string"},{"name":"phone_code","type":"string"}],"type":"Bool"},{"id":"-122669393","method":"channels.getAdminedPublicChannels","params":[{"name":"flags","type":"#"},{"name":"by_location","type":"flags.0?true"},{"name":"check_limit","type":"flags.1?true"}],"type":"messages.Chats"},{"id":"1706608543","method":"messages.getMaskStickers","params":[{"name":"hash","type":"int"}],"type":"messages.AllStickers"},{"id":"-866424884","method":"messages.getAttachedStickers","params":[{"name":"media","type":"InputStickeredMedia"}],"type":"Vector"},{"id":"-1907842680","method":"auth.dropTempAuthKeys","params":[{"name":"except_auth_keys","type":"Vector"}],"type":"Bool"},{"id":"-1896289088","method":"messages.setGameScore","params":[{"name":"flags","type":"#"},{"name":"edit_message","type":"flags.0?true"},{"name":"force","type":"flags.1?true"},{"name":"peer","type":"InputPeer"},{"name":"id","type":"int"},{"name":"user_id","type":"InputUser"},{"name":"score","type":"int"}],"type":"Updates"},{"id":"363700068","method":"messages.setInlineGameScore","params":[{"name":"flags","type":"#"},{"name":"edit_message","type":"flags.0?true"},{"name":"force","type":"flags.1?true"},{"name":"id","type":"InputBotInlineMessageID"},{"name":"user_id","type":"InputUser"},{"name":"score","type":"int"}],"type":"Bool"},{"id":"-400399203","method":"messages.getGameHighScores","params":[{"name":"peer","type":"InputPeer"},{"name":"id","type":"int"},{"name":"user_id","type":"InputUser"}],"type":"messages.HighScores"},{"id":"258170395","method":"messages.getInlineGameHighScores","params":[{"name":"id","type":"InputBotInlineMessageID"},{"name":"user_id","type":"InputUser"}],"type":"messages.HighScores"},{"id":"218777796","method":"messages.getCommonChats","params":[{"name":"user_id","type":"InputUser"},{"name":"max_id","type":"int"},{"name":"limit","type":"int"}],"type":"messages.Chats"},{"id":"-341307408","method":"messages.getAllChats","params":[{"name":"except_ids","type":"Vector"}],"type":"messages.Chats"},{"id":"-333262899","method":"help.setBotUpdatesStatus","params":[{"name":"pending_updates_count","type":"int"},{"name":"message","type":"string"}],"type":"Bool"},{"id":"852135825","method":"messages.getWebPage","params":[{"name":"url","type":"string"},{"name":"hash","type":"int"}],"type":"WebPage"},{"id":"-1489903017","method":"messages.toggleDialogPin","params":[{"name":"flags","type":"#"},{"name":"pinned","type":"flags.0?true"},{"name":"peer","type":"InputDialogPeer"}],"type":"Bool"},{"id":"991616823","method":"messages.reorderPinnedDialogs","params":[{"name":"flags","type":"#"},{"name":"force","type":"flags.0?true"},{"name":"folder_id","type":"int"},{"name":"order","type":"Vector"}],"type":"Bool"},{"id":"-692498958","method":"messages.getPinnedDialogs","params":[{"name":"folder_id","type":"int"}],"type":"messages.PeerDialogs"},{"id":"-1440257555","method":"bots.sendCustomRequest","params":[{"name":"custom_method","type":"string"},{"name":"params","type":"DataJSON"}],"type":"DataJSON"},{"id":"-434028723","method":"bots.answerWebhookJSONQuery","params":[{"name":"query_id","type":"long"},{"name":"data","type":"DataJSON"}],"type":"Bool"},{"id":"619086221","method":"upload.getWebFile","params":[{"name":"location","type":"InputWebFileLocation"},{"name":"offset","type":"int"},{"name":"limit","type":"int"}],"type":"upload.WebFile"},{"id":"-1712285883","method":"payments.getPaymentForm","params":[{"name":"msg_id","type":"int"}],"type":"payments.PaymentForm"},{"id":"-1601001088","method":"payments.getPaymentReceipt","params":[{"name":"msg_id","type":"int"}],"type":"payments.PaymentReceipt"},{"id":"1997180532","method":"payments.validateRequestedInfo","params":[{"name":"flags","type":"#"},{"name":"save","type":"flags.0?true"},{"name":"msg_id","type":"int"},{"name":"info","type":"PaymentRequestedInfo"}],"type":"payments.ValidatedRequestedInfo"},{"id":"730364339","method":"payments.sendPaymentForm","params":[{"name":"flags","type":"#"},{"name":"msg_id","type":"int"},{"name":"requested_info_id","type":"flags.0?string"},{"name":"shipping_option_id","type":"flags.1?string"},{"name":"credentials","type":"InputPaymentCredentials"}],"type":"payments.PaymentResult"},{"id":"1151208273","method":"account.getTmpPassword","params":[{"name":"password","type":"InputCheckPasswordSRP"},{"name":"period","type":"int"}],"type":"account.TmpPassword"},{"id":"578650699","method":"payments.getSavedInfo","params":[],"type":"payments.SavedInfo"},{"id":"-667062079","method":"payments.clearSavedInfo","params":[{"name":"flags","type":"#"},{"name":"credentials","type":"flags.0?true"},{"name":"info","type":"flags.1?true"}],"type":"Bool"},{"id":"-436833542","method":"messages.setBotShippingResults","params":[{"name":"flags","type":"#"},{"name":"query_id","type":"long"},{"name":"error","type":"flags.0?string"},{"name":"shipping_options","type":"flags.1?Vector"}],"type":"Bool"},{"id":"163765653","method":"messages.setBotPrecheckoutResults","params":[{"name":"flags","type":"#"},{"name":"success","type":"flags.1?true"},{"name":"query_id","type":"long"},{"name":"error","type":"flags.0?string"}],"type":"Bool"},{"id":"-251435136","method":"stickers.createStickerSet","params":[{"name":"flags","type":"#"},{"name":"masks","type":"flags.0?true"},{"name":"animated","type":"flags.1?true"},{"name":"user_id","type":"InputUser"},{"name":"title","type":"string"},{"name":"short_name","type":"string"},{"name":"thumb","type":"flags.2?InputDocument"},{"name":"stickers","type":"Vector"}],"type":"messages.StickerSet"},{"id":"-143257775","method":"stickers.removeStickerFromSet","params":[{"name":"sticker","type":"InputDocument"}],"type":"messages.StickerSet"},{"id":"-4795190","method":"stickers.changeStickerPosition","params":[{"name":"sticker","type":"InputDocument"},{"name":"position","type":"int"}],"type":"messages.StickerSet"},{"id":"-2041315650","method":"stickers.addStickerToSet","params":[{"name":"stickerset","type":"InputStickerSet"},{"name":"sticker","type":"InputStickerSetItem"}],"type":"messages.StickerSet"},{"id":"1369162417","method":"messages.uploadMedia","params":[{"name":"peer","type":"InputPeer"},{"name":"media","type":"InputMedia"}],"type":"MessageMedia"},{"id":"1430593449","method":"phone.getCallConfig","params":[],"type":"DataJSON"},{"id":"1124046573","method":"phone.requestCall","params":[{"name":"flags","type":"#"},{"name":"video","type":"flags.0?true"},{"name":"user_id","type":"InputUser"},{"name":"random_id","type":"int"},{"name":"g_a_hash","type":"bytes"},{"name":"protocol","type":"PhoneCallProtocol"}],"type":"phone.PhoneCall"},{"id":"1003664544","method":"phone.acceptCall","params":[{"name":"peer","type":"InputPhoneCall"},{"name":"g_b","type":"bytes"},{"name":"protocol","type":"PhoneCallProtocol"}],"type":"phone.PhoneCall"},{"id":"788404002","method":"phone.confirmCall","params":[{"name":"peer","type":"InputPhoneCall"},{"name":"g_a","type":"bytes"},{"name":"key_fingerprint","type":"long"},{"name":"protocol","type":"PhoneCallProtocol"}],"type":"phone.PhoneCall"},{"id":"399855457","method":"phone.receivedCall","params":[{"name":"peer","type":"InputPhoneCall"}],"type":"Bool"},{"id":"-1295269440","method":"phone.discardCall","params":[{"name":"flags","type":"#"},{"name":"video","type":"flags.0?true"},{"name":"peer","type":"InputPhoneCall"},{"name":"duration","type":"int"},{"name":"reason","type":"PhoneCallDiscardReason"},{"name":"connection_id","type":"long"}],"type":"Updates"},{"id":"1508562471","method":"phone.setCallRating","params":[{"name":"flags","type":"#"},{"name":"user_initiative","type":"flags.0?true"},{"name":"peer","type":"InputPhoneCall"},{"name":"rating","type":"int"},{"name":"comment","type":"string"}],"type":"Updates"},{"id":"662363518","method":"phone.saveCallDebug","params":[{"name":"peer","type":"InputPhoneCall"},{"name":"debug","type":"DataJSON"}],"type":"Bool"},{"id":"536919235","method":"upload.getCdnFile","params":[{"name":"file_token","type":"bytes"},{"name":"offset","type":"int"},{"name":"limit","type":"int"}],"type":"upload.CdnFile"},{"id":"-1691921240","method":"upload.reuploadCdnFile","params":[{"name":"file_token","type":"bytes"},{"name":"request_token","type":"bytes"}],"type":"Vector"},{"id":"1375900482","method":"help.getCdnConfig","params":[],"type":"CdnConfig"},{"id":"-219008246","method":"langpack.getLangPack","params":[{"name":"lang_pack","type":"string"},{"name":"lang_code","type":"string"}],"type":"LangPackDifference"},{"id":"-269862909","method":"langpack.getStrings","params":[{"name":"lang_pack","type":"string"},{"name":"lang_code","type":"string"},{"name":"keys","type":"Vector"}],"type":"Vector"},{"id":"-845657435","method":"langpack.getDifference","params":[{"name":"lang_pack","type":"string"},{"name":"lang_code","type":"string"},{"name":"from_version","type":"int"}],"type":"LangPackDifference"},{"id":"1120311183","method":"langpack.getLanguages","params":[{"name":"lang_pack","type":"string"}],"type":"Vector"},{"id":"1920559378","method":"channels.editBanned","params":[{"name":"channel","type":"InputChannel"},{"name":"user_id","type":"InputUser"},{"name":"banned_rights","type":"ChatBannedRights"}],"type":"Updates"},{"id":"870184064","method":"channels.getAdminLog","params":[{"name":"flags","type":"#"},{"name":"channel","type":"InputChannel"},{"name":"q","type":"string"},{"name":"events_filter","type":"flags.0?ChannelAdminLogEventsFilter"},{"name":"admins","type":"flags.1?Vector"},{"name":"max_id","type":"long"},{"name":"min_id","type":"long"},{"name":"limit","type":"int"}],"type":"channels.AdminLogResults"},{"id":"1302676017","method":"upload.getCdnFileHashes","params":[{"name":"file_token","type":"bytes"},{"name":"offset","type":"int"}],"type":"Vector"},{"id":"-914493408","method":"messages.sendScreenshotNotification","params":[{"name":"peer","type":"InputPeer"},{"name":"reply_to_msg_id","type":"int"},{"name":"random_id","type":"long"}],"type":"Updates"},{"id":"-359881479","method":"channels.setStickers","params":[{"name":"channel","type":"InputChannel"},{"name":"stickerset","type":"InputStickerSet"}],"type":"Bool"},{"id":"567151374","method":"messages.getFavedStickers","params":[{"name":"hash","type":"int"}],"type":"messages.FavedStickers"},{"id":"-1174420133","method":"messages.faveSticker","params":[{"name":"id","type":"InputDocument"},{"name":"unfave","type":"Bool"}],"type":"Bool"},{"id":"-357180360","method":"channels.readMessageContents","params":[{"name":"channel","type":"InputChannel"},{"name":"id","type":"Vector"}],"type":"Bool"},{"id":"-2020263951","method":"contacts.resetSaved","params":[],"type":"Bool"},{"id":"1180140658","method":"messages.getUnreadMentions","params":[{"name":"peer","type":"InputPeer"},{"name":"offset_id","type":"int"},{"name":"add_offset","type":"int"},{"name":"limit","type":"int"},{"name":"max_id","type":"int"},{"name":"min_id","type":"int"}],"type":"messages.Messages"},{"id":"-1355375294","method":"channels.deleteHistory","params":[{"name":"channel","type":"InputChannel"},{"name":"max_id","type":"int"}],"type":"Bool"},{"id":"1036054804","method":"help.getRecentMeUrls","params":[{"name":"referer","type":"string"}],"type":"help.RecentMeUrls"},{"id":"-356796084","method":"channels.togglePreHistoryHidden","params":[{"name":"channel","type":"InputChannel"},{"name":"enabled","type":"Bool"}],"type":"Updates"},{"id":"251759059","method":"messages.readMentions","params":[{"name":"peer","type":"InputPeer"}],"type":"messages.AffectedHistory"},{"id":"-1144759543","method":"messages.getRecentLocations","params":[{"name":"peer","type":"InputPeer"},{"name":"limit","type":"int"},{"name":"hash","type":"int"}],"type":"messages.Messages"},{"id":"-872345397","method":"messages.sendMultiMedia","params":[{"name":"flags","type":"#"},{"name":"silent","type":"flags.5?true"},{"name":"background","type":"flags.6?true"},{"name":"clear_draft","type":"flags.7?true"},{"name":"peer","type":"InputPeer"},{"name":"reply_to_msg_id","type":"flags.0?int"},{"name":"multi_media","type":"Vector"},{"name":"schedule_date","type":"flags.10?int"}],"type":"Updates"},{"id":"1347929239","method":"messages.uploadEncryptedFile","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"file","type":"InputEncryptedFile"}],"type":"EncryptedFile"},{"id":"405695855","method":"account.getWebAuthorizations","params":[],"type":"account.WebAuthorizations"},{"id":"755087855","method":"account.resetWebAuthorization","params":[{"name":"hash","type":"long"}],"type":"Bool"},{"id":"1747789204","method":"account.resetWebAuthorizations","params":[],"type":"Bool"},{"id":"-1028140917","method":"messages.searchStickerSets","params":[{"name":"flags","type":"#"},{"name":"exclude_featured","type":"flags.0?true"},{"name":"q","type":"string"},{"name":"hash","type":"int"}],"type":"messages.FoundStickerSets"},{"id":"-956147407","method":"upload.getFileHashes","params":[{"name":"location","type":"InputFileLocation"},{"name":"offset","type":"int"}],"type":"Vector"},{"id":"749019089","method":"help.getTermsOfServiceUpdate","params":[],"type":"help.TermsOfServiceUpdate"},{"id":"-294455398","method":"help.acceptTermsOfService","params":[{"name":"id","type":"DataJSON"}],"type":"Bool"},{"id":"-1299661699","method":"account.getAllSecureValues","params":[],"type":"Vector"},{"id":"1936088002","method":"account.getSecureValue","params":[{"name":"types","type":"Vector"}],"type":"Vector"},{"id":"-1986010339","method":"account.saveSecureValue","params":[{"name":"value","type":"InputSecureValue"},{"name":"secure_secret_id","type":"long"}],"type":"SecureValue"},{"id":"-1199522741","method":"account.deleteSecureValue","params":[{"name":"types","type":"Vector"}],"type":"Bool"},{"id":"-1865902923","method":"users.setSecureValueErrors","params":[{"name":"id","type":"InputUser"},{"name":"errors","type":"Vector"}],"type":"Bool"},{"id":"-1200903967","method":"account.getAuthorizationForm","params":[{"name":"bot_id","type":"int"},{"name":"scope","type":"string"},{"name":"public_key","type":"string"}],"type":"account.AuthorizationForm"},{"id":"-419267436","method":"account.acceptAuthorization","params":[{"name":"bot_id","type":"int"},{"name":"scope","type":"string"},{"name":"public_key","type":"string"},{"name":"value_hashes","type":"Vector"},{"name":"credentials","type":"SecureCredentialsEncrypted"}],"type":"Bool"},{"id":"-1516022023","method":"account.sendVerifyPhoneCode","params":[{"name":"phone_number","type":"string"},{"name":"settings","type":"CodeSettings"}],"type":"auth.SentCode"},{"id":"1305716726","method":"account.verifyPhone","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"},{"name":"phone_code","type":"string"}],"type":"Bool"},{"id":"1880182943","method":"account.sendVerifyEmailCode","params":[{"name":"email","type":"string"}],"type":"account.SentEmailCode"},{"id":"-323339813","method":"account.verifyEmail","params":[{"name":"email","type":"string"},{"name":"code","type":"string"}],"type":"Bool"},{"id":"1072547679","method":"help.getDeepLinkInfo","params":[{"name":"path","type":"string"}],"type":"help.DeepLinkInfo"},{"id":"-2098076769","method":"contacts.getSaved","params":[],"type":"Vector"},{"id":"-2092831552","method":"channels.getLeftChannels","params":[{"name":"offset","type":"int"}],"type":"messages.Chats"},{"id":"-262453244","method":"account.initTakeoutSession","params":[{"name":"flags","type":"#"},{"name":"contacts","type":"flags.0?true"},{"name":"message_users","type":"flags.1?true"},{"name":"message_chats","type":"flags.2?true"},{"name":"message_megagroups","type":"flags.3?true"},{"name":"message_channels","type":"flags.4?true"},{"name":"files","type":"flags.5?true"},{"name":"file_max_size","type":"flags.5?int"}],"type":"account.Takeout"},{"id":"489050862","method":"account.finishTakeoutSession","params":[{"name":"flags","type":"#"},{"name":"success","type":"flags.0?true"}],"type":"Bool"},{"id":"486505992","method":"messages.getSplitRanges","params":[],"type":"Vector"},{"id":"911373810","method":"invokeWithMessagesRange","params":[{"name":"range","type":"MessageRange"},{"name":"query","type":"!X"}],"type":"X"},{"id":"-1398145746","method":"invokeWithTakeout","params":[{"name":"takeout_id","type":"long"},{"name":"query","type":"!X"}],"type":"X"},{"id":"-1031349873","method":"messages.markDialogUnread","params":[{"name":"flags","type":"#"},{"name":"unread","type":"flags.0?true"},{"name":"peer","type":"InputDialogPeer"}],"type":"Bool"},{"id":"585256482","method":"messages.getDialogUnreadMarks","params":[],"type":"Vector"},{"id":"-2062238246","method":"contacts.toggleTopPeers","params":[{"name":"enabled","type":"Bool"}],"type":"Bool"},{"id":"2119757468","method":"messages.clearAllDrafts","params":[],"type":"Bool"},{"id":"-1735311088","method":"help.getAppConfig","params":[],"type":"JSONValue"},{"id":"1862465352","method":"help.saveAppLog","params":[{"name":"events","type":"Vector"}],"type":"Bool"},{"id":"-966677240","method":"help.getPassportConfig","params":[{"name":"hash","type":"int"}],"type":"help.PassportConfig"},{"id":"1784243458","method":"langpack.getLanguage","params":[{"name":"lang_pack","type":"string"},{"name":"lang_code","type":"string"}],"type":"LangPackLanguage"},{"id":"-760547348","method":"messages.updatePinnedMessage","params":[{"name":"flags","type":"#"},{"name":"silent","type":"flags.0?true"},{"name":"unpin","type":"flags.1?true"},{"name":"pm_oneside","type":"flags.2?true"},{"name":"peer","type":"InputPeer"},{"name":"id","type":"int"}],"type":"Updates"},{"id":"-1881204448","method":"account.confirmPasswordEmail","params":[{"name":"code","type":"string"}],"type":"Bool"},{"id":"2055154197","method":"account.resendPasswordEmail","params":[],"type":"Bool"},{"id":"-1043606090","method":"account.cancelPasswordEmail","params":[],"type":"Bool"},{"id":"-748624084","method":"help.getSupportName","params":[],"type":"help.SupportName"},{"id":"59377875","method":"help.getUserInfo","params":[{"name":"user_id","type":"InputUser"}],"type":"help.UserInfo"},{"id":"1723407216","method":"help.editUserInfo","params":[{"name":"user_id","type":"InputUser"},{"name":"message","type":"string"},{"name":"entities","type":"Vector"}],"type":"help.UserInfo"},{"id":"-1626880216","method":"account.getContactSignUpNotification","params":[],"type":"Bool"},{"id":"-806076575","method":"account.setContactSignUpNotification","params":[{"name":"silent","type":"Bool"}],"type":"Bool"},{"id":"1398240377","method":"account.getNotifyExceptions","params":[{"name":"flags","type":"#"},{"name":"compare_sound","type":"flags.1?true"},{"name":"peer","type":"flags.0?InputNotifyPeer"}],"type":"Updates"},{"id":"283795844","method":"messages.sendVote","params":[{"name":"peer","type":"InputPeer"},{"name":"msg_id","type":"int"},{"name":"options","type":"Vector"}],"type":"Updates"},{"id":"1941660731","method":"messages.getPollResults","params":[{"name":"peer","type":"InputPeer"},{"name":"msg_id","type":"int"}],"type":"Updates"},{"id":"1848369232","method":"messages.getOnlines","params":[{"name":"peer","type":"InputPeer"}],"type":"ChatOnlines"},{"id":"-2127811866","method":"messages.getStatsURL","params":[{"name":"flags","type":"#"},{"name":"dark","type":"flags.0?true"},{"name":"peer","type":"InputPeer"},{"name":"params","type":"string"}],"type":"StatsURL"},{"id":"-554301545","method":"messages.editChatAbout","params":[{"name":"peer","type":"InputPeer"},{"name":"about","type":"string"}],"type":"Bool"},{"id":"-1517917375","method":"messages.editChatDefaultBannedRights","params":[{"name":"peer","type":"InputPeer"},{"name":"banned_rights","type":"ChatBannedRights"}],"type":"Updates"},{"id":"-57811990","method":"account.getWallPaper","params":[{"name":"wallpaper","type":"InputWallPaper"}],"type":"WallPaper"},{"id":"-578472351","method":"account.uploadWallPaper","params":[{"name":"file","type":"InputFile"},{"name":"mime_type","type":"string"},{"name":"settings","type":"WallPaperSettings"}],"type":"WallPaper"},{"id":"1817860919","method":"account.saveWallPaper","params":[{"name":"wallpaper","type":"InputWallPaper"},{"name":"unsave","type":"Bool"},{"name":"settings","type":"WallPaperSettings"}],"type":"Bool"},{"id":"-18000023","method":"account.installWallPaper","params":[{"name":"wallpaper","type":"InputWallPaper"},{"name":"settings","type":"WallPaperSettings"}],"type":"Bool"},{"id":"-1153722364","method":"account.resetWallPapers","params":[],"type":"Bool"},{"id":"1457130303","method":"account.getAutoDownloadSettings","params":[],"type":"account.AutoDownloadSettings"},{"id":"1995661875","method":"account.saveAutoDownloadSettings","params":[{"name":"flags","type":"#"},{"name":"low","type":"flags.0?true"},{"name":"high","type":"flags.1?true"},{"name":"settings","type":"AutoDownloadSettings"}],"type":"Bool"},{"id":"899735650","method":"messages.getEmojiKeywords","params":[{"name":"lang_code","type":"string"}],"type":"EmojiKeywordsDifference"},{"id":"352892591","method":"messages.getEmojiKeywordsDifference","params":[{"name":"lang_code","type":"string"},{"name":"from_version","type":"int"}],"type":"EmojiKeywordsDifference"},{"id":"1318675378","method":"messages.getEmojiKeywordsLanguages","params":[{"name":"lang_codes","type":"Vector"}],"type":"Vector"},{"id":"-709817306","method":"messages.getEmojiURL","params":[{"name":"lang_code","type":"string"}],"type":"EmojiURL"},{"id":"1749536939","method":"folders.editPeerFolders","params":[{"name":"folder_peers","type":"Vector"}],"type":"Updates"},{"id":"472471681","method":"folders.deleteFolder","params":[{"name":"folder_id","type":"int"}],"type":"Updates"},{"id":"1932455680","method":"messages.getSearchCounters","params":[{"name":"peer","type":"InputPeer"},{"name":"filters","type":"Vector"}],"type":"Vector"},{"id":"-170208392","method":"channels.getGroupsForDiscussion","params":[],"type":"messages.Chats"},{"id":"1079520178","method":"channels.setDiscussionGroup","params":[{"name":"broadcast","type":"InputChannel"},{"name":"group","type":"InputChannel"}],"type":"Bool"},{"id":"-482388461","method":"messages.requestUrlAuth","params":[{"name":"peer","type":"InputPeer"},{"name":"msg_id","type":"int"},{"name":"button_id","type":"int"}],"type":"UrlAuthResult"},{"id":"-148247912","method":"messages.acceptUrlAuth","params":[{"name":"flags","type":"#"},{"name":"write_allowed","type":"flags.0?true"},{"name":"peer","type":"InputPeer"},{"name":"msg_id","type":"int"},{"name":"button_id","type":"int"}],"type":"UrlAuthResult"},{"id":"1336717624","method":"messages.hidePeerSettingsBar","params":[{"name":"peer","type":"InputPeer"}],"type":"Bool"},{"id":"-386636848","method":"contacts.addContact","params":[{"name":"flags","type":"#"},{"name":"add_phone_privacy_exception","type":"flags.0?true"},{"name":"id","type":"InputUser"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"phone","type":"string"}],"type":"Updates"},{"id":"-130964977","method":"contacts.acceptContact","params":[{"name":"id","type":"InputUser"}],"type":"Updates"},{"id":"-1892102881","method":"channels.editCreator","params":[{"name":"channel","type":"InputChannel"},{"name":"user_id","type":"InputUser"},{"name":"password","type":"InputCheckPasswordSRP"}],"type":"Updates"},{"id":"-750207932","method":"contacts.getLocated","params":[{"name":"flags","type":"#"},{"name":"background","type":"flags.1?true"},{"name":"geo_point","type":"InputGeoPoint"},{"name":"self_expires","type":"flags.0?int"}],"type":"Updates"},{"id":"1491484525","method":"channels.editLocation","params":[{"name":"channel","type":"InputChannel"},{"name":"geo_point","type":"InputGeoPoint"},{"name":"address","type":"string"}],"type":"Bool"},{"id":"-304832784","method":"channels.toggleSlowMode","params":[{"name":"channel","type":"InputChannel"},{"name":"seconds","type":"int"}],"type":"Updates"},{"id":"-490575781","method":"messages.getScheduledHistory","params":[{"name":"peer","type":"InputPeer"},{"name":"hash","type":"int"}],"type":"messages.Messages"},{"id":"-1111817116","method":"messages.getScheduledMessages","params":[{"name":"peer","type":"InputPeer"},{"name":"id","type":"Vector"}],"type":"messages.Messages"},{"id":"-1120369398","method":"messages.sendScheduledMessages","params":[{"name":"peer","type":"InputPeer"},{"name":"id","type":"Vector"}],"type":"Updates"},{"id":"1504586518","method":"messages.deleteScheduledMessages","params":[{"name":"peer","type":"InputPeer"},{"name":"id","type":"Vector"}],"type":"Updates"},{"id":"473805619","method":"account.uploadTheme","params":[{"name":"flags","type":"#"},{"name":"file","type":"InputFile"},{"name":"thumb","type":"flags.0?InputFile"},{"name":"file_name","type":"string"},{"name":"mime_type","type":"string"}],"type":"Document"},{"id":"-2077048289","method":"account.createTheme","params":[{"name":"flags","type":"#"},{"name":"slug","type":"string"},{"name":"title","type":"string"},{"name":"document","type":"flags.2?InputDocument"},{"name":"settings","type":"flags.3?InputThemeSettings"}],"type":"Theme"},{"id":"1555261397","method":"account.updateTheme","params":[{"name":"flags","type":"#"},{"name":"format","type":"string"},{"name":"theme","type":"InputTheme"},{"name":"slug","type":"flags.0?string"},{"name":"title","type":"flags.1?string"},{"name":"document","type":"flags.2?InputDocument"},{"name":"settings","type":"flags.3?InputThemeSettings"}],"type":"Theme"},{"id":"-229175188","method":"account.saveTheme","params":[{"name":"theme","type":"InputTheme"},{"name":"unsave","type":"Bool"}],"type":"Bool"},{"id":"2061776695","method":"account.installTheme","params":[{"name":"flags","type":"#"},{"name":"dark","type":"flags.0?true"},{"name":"format","type":"flags.1?string"},{"name":"theme","type":"flags.1?InputTheme"}],"type":"Bool"},{"id":"-1919060949","method":"account.getTheme","params":[{"name":"format","type":"string"},{"name":"theme","type":"InputTheme"},{"name":"document_id","type":"long"}],"type":"Theme"},{"id":"676939512","method":"account.getThemes","params":[{"name":"format","type":"string"},{"name":"hash","type":"int"}],"type":"account.Themes"},{"id":"-1313598185","method":"auth.exportLoginToken","params":[{"name":"api_id","type":"int"},{"name":"api_hash","type":"string"},{"name":"except_ids","type":"Vector"}],"type":"auth.LoginToken"},{"id":"-1783866140","method":"auth.importLoginToken","params":[{"name":"token","type":"bytes"}],"type":"auth.LoginToken"},{"id":"-392909491","method":"auth.acceptLoginToken","params":[{"name":"token","type":"bytes"}],"type":"Authorization"},{"id":"-1250643605","method":"account.setContentSettings","params":[{"name":"flags","type":"#"},{"name":"sensitive_enabled","type":"flags.0?true"}],"type":"Bool"},{"id":"-1952756306","method":"account.getContentSettings","params":[],"type":"account.ContentSettings"},{"id":"300429806","method":"channels.getInactiveChannels","params":[],"type":"messages.InactiveChats"},{"id":"1705865692","method":"account.getMultiWallPapers","params":[{"name":"wallpapers","type":"Vector"}],"type":"Vector"},{"id":"-1200736242","method":"messages.getPollVotes","params":[{"name":"flags","type":"#"},{"name":"peer","type":"InputPeer"},{"name":"id","type":"int"},{"name":"option","type":"flags.0?bytes"},{"name":"offset","type":"flags.1?string"},{"name":"limit","type":"int"}],"type":"messages.VotesList"},{"id":"-1257951254","method":"messages.toggleStickerSets","params":[{"name":"flags","type":"#"},{"name":"uninstall","type":"flags.0?true"},{"name":"archive","type":"flags.1?true"},{"name":"unarchive","type":"flags.2?true"},{"name":"stickersets","type":"Vector"}],"type":"Bool"},{"id":"779736953","method":"payments.getBankCardData","params":[{"name":"number","type":"string"}],"type":"payments.BankCardData"},{"id":"-241247891","method":"messages.getDialogFilters","params":[],"type":"Vector"},{"id":"-1566780372","method":"messages.getSuggestedDialogFilters","params":[],"type":"Vector"},{"id":"450142282","method":"messages.updateDialogFilter","params":[{"name":"flags","type":"#"},{"name":"id","type":"int"},{"name":"filter","type":"flags.0?DialogFilter"}],"type":"Bool"},{"id":"-983318044","method":"messages.updateDialogFiltersOrder","params":[{"name":"order","type":"Vector"}],"type":"Bool"},{"id":"-1421720550","method":"stats.getBroadcastStats","params":[{"name":"flags","type":"#"},{"name":"dark","type":"flags.0?true"},{"name":"channel","type":"InputChannel"}],"type":"stats.BroadcastStats"},{"id":"1646092192","method":"stats.loadAsyncGraph","params":[{"name":"flags","type":"#"},{"name":"token","type":"string"},{"name":"x","type":"flags.0?long"}],"type":"StatsGraph"},{"id":"-1707717072","method":"stickers.setStickerSetThumb","params":[{"name":"stickerset","type":"InputStickerSet"},{"name":"thumb","type":"InputDocument"}],"type":"messages.StickerSet"},{"id":"-2141370634","method":"bots.setBotCommands","params":[{"name":"commands","type":"Vector"}],"type":"Bool"},{"id":"1608974939","method":"messages.getOldFeaturedStickers","params":[{"name":"offset","type":"int"},{"name":"limit","type":"int"},{"name":"hash","type":"int"}],"type":"messages.FeaturedStickers"},{"id":"-1063816159","method":"help.getPromoData","params":[],"type":"help.PromoData"},{"id":"505748629","method":"help.hidePromoData","params":[{"name":"peer","type":"InputPeer"}],"type":"Bool"},{"id":"-8744061","method":"phone.sendSignalingData","params":[{"name":"peer","type":"InputPhoneCall"},{"name":"data","type":"bytes"}],"type":"Bool"},{"id":"-589330937","method":"stats.getMegagroupStats","params":[{"name":"flags","type":"#"},{"name":"dark","type":"flags.0?true"},{"name":"channel","type":"InputChannel"}],"type":"stats.MegagroupStats"},{"id":"-349483786","method":"account.getGlobalPrivacySettings","params":[],"type":"GlobalPrivacySettings"},{"id":"517647042","method":"account.setGlobalPrivacySettings","params":[{"name":"settings","type":"GlobalPrivacySettings"}],"type":"GlobalPrivacySettings"},{"id":"125807007","method":"help.dismissSuggestion","params":[{"name":"suggestion","type":"string"}],"type":"Bool"},{"id":"1935116200","method":"help.getCountriesList","params":[{"name":"lang_code","type":"string"},{"name":"hash","type":"int"}],"type":"help.CountriesList"},{"id":"615875002","method":"messages.getReplies","params":[{"name":"peer","type":"InputPeer"},{"name":"msg_id","type":"int"},{"name":"offset_id","type":"int"},{"name":"offset_date","type":"int"},{"name":"add_offset","type":"int"},{"name":"limit","type":"int"},{"name":"max_id","type":"int"},{"name":"min_id","type":"int"},{"name":"hash","type":"int"}],"type":"messages.Messages"},{"id":"1147761405","method":"messages.getDiscussionMessage","params":[{"name":"peer","type":"InputPeer"},{"name":"msg_id","type":"int"}],"type":"messages.DiscussionMessage"},{"id":"-147740172","method":"messages.readDiscussion","params":[{"name":"peer","type":"InputPeer"},{"name":"msg_id","type":"int"},{"name":"read_max_id","type":"int"}],"type":"Bool"},{"id":"698914348","method":"contacts.blockFromReplies","params":[{"name":"flags","type":"#"},{"name":"delete_message","type":"flags.0?true"},{"name":"delete_history","type":"flags.1?true"},{"name":"report_spam","type":"flags.2?true"},{"name":"msg_id","type":"int"}],"type":"Updates"},{"id":"1445996571","method":"stats.getMessagePublicForwards","params":[{"name":"channel","type":"InputChannel"},{"name":"msg_id","type":"int"},{"name":"offset_rate","type":"int"},{"name":"offset_peer","type":"InputPeer"},{"name":"offset_id","type":"int"},{"name":"limit","type":"int"}],"type":"messages.Messages"},{"id":"-1226791947","method":"stats.getMessageStats","params":[{"name":"flags","type":"#"},{"name":"dark","type":"flags.0?true"},{"name":"channel","type":"InputChannel"},{"name":"msg_id","type":"int"}],"type":"stats.MessageStats"},{"id":"-265962357","method":"messages.unpinAllMessages","params":[{"name":"peer","type":"InputPeer"}],"type":"messages.AffectedHistory"}]} \ No newline at end of file diff --git a/data/core.telegram.org/schema/mtproto-json.html b/data/core.telegram.org/schema/mtproto-json.html new file mode 100644 index 0000000000..ed1c72d268 --- /dev/null +++ b/data/core.telegram.org/schema/mtproto-json.html @@ -0,0 +1 @@ +{"constructors":[{"id":"481674261","predicate":"vector","params":[],"type":"Vector t"},{"id":"85337187","predicate":"resPQ","params":[{"name":"nonce","type":"int128"},{"name":"server_nonce","type":"int128"},{"name":"pq","type":"bytes"},{"name":"server_public_key_fingerprints","type":"Vector"}],"type":"ResPQ"},{"id":"-2083955988","predicate":"p_q_inner_data","params":[{"name":"pq","type":"bytes"},{"name":"p","type":"bytes"},{"name":"q","type":"bytes"},{"name":"nonce","type":"int128"},{"name":"server_nonce","type":"int128"},{"name":"new_nonce","type":"int256"}],"type":"P_Q_inner_data"},{"id":"-1443537003","predicate":"p_q_inner_data_dc","params":[{"name":"pq","type":"bytes"},{"name":"p","type":"bytes"},{"name":"q","type":"bytes"},{"name":"nonce","type":"int128"},{"name":"server_nonce","type":"int128"},{"name":"new_nonce","type":"int256"},{"name":"dc","type":"int"}],"type":"P_Q_inner_data"},{"id":"1013613780","predicate":"p_q_inner_data_temp","params":[{"name":"pq","type":"bytes"},{"name":"p","type":"bytes"},{"name":"q","type":"bytes"},{"name":"nonce","type":"int128"},{"name":"server_nonce","type":"int128"},{"name":"new_nonce","type":"int256"},{"name":"expires_in","type":"int"}],"type":"P_Q_inner_data"},{"id":"1459478408","predicate":"p_q_inner_data_temp_dc","params":[{"name":"pq","type":"bytes"},{"name":"p","type":"bytes"},{"name":"q","type":"bytes"},{"name":"nonce","type":"int128"},{"name":"server_nonce","type":"int128"},{"name":"new_nonce","type":"int256"},{"name":"dc","type":"int"},{"name":"expires_in","type":"int"}],"type":"P_Q_inner_d"},{"id":"2043348061","predicate":"server_DH_params_fail","params":[{"name":"nonce","type":"int128"},{"name":"server_nonce","type":"int128"},{"name":"new_nonce_hash","type":"int128"}],"type":"Server_DH_Params"},{"id":"-790100132","predicate":"server_DH_params_ok","params":[{"name":"nonce","type":"int128"},{"name":"server_nonce","type":"int128"},{"name":"encrypted_answer","type":"bytes"}],"type":"Server_DH_Params"},{"id":"-1249309254","predicate":"server_DH_inner_data","params":[{"name":"nonce","type":"int128"},{"name":"server_nonce","type":"int128"},{"name":"g","type":"int"},{"name":"dh_prime","type":"bytes"},{"name":"g_a","type":"bytes"},{"name":"server_time","type":"int"}],"type":"Server_DH_inner_data"},{"id":"1715713620","predicate":"client_DH_inner_data","params":[{"name":"nonce","type":"int128"},{"name":"server_nonce","type":"int128"},{"name":"retry_id","type":"long"},{"name":"g_b","type":"bytes"}],"type":"Client_DH_Inner_Data"},{"id":"1003222836","predicate":"dh_gen_ok","params":[{"name":"nonce","type":"int128"},{"name":"server_nonce","type":"int128"},{"name":"new_nonce_hash1","type":"int128"}],"type":"Set_client_DH_params_answer"},{"id":"1188831161","predicate":"dh_gen_retry","params":[{"name":"nonce","type":"int128"},{"name":"server_nonce","type":"int128"},{"name":"new_nonce_hash2","type":"int128"}],"type":"Set_client_DH_params_answer"},{"id":"-1499615742","predicate":"dh_gen_fail","params":[{"name":"nonce","type":"int128"},{"name":"server_nonce","type":"int128"},{"name":"new_nonce_hash3","type":"int128"}],"type":"Set_client_DH_params_answer"},{"id":"-212046591","predicate":"rpc_result","params":[{"name":"req_msg_id","type":"long"},{"name":"result","type":"Object"}],"type":"RpcResult"},{"id":"558156313","predicate":"rpc_error","params":[{"name":"error_code","type":"int"},{"name":"error_message","type":"string"}],"type":"RpcError"},{"id":"1579864942","predicate":"rpc_answer_unknown","params":[],"type":"RpcDropAnswer"},{"id":"-847714938","predicate":"rpc_answer_dropped_running","params":[],"type":"RpcDropAnswer"},{"id":"-1539647305","predicate":"rpc_answer_dropped","params":[{"name":"msg_id","type":"long"},{"name":"seq_no","type":"int"},{"name":"bytes","type":"int"}],"type":"RpcDropAnswer"},{"id":"155834844","predicate":"future_salt","params":[{"name":"valid_since","type":"int"},{"name":"valid_until","type":"int"},{"name":"salt","type":"long"}],"type":"FutureSalt"},{"id":"-1370486635","predicate":"future_salts","params":[{"name":"req_msg_id","type":"long"},{"name":"now","type":"int"},{"name":"salts","type":"vector"}],"type":"FutureSalts"},{"id":"880243653","predicate":"pong","params":[{"name":"msg_id","type":"long"},{"name":"ping_id","type":"long"}],"type":"Pong"},{"id":"-1631450872","predicate":"new_session_created","params":[{"name":"first_msg_id","type":"long"},{"name":"unique_id","type":"long"},{"name":"server_salt","type":"long"}],"type":"NewSession"},{"id":"1945237724","predicate":"msg_container","params":[{"name":"messages","type":"vector<%Message>"}],"type":"MessageContainer"},{"id":"1538843921","predicate":"message","params":[{"name":"msg_id","type":"long"},{"name":"seqno","type":"int"},{"name":"bytes","type":"int"},{"name":"body","type":"Object"}],"type":"Message"},{"id":"-530561358","predicate":"msg_copy","params":[{"name":"orig_message","type":"Message"}],"type":"MessageCopy"},{"id":"812830625","predicate":"gzip_packed","params":[{"name":"packed_data","type":"bytes"}],"type":"Object"},{"id":"1658238041","predicate":"msgs_ack","params":[{"name":"msg_ids","type":"Vector"}],"type":"MsgsAck"},{"id":"-1477445615","predicate":"bad_msg_notification","params":[{"name":"bad_msg_id","type":"long"},{"name":"bad_msg_seqno","type":"int"},{"name":"error_code","type":"int"}],"type":"BadMsgNotification"},{"id":"-307542917","predicate":"bad_server_salt","params":[{"name":"bad_msg_id","type":"long"},{"name":"bad_msg_seqno","type":"int"},{"name":"error_code","type":"int"},{"name":"new_server_salt","type":"long"}],"type":"BadMsgNotification"},{"id":"2105940488","predicate":"msg_resend_req","params":[{"name":"msg_ids","type":"Vector"}],"type":"MsgResendReq"},{"id":"-2045723925","predicate":"msg_resend_ans_req","params":[{"name":"msg_ids","type":"Vector"}],"type":"MsgResendReq"},{"id":"-630588590","predicate":"msgs_state_req","params":[{"name":"msg_ids","type":"Vector"}],"type":"MsgsStateReq"},{"id":"81704317","predicate":"msgs_state_info","params":[{"name":"req_msg_id","type":"long"},{"name":"info","type":"bytes"}],"type":"MsgsStateInfo"},{"id":"-1933520591","predicate":"msgs_all_info","params":[{"name":"msg_ids","type":"Vector"},{"name":"info","type":"bytes"}],"type":"MsgsAllInfo"},{"id":"661470918","predicate":"msg_detailed_info","params":[{"name":"msg_id","type":"long"},{"name":"answer_msg_id","type":"long"},{"name":"bytes","type":"int"},{"name":"status","type":"int"}],"type":"MsgDetailedInfo"},{"id":"-2137147681","predicate":"msg_new_detailed_info","params":[{"name":"answer_msg_id","type":"long"},{"name":"bytes","type":"int"},{"name":"status","type":"int"}],"type":"MsgDetailedInfo"},{"id":"1973679973","predicate":"bind_auth_key_inner","params":[{"name":"nonce","type":"long"},{"name":"temp_auth_key_id","type":"long"},{"name":"perm_auth_key_id","type":"long"},{"name":"temp_session_id","type":"long"},{"name":"expires_at","type":"int"}],"type":"BindAuthKeyInner"},{"id":"-161422892","predicate":"destroy_auth_key_ok","params":[],"type":"DestroyAuthKeyRes"},{"id":"178201177","predicate":"destroy_auth_key_none","params":[],"type":"DestroyAuthKeyRes"},{"id":"-368010477","predicate":"destroy_auth_key_fail","params":[],"type":"DestroyAuthKeyRes"},{"id":"-501201412","predicate":"destroy_session_ok","params":[{"name":"session_id","type":"long"}],"type":"DestroySessionRes"},{"id":"1658015945","predicate":"destroy_session_none","params":[{"name":"session_id","type":"long"}],"type":"DestroySessionRes"}],"methods":[{"id":"1615239032","method":"req_pq","params":[{"name":"nonce","type":"int128"}],"type":"ResPQ"},{"id":"-1099002127","method":"req_pq_multi","params":[{"name":"nonce","type":"int128"}],"type":"ResPQ"},{"id":"-686627650","method":"req_DH_params","params":[{"name":"nonce","type":"int128"},{"name":"server_nonce","type":"int128"},{"name":"p","type":"bytes"},{"name":"q","type":"bytes"},{"name":"public_key_fingerprint","type":"long"},{"name":"encrypted_data","type":"bytes"}],"type":"Server_DH_Params"},{"id":"-184262881","method":"set_client_DH_params","params":[{"name":"nonce","type":"int128"},{"name":"server_nonce","type":"int128"},{"name":"encrypted_data","type":"bytes"}],"type":"Set_client_DH_params_answer"},{"id":"1491380032","method":"rpc_drop_answer","params":[{"name":"req_msg_id","type":"long"}],"type":"RpcDropAnswer"},{"id":"-1188971260","method":"get_future_salts","params":[{"name":"num","type":"int"}],"type":"FutureSalts"},{"id":"2059302892","method":"ping","params":[{"name":"ping_id","type":"long"}],"type":"Pong"},{"id":"-213746804","method":"ping_delay_disconnect","params":[{"name":"ping_id","type":"long"},{"name":"disconnect_delay","type":"int"}],"type":"Pong"},{"id":"-1835453025","method":"http_wait","params":[{"name":"max_delay","type":"int"},{"name":"wait_after","type":"int"},{"name":"max_wait","type":"int"}],"type":"HttpWait"},{"id":"-784117408","method":"destroy_auth_key","params":[],"type":"DestroyAuthKeyRes"},{"id":"-414113498","method":"destroy_session","params":[{"name":"session_id","type":"long"}],"type":"DestroySessionRes"}]} \ No newline at end of file diff --git a/data/core.telegram.org/schema/mtproto.html b/data/core.telegram.org/schema/mtproto.html new file mode 100644 index 0000000000..6e3e0fd22a --- /dev/null +++ b/data/core.telegram.org/schema/mtproto.html @@ -0,0 +1,197 @@ + + + + + Current MTProto TL-schema + + + + + + + + + + + + + +
+ +
+
+
+ +

Current MTProto TL-schema

+ +

Below you will find the current MTProto TL-schema. More details on TL »

+

See also the detailed schema in JSON »

+


+
int ? = Int;
+long ? = Long;
+double ? = Double;
+string ? = String;
+
+vector {t:Type} # [ t ] = Vector t;
+
+int128 4*[ int ] = Int128;
+int256 8*[ int ] = Int256;
+
+resPQ#05162463 nonce:int128 server_nonce:int128 pq:bytes server_public_key_fingerprints:Vector<long> = ResPQ;
+
+p_q_inner_data#83c95aec pq:bytes p:bytes q:bytes nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data;
+
+
+server_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;
+server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:bytes = Server_DH_Params;
+
+server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:bytes g_a:bytes server_time:int = Server_DH_inner_data;
+
+client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:bytes = Client_DH_Inner_Data;
+
+dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;
+dh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;
+dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;
+
+rpc_result#f35c6d01 req_msg_id:long result:Object = RpcResult;
+rpc_error#2144ca19 error_code:int error_message:string = RpcError;
+
+rpc_answer_unknown#5e2ad36e = RpcDropAnswer;
+rpc_answer_dropped_running#cd78e586 = RpcDropAnswer;
+rpc_answer_dropped#a43ad8b7 msg_id:long seq_no:int bytes:int = RpcDropAnswer;
+
+future_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt;
+future_salts#ae500895 req_msg_id:long now:int salts:vector<future_salt> = FutureSalts;
+
+pong#347773c5 msg_id:long ping_id:long = Pong;
+
+destroy_session_ok#e22045fc session_id:long = DestroySessionRes;
+destroy_session_none#62d350c9 session_id:long = DestroySessionRes;
+
+new_session_created#9ec20908 first_msg_id:long unique_id:long server_salt:long = NewSession;
+
+msg_container#73f1f8dc messages:vector<%Message> = MessageContainer;
+message msg_id:long seqno:int bytes:int body:Object = Message;
+msg_copy#e06046b2 orig_message:Message = MessageCopy;
+
+gzip_packed#3072cfa1 packed_data:bytes = Object;
+
+msgs_ack#62d6b459 msg_ids:Vector<long> = MsgsAck;
+
+bad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int error_code:int = BadMsgNotification;
+bad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification;
+
+msg_resend_req#7d861a08 msg_ids:Vector<long> = MsgResendReq;
+msgs_state_req#da69fb52 msg_ids:Vector<long> = MsgsStateReq;
+msgs_state_info#04deb57d req_msg_id:long info:bytes = MsgsStateInfo;
+msgs_all_info#8cc0d131 msg_ids:Vector<long> info:bytes = MsgsAllInfo;
+msg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo;
+msg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo;
+
+---functions---
+
+req_pq#60469778 nonce:int128 = ResPQ;
+
+req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:bytes q:bytes public_key_fingerprint:long encrypted_data:bytes = Server_DH_Params;
+
+set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:bytes = Set_client_DH_params_answer;
+
+rpc_drop_answer#58e4a740 req_msg_id:long = RpcDropAnswer;
+get_future_salts#b921bd04 num:int = FutureSalts;
+ping#7abe77ec ping_id:long = Pong;
+ping_delay_disconnect#f3427b8c ping_id:long disconnect_delay:int = Pong;
+destroy_session#e7512126 session_id:long = DestroySessionRes;
+
+http_wait#9299359f max_delay:int wait_after:int max_wait:int = HttpWait;
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/tdlib.html b/data/core.telegram.org/tdlib.html new file mode 100644 index 0000000000..dee8b1f4ba --- /dev/null +++ b/data/core.telegram.org/tdlib.html @@ -0,0 +1,147 @@ + + + + + Telegram Database Library + + + + + + + + + + + + + +
+ +
+
+
+
+

Telegram Database Library

+ +
+ +
+ +

TDLib (Telegram Database Library) is a cross-platform, fully functional Telegram client. We designed it to help third-party developers create their own custom apps using the Telegram platform.

+
+

Read about TDLib on the Telegram blog »

+
+

TDLib Advantages

+
    +
  • Cross-platform. TDLib can be used on Android, iOS, Windows, macOS, Linux, WebAssembly, FreeBSD, Windows Phone, watchOS, tvOS, Tizen, Cygwin. It should also work on other *nix systems with or without minimal effort.
  • +
  • Multilanguage. TDLib can be easily used with any programming language that is able to execute C functions. Additionally it already has native bindings to Java (using JNI) and C# (using C++/CLI).
  • +
  • Easy to use. TDLib takes care of all network implementation details, encryption and local data storage.
  • +
  • High-performance. In the Telegram Bot API, each TDLib instance handles more than 24,000 active bots simultaneously.
  • +
  • Well-documented. All TDLib API methods and public interfaces are fully documented.
  • +
  • Consistent. TDLib guarantees that all updates will be delivered in the right order.
  • +
  • Reliable. TDLib remains stable on slow and unreliable Internet connections.
  • +
  • Secure: All local data is encrypted using a user-provided encryption key.
  • +
  • Fully-asynchronous. Requests to TDLib don't block each other or anything else, responses will be sent when they are available.
  • +
+
+

Getting started with TDLib »

+
+

Resources

+

TDLib is fully open source, all code is available on GitHub.

+

See also:

+ +
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/tdlib/docs.html b/data/core.telegram.org/tdlib/docs.html new file mode 100644 index 0000000000..7830ff3297 --- /dev/null +++ b/data/core.telegram.org/tdlib/docs.html @@ -0,0 +1,233 @@ + + + + + + + + +TDLib: TDLib + + + + + + + + + + + + +
+
+
+
+ +
+
+
+ + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
TDLib
+
+
+

TDLib (Telegram Database library) is a cross-platform library for building Telegram clients. It can be easily used from almost any programming language.

+

Table of Contents

+ +

Features

+

TDLib has many advantages. Notably TDLib is:

+
    +
  • Cross-platform: TDLib can be used on Android, iOS, Windows, macOS, Linux, FreeBSD, OpenBSD, NetBSD, Windows Phone, WebAssembly, watchOS, tvOS, Tizen, Cygwin. It should also work on other *nix systems with or without minimal effort.
  • +
  • Multilanguage: TDLib can be easily used with any programming language that is able to execute C functions. Additionally it already has native Java (using JNI) bindings and .NET (using C++/CLI and C++/CX) bindings.
  • +
  • Easy to use: TDLib takes care of all network implementation details, encryption and local data storage.
  • +
  • High-performance: in the Telegram Bot API, each TDLib instance handles more than 24000 active bots simultaneously.
  • +
  • Well-documented: all TDLib API methods and public interfaces are fully documented.
  • +
  • Consistent: TDLib guarantees that all updates are delivered in the right order.
  • +
  • Reliable: TDLib remains stable on slow and unreliable Internet connections.
  • +
  • Secure: all local data is encrypted using a user-provided encryption key.
  • +
  • Fully-asynchronous: requests to TDLib don't block each other or anything else, responses are sent when they are available.
  • +
+

Examples and documentation

+

See our Getting Started tutorial for a description of basic TDLib concepts.

+

Take a look at our examples.

+

See a TDLib build instructions generator for detailed instructions on how to build TDLib.

+

See description of our JSON, C++, Java and .NET interfaces.

+

See the td_api.tl scheme or the automatically generated HTML documentation for a list of all available TDLib methods and classes.

+

Dependencies

+

TDLib depends on:

+
    +
  • C++14 compatible compiler (Clang 3.4+, GCC 4.9+, MSVC 19.0+ (Visual Studio 2015+), Intel C++ Compiler 17+)
  • +
  • OpenSSL
  • +
  • zlib
  • +
  • gperf (build only)
  • +
  • CMake (3.0.2+, build only)
  • +
  • PHP (optional, for documentation generation)
  • +
+

Building

+

The simplest way to build TDLib is to use our TDLib build instructions generator. You need only to choose your programming language and target operating system to receive complete build instructions.

+

In general, you need to install all TDLib dependencies as described in Installing dependencies. Then enter directory containing TDLib sources and compile them using CMake:

+
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .

To build TDLib on low memory devices you can run SplitSource.php script before compiling main TDLib source code and compile only needed targets:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --target prepare_cross_compiling
cd ..
php SplitSource.php
cd build
cmake --build . --target tdjson
cmake --build . --target tdjson_static
cd ..
php SplitSource.php --undo

In our tests clang 6.0 with libc++ required less than 500 MB of RAM per file and GCC 4.9/6.3 used less than 1 GB of RAM per file.

+

Installing dependencies

+

macOS

+
    +
  • Install the latest Xcode command line tools, for example, via xcode-select --install.
  • +
  • Install other dependencies, for example, using Homebrew:
    brew install gperf cmake openssl
  • +
  • Build TDLib with CMake as explained in building. You will likely need to manually specify path to the installed OpenSSL to CMake, e.g.,
    cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ ..
  • +
+

Windows

+
    +
  • Download and install Microsoft Visual Studio 2015 or later.
  • +
  • Download and install gperf. Add the path to gperf.exe to the PATH environment variable.
  • +
  • Install vcpkg.
  • +
  • Run the following commands to install TDLib dependencies using vcpkg:
    cd <path to vcpkg>
    .\vcpkg.exe install openssl:x64-windows openssl:x86-windows zlib:x64-windows zlib:x86-windows
  • +
  • Download and install CMake; choose "Add CMake to the system PATH" option while installing.
  • +
  • Build TDLib with CMake as explained in building, but instead of cmake -DCMAKE_BUILD_TYPE=Release .. use
    cmake -DCMAKE_TOOLCHAIN_FILE=<path to vcpkg>/scripts/buildsystems/vcpkg.cmake ..
  • +
+

To build 32-bit/64-bit TDLib using MSVC, you will need to additionally specify parameter -A Win32/-A x64 to CMake. To build TDLib in Release mode using MSVC, you will need to additionally specify parameter --config Release to the cmake --build . command.

+

Linux

+ +

Using in CMake C++ projects

+

For C++ projects that use CMake, the best approach is to build TDLib as part of your project or to install it system-wide.

+

There are several libraries that you could use in your CMake project:

+
    +
  • Td::TdJson, Td::TdJsonStatic — dynamic and static version of a JSON interface. This has a simple C interface, so it can be easily used with any programming language that is able to execute C functions. See td_json_client and td_log documentation for more information.
  • +
  • Td::TdStatic — static library with C++ interface for general usage. See Client and Log documentation for more information.
  • +
  • Td::TdCoreStatic — static library with low-level C++ interface intended mostly for internal usage. See ClientActor and Log documentation for more information.
  • +
+

For example, part of your CMakeLists.txt may look like this:

add_subdirectory(td)
target_link_libraries(YourTarget PRIVATE Td::TdStatic)

Or you could install TDLib and then reference it in your CMakeLists.txt like this:

find_package(Td 1.7.0 REQUIRED)
target_link_libraries(YourTarget PRIVATE Td::TdStatic)

See example/cpp/CMakeLists.txt.

+

Using in Java projects

+

TDLib provides native Java interface through JNI. To enable it, specify option -DTD_ENABLE_JNI=ON to CMake.

+

See example/java for example of using TDLib from Java and detailed build and usage instructions.

+

Using in .NET projects

+

TDLib provides native .NET interface through C++/CLI and C++/CX. To enable it, specify option -DTD_ENABLE_DOTNET=ON to CMake. .NET Core supports C++/CLI only since version 3.1 and only on Windows, so if older .NET Core is used or portability is needed, then TDLib JSON interface should be used through P/Invoke instead.

+

See example/csharp for example of using TDLib from C# and detailed build and usage instructions. See example/uwp for example of using TDLib from C# UWP application and detailed build and usage instructions for Visual Studio Extension "TDLib for Universal Windows Platform".

+

When TDLib is built with TD_ENABLE_DOTNET option enabled, C++ documentation is removed from some files. You need to checkout these files to return C++ documentation back:

git checkout td/telegram/Client.h td/telegram/Log.h td/tl/TlObject.h

Using from other programming languages

+

TDLib provides efficient native C++, Java, and .NET interfaces. But for most use cases we suggest to use the JSON interface, which can be easily used with any programming language that is able to execute C functions. See td_json_client and td_log documentation for detailed JSON interface description, the td_api.tl scheme or the automatically generated HTML documentation for a list of all available TDLib methods and classes.

+

TDLib JSON interface adheres to semantic versioning and versions with the same major version number are binary and backward compatible, but the underlying TDLib API can be different for different minor and even patch versions. If you need to support different TDLib versions, then you can use a value of the version option to find exact TDLib version to use appropriate API methods.

+

See example/python/tdjson_example.py for an example of such usage.

+

License

+

TDLib is licensed under the terms of the Boost Software License. See LICENSE_1_0.txt for more information.

+
+
+ + + + + + + diff --git a/data/core.telegram.org/tdlib/docs/td__api_8h.html b/data/core.telegram.org/tdlib/docs/td__api_8h.html new file mode 100644 index 0000000000..9a21a99408 --- /dev/null +++ b/data/core.telegram.org/tdlib/docs/td__api_8h.html @@ -0,0 +1,3046 @@ + + + + + + + + +TDLib: td/generate/auto/td/telegram/td_api.h File Reference + + + + + + + + + + + + +
+
+
+
+ +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
td_api.h File Reference
+
+
+

Description

+

Contains declarations of all functions and types which represent a public TDLib interface.

+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

class  Object
 
class  Function
 
class  accountTtl
 
class  address
 
class  animatedChatPhoto
 
class  animation
 
class  animations
 
class  audio
 
class  authenticationCodeInfo
 
class  AuthenticationCodeType
 
class  authenticationCodeTypeTelegramMessage
 
class  authenticationCodeTypeSms
 
class  authenticationCodeTypeCall
 
class  authenticationCodeTypeFlashCall
 
class  AuthorizationState
 
class  authorizationStateWaitTdlibParameters
 
class  authorizationStateWaitEncryptionKey
 
class  authorizationStateWaitPhoneNumber
 
class  authorizationStateWaitCode
 
class  authorizationStateWaitOtherDeviceConfirmation
 
class  authorizationStateWaitRegistration
 
class  authorizationStateWaitPassword
 
class  authorizationStateReady
 
class  authorizationStateLoggingOut
 
class  authorizationStateClosing
 
class  authorizationStateClosed
 
class  autoDownloadSettings
 
class  autoDownloadSettingsPresets
 
class  background
 
class  BackgroundFill
 
class  backgroundFillSolid
 
class  backgroundFillGradient
 
class  BackgroundType
 
class  backgroundTypeWallpaper
 
class  backgroundTypePattern
 
class  backgroundTypeFill
 
class  backgrounds
 
class  bankCardActionOpenUrl
 
class  bankCardInfo
 
class  basicGroup
 
class  basicGroupFullInfo
 
class  botCommand
 
class  botInfo
 
class  call
 
class  CallDiscardReason
 
class  callDiscardReasonEmpty
 
class  callDiscardReasonMissed
 
class  callDiscardReasonDeclined
 
class  callDiscardReasonDisconnected
 
class  callDiscardReasonHungUp
 
class  callId
 
class  CallProblem
 
class  callProblemEcho
 
class  callProblemNoise
 
class  callProblemInterruptions
 
class  callProblemDistortedSpeech
 
class  callProblemSilentLocal
 
class  callProblemSilentRemote
 
class  callProblemDropped
 
class  callProblemDistortedVideo
 
class  callProblemPixelatedVideo
 
class  callProtocol
 
class  callServer
 
class  CallServerType
 
class  callServerTypeTelegramReflector
 
class  callServerTypeWebrtc
 
class  CallState
 
class  callStatePending
 
class  callStateExchangingKeys
 
class  callStateReady
 
class  callStateHangingUp
 
class  callStateDiscarded
 
class  callStateError
 
class  callbackQueryAnswer
 
class  CallbackQueryPayload
 
class  callbackQueryPayloadData
 
class  callbackQueryPayloadDataWithPassword
 
class  callbackQueryPayloadGame
 
class  CanTransferOwnershipResult
 
class  canTransferOwnershipResultOk
 
class  canTransferOwnershipResultPasswordNeeded
 
class  canTransferOwnershipResultPasswordTooFresh
 
class  canTransferOwnershipResultSessionTooFresh
 
class  chat
 
class  ChatAction
 
class  chatActionTyping
 
class  chatActionRecordingVideo
 
class  chatActionUploadingVideo
 
class  chatActionRecordingVoiceNote
 
class  chatActionUploadingVoiceNote
 
class  chatActionUploadingPhoto
 
class  chatActionUploadingDocument
 
class  chatActionChoosingLocation
 
class  chatActionChoosingContact
 
class  chatActionStartPlayingGame
 
class  chatActionRecordingVideoNote
 
class  chatActionUploadingVideoNote
 
class  chatActionCancel
 
class  ChatActionBar
 
class  chatActionBarReportSpam
 
class  chatActionBarReportUnrelatedLocation
 
class  chatActionBarReportAddBlock
 
class  chatActionBarAddContact
 
class  chatActionBarSharePhoneNumber
 
class  chatAdministrator
 
class  chatAdministrators
 
class  chatEvent
 
class  ChatEventAction
 
class  chatEventMessageEdited
 
class  chatEventMessageDeleted
 
class  chatEventPollStopped
 
class  chatEventMessagePinned
 
class  chatEventMessageUnpinned
 
class  chatEventMemberJoined
 
class  chatEventMemberLeft
 
class  chatEventMemberInvited
 
class  chatEventMemberPromoted
 
class  chatEventMemberRestricted
 
class  chatEventTitleChanged
 
class  chatEventPermissionsChanged
 
class  chatEventDescriptionChanged
 
class  chatEventUsernameChanged
 
class  chatEventPhotoChanged
 
class  chatEventInvitesToggled
 
class  chatEventLinkedChatChanged
 
class  chatEventSlowModeDelayChanged
 
class  chatEventSignMessagesToggled
 
class  chatEventStickerSetChanged
 
class  chatEventLocationChanged
 
class  chatEventIsAllHistoryAvailableToggled
 
class  chatEventLogFilters
 
class  chatEvents
 
class  chatFilter
 
class  chatFilterInfo
 
class  chatInviteLink
 
class  chatInviteLinkInfo
 
class  ChatList
 
class  chatListMain
 
class  chatListArchive
 
class  chatListFilter
 
class  chatLists
 
class  chatLocation
 
class  chatMember
 
class  ChatMemberStatus
 
class  chatMemberStatusCreator
 
class  chatMemberStatusAdministrator
 
class  chatMemberStatusMember
 
class  chatMemberStatusRestricted
 
class  chatMemberStatusLeft
 
class  chatMemberStatusBanned
 
class  chatMembers
 
class  ChatMembersFilter
 
class  chatMembersFilterContacts
 
class  chatMembersFilterAdministrators
 
class  chatMembersFilterMembers
 
class  chatMembersFilterMention
 
class  chatMembersFilterRestricted
 
class  chatMembersFilterBanned
 
class  chatMembersFilterBots
 
class  chatNearby
 
class  chatNotificationSettings
 
class  chatPermissions
 
class  chatPhoto
 
class  chatPhotoInfo
 
class  chatPhotos
 
class  chatPosition
 
class  ChatReportReason
 
class  chatReportReasonSpam
 
class  chatReportReasonViolence
 
class  chatReportReasonPornography
 
class  chatReportReasonChildAbuse
 
class  chatReportReasonCopyright
 
class  chatReportReasonUnrelatedLocation
 
class  chatReportReasonCustom
 
class  ChatSource
 
class  chatSourceMtprotoProxy
 
class  chatSourcePublicServiceAnnouncement
 
class  ChatStatistics
 
class  chatStatisticsSupergroup
 
class  chatStatisticsChannel
 
class  chatStatisticsAdministratorActionsInfo
 
class  chatStatisticsInviterInfo
 
class  chatStatisticsMessageInteractionInfo
 
class  chatStatisticsMessageSenderInfo
 
class  ChatType
 
class  chatTypePrivate
 
class  chatTypeBasicGroup
 
class  chatTypeSupergroup
 
class  chatTypeSecret
 
class  chats
 
class  chatsNearby
 
class  CheckChatUsernameResult
 
class  checkChatUsernameResultOk
 
class  checkChatUsernameResultUsernameInvalid
 
class  checkChatUsernameResultUsernameOccupied
 
class  checkChatUsernameResultPublicChatsTooMuch
 
class  checkChatUsernameResultPublicGroupsUnavailable
 
class  connectedWebsite
 
class  connectedWebsites
 
class  ConnectionState
 
class  connectionStateWaitingForNetwork
 
class  connectionStateConnectingToProxy
 
class  connectionStateConnecting
 
class  connectionStateUpdating
 
class  connectionStateReady
 
class  contact
 
class  count
 
class  countries
 
class  countryInfo
 
class  customRequestResult
 
class  databaseStatistics
 
class  date
 
class  dateRange
 
class  datedFile
 
class  deepLinkInfo
 
class  DeviceToken
 
class  deviceTokenFirebaseCloudMessaging
 
class  deviceTokenApplePush
 
class  deviceTokenApplePushVoIP
 
class  deviceTokenWindowsPush
 
class  deviceTokenMicrosoftPush
 
class  deviceTokenMicrosoftPushVoIP
 
class  deviceTokenWebPush
 
class  deviceTokenSimplePush
 
class  deviceTokenUbuntuPush
 
class  deviceTokenBlackBerryPush
 
class  deviceTokenTizenPush
 
class  DiceStickers
 
class  diceStickersRegular
 
class  diceStickersSlotMachine
 
class  document
 
class  draftMessage
 
class  emailAddressAuthenticationCodeInfo
 
class  emojis
 
class  encryptedCredentials
 
class  encryptedPassportElement
 
class  error
 
class  file
 
class  filePart
 
class  FileType
 
class  fileTypeNone
 
class  fileTypeAnimation
 
class  fileTypeAudio
 
class  fileTypeDocument
 
class  fileTypePhoto
 
class  fileTypeProfilePhoto
 
class  fileTypeSecret
 
class  fileTypeSecretThumbnail
 
class  fileTypeSecure
 
class  fileTypeSticker
 
class  fileTypeThumbnail
 
class  fileTypeUnknown
 
class  fileTypeVideo
 
class  fileTypeVideoNote
 
class  fileTypeVoiceNote
 
class  fileTypeWallpaper
 
class  formattedText
 
class  foundMessages
 
class  game
 
class  gameHighScore
 
class  gameHighScores
 
class  hashtags
 
class  httpUrl
 
class  identityDocument
 
class  importedContacts
 
class  inlineKeyboardButton
 
class  InlineKeyboardButtonType
 
class  inlineKeyboardButtonTypeUrl
 
class  inlineKeyboardButtonTypeLoginUrl
 
class  inlineKeyboardButtonTypeCallback
 
class  inlineKeyboardButtonTypeCallbackWithPassword
 
class  inlineKeyboardButtonTypeCallbackGame
 
class  inlineKeyboardButtonTypeSwitchInline
 
class  inlineKeyboardButtonTypeBuy
 
class  InlineQueryResult
 
class  inlineQueryResultArticle
 
class  inlineQueryResultContact
 
class  inlineQueryResultLocation
 
class  inlineQueryResultVenue
 
class  inlineQueryResultGame
 
class  inlineQueryResultAnimation
 
class  inlineQueryResultAudio
 
class  inlineQueryResultDocument
 
class  inlineQueryResultPhoto
 
class  inlineQueryResultSticker
 
class  inlineQueryResultVideo
 
class  inlineQueryResultVoiceNote
 
class  inlineQueryResults
 
class  InputBackground
 
class  inputBackgroundLocal
 
class  inputBackgroundRemote
 
class  InputChatPhoto
 
class  inputChatPhotoPrevious
 
class  inputChatPhotoStatic
 
class  inputChatPhotoAnimation
 
class  InputCredentials
 
class  inputCredentialsSaved
 
class  inputCredentialsNew
 
class  inputCredentialsAndroidPay
 
class  inputCredentialsApplePay
 
class  InputFile
 
class  inputFileId
 
class  inputFileRemote
 
class  inputFileLocal
 
class  inputFileGenerated
 
class  inputIdentityDocument
 
class  InputInlineQueryResult
 
class  inputInlineQueryResultAnimation
 
class  inputInlineQueryResultArticle
 
class  inputInlineQueryResultAudio
 
class  inputInlineQueryResultContact
 
class  inputInlineQueryResultDocument
 
class  inputInlineQueryResultGame
 
class  inputInlineQueryResultLocation
 
class  inputInlineQueryResultPhoto
 
class  inputInlineQueryResultSticker
 
class  inputInlineQueryResultVenue
 
class  inputInlineQueryResultVideo
 
class  inputInlineQueryResultVoiceNote
 
class  InputMessageContent
 
class  inputMessageText
 
class  inputMessageAnimation
 
class  inputMessageAudio
 
class  inputMessageDocument
 
class  inputMessagePhoto
 
class  inputMessageSticker
 
class  inputMessageVideo
 
class  inputMessageVideoNote
 
class  inputMessageVoiceNote
 
class  inputMessageLocation
 
class  inputMessageVenue
 
class  inputMessageContact
 
class  inputMessageDice
 
class  inputMessageGame
 
class  inputMessageInvoice
 
class  inputMessagePoll
 
class  inputMessageForwarded
 
class  InputPassportElement
 
class  inputPassportElementPersonalDetails
 
class  inputPassportElementPassport
 
class  inputPassportElementDriverLicense
 
class  inputPassportElementIdentityCard
 
class  inputPassportElementInternalPassport
 
class  inputPassportElementAddress
 
class  inputPassportElementUtilityBill
 
class  inputPassportElementBankStatement
 
class  inputPassportElementRentalAgreement
 
class  inputPassportElementPassportRegistration
 
class  inputPassportElementTemporaryRegistration
 
class  inputPassportElementPhoneNumber
 
class  inputPassportElementEmailAddress
 
class  inputPassportElementError
 
class  InputPassportElementErrorSource
 
class  inputPassportElementErrorSourceUnspecified
 
class  inputPassportElementErrorSourceDataField
 
class  inputPassportElementErrorSourceFrontSide
 
class  inputPassportElementErrorSourceReverseSide
 
class  inputPassportElementErrorSourceSelfie
 
class  inputPassportElementErrorSourceTranslationFile
 
class  inputPassportElementErrorSourceTranslationFiles
 
class  inputPassportElementErrorSourceFile
 
class  inputPassportElementErrorSourceFiles
 
class  inputPersonalDocument
 
class  InputSticker
 
class  inputStickerStatic
 
class  inputStickerAnimated
 
class  inputThumbnail
 
class  invoice
 
class  jsonObjectMember
 
class  JsonValue
 
class  jsonValueNull
 
class  jsonValueBoolean
 
class  jsonValueNumber
 
class  jsonValueString
 
class  jsonValueArray
 
class  jsonValueObject
 
class  keyboardButton
 
class  KeyboardButtonType
 
class  keyboardButtonTypeText
 
class  keyboardButtonTypeRequestPhoneNumber
 
class  keyboardButtonTypeRequestLocation
 
class  keyboardButtonTypeRequestPoll
 
class  labeledPricePart
 
class  languagePackInfo
 
class  languagePackString
 
class  LanguagePackStringValue
 
class  languagePackStringValueOrdinary
 
class  languagePackStringValuePluralized
 
class  languagePackStringValueDeleted
 
class  languagePackStrings
 
class  localFile
 
class  localizationTargetInfo
 
class  location
 
class  LogStream
 
class  logStreamDefault
 
class  logStreamFile
 
class  logStreamEmpty
 
class  logTags
 
class  logVerbosityLevel
 
class  LoginUrlInfo
 
class  loginUrlInfoOpen
 
class  loginUrlInfoRequestConfirmation
 
class  MaskPoint
 
class  maskPointForehead
 
class  maskPointEyes
 
class  maskPointMouth
 
class  maskPointChin
 
class  maskPosition
 
class  message
 
class  MessageContent
 
class  messageText
 
class  messageAnimation
 
class  messageAudio
 
class  messageDocument
 
class  messagePhoto
 
class  messageExpiredPhoto
 
class  messageSticker
 
class  messageVideo
 
class  messageExpiredVideo
 
class  messageVideoNote
 
class  messageVoiceNote
 
class  messageLocation
 
class  messageVenue
 
class  messageContact
 
class  messageDice
 
class  messageGame
 
class  messagePoll
 
class  messageInvoice
 
class  messageCall
 
class  messageBasicGroupChatCreate
 
class  messageSupergroupChatCreate
 
class  messageChatChangeTitle
 
class  messageChatChangePhoto
 
class  messageChatDeletePhoto
 
class  messageChatAddMembers
 
class  messageChatJoinByLink
 
class  messageChatDeleteMember
 
class  messageChatUpgradeTo
 
class  messageChatUpgradeFrom
 
class  messagePinMessage
 
class  messageScreenshotTaken
 
class  messageChatSetTtl
 
class  messageCustomServiceAction
 
class  messageGameScore
 
class  messagePaymentSuccessful
 
class  messagePaymentSuccessfulBot
 
class  messageContactRegistered
 
class  messageWebsiteConnected
 
class  messagePassportDataSent
 
class  messagePassportDataReceived
 
class  messageProximityAlertTriggered
 
class  messageUnsupported
 
class  messageCopyOptions
 
class  messageForwardInfo
 
class  MessageForwardOrigin
 
class  messageForwardOriginUser
 
class  messageForwardOriginChat
 
class  messageForwardOriginHiddenUser
 
class  messageForwardOriginChannel
 
class  messageInteractionInfo
 
class  messageLink
 
class  messageLinkInfo
 
class  messageReplyInfo
 
class  MessageSchedulingState
 
class  messageSchedulingStateSendAtDate
 
class  messageSchedulingStateSendWhenOnline
 
class  messageSendOptions
 
class  MessageSender
 
class  messageSenderUser
 
class  messageSenderChat
 
class  messageSenders
 
class  MessageSendingState
 
class  messageSendingStatePending
 
class  messageSendingStateFailed
 
class  messageStatistics
 
class  messageThreadInfo
 
class  messages
 
class  minithumbnail
 
class  networkStatistics
 
class  NetworkStatisticsEntry
 
class  networkStatisticsEntryFile
 
class  networkStatisticsEntryCall
 
class  NetworkType
 
class  networkTypeNone
 
class  networkTypeMobile
 
class  networkTypeMobileRoaming
 
class  networkTypeWiFi
 
class  networkTypeOther
 
class  notification
 
class  notificationGroup
 
class  NotificationGroupType
 
class  notificationGroupTypeMessages
 
class  notificationGroupTypeMentions
 
class  notificationGroupTypeSecretChat
 
class  notificationGroupTypeCalls
 
class  NotificationSettingsScope
 
class  notificationSettingsScopePrivateChats
 
class  notificationSettingsScopeGroupChats
 
class  notificationSettingsScopeChannelChats
 
class  NotificationType
 
class  notificationTypeNewMessage
 
class  notificationTypeNewSecretChat
 
class  notificationTypeNewCall
 
class  notificationTypeNewPushMessage
 
class  ok
 
class  OptionValue
 
class  optionValueBoolean
 
class  optionValueEmpty
 
class  optionValueInteger
 
class  optionValueString
 
class  orderInfo
 
class  PageBlock
 
class  pageBlockTitle
 
class  pageBlockSubtitle
 
class  pageBlockAuthorDate
 
class  pageBlockHeader
 
class  pageBlockSubheader
 
class  pageBlockKicker
 
class  pageBlockParagraph
 
class  pageBlockPreformatted
 
class  pageBlockFooter
 
class  pageBlockDivider
 
class  pageBlockAnchor
 
class  pageBlockList
 
class  pageBlockBlockQuote
 
class  pageBlockPullQuote
 
class  pageBlockAnimation
 
class  pageBlockAudio
 
class  pageBlockPhoto
 
class  pageBlockVideo
 
class  pageBlockVoiceNote
 
class  pageBlockCover
 
class  pageBlockEmbedded
 
class  pageBlockEmbeddedPost
 
class  pageBlockCollage
 
class  pageBlockSlideshow
 
class  pageBlockChatLink
 
class  pageBlockTable
 
class  pageBlockDetails
 
class  pageBlockRelatedArticles
 
class  pageBlockMap
 
class  pageBlockCaption
 
class  PageBlockHorizontalAlignment
 
class  pageBlockHorizontalAlignmentLeft
 
class  pageBlockHorizontalAlignmentCenter
 
class  pageBlockHorizontalAlignmentRight
 
class  pageBlockListItem
 
class  pageBlockRelatedArticle
 
class  pageBlockTableCell
 
class  PageBlockVerticalAlignment
 
class  pageBlockVerticalAlignmentTop
 
class  pageBlockVerticalAlignmentMiddle
 
class  pageBlockVerticalAlignmentBottom
 
class  passportAuthorizationForm
 
class  PassportElement
 
class  passportElementPersonalDetails
 
class  passportElementPassport
 
class  passportElementDriverLicense
 
class  passportElementIdentityCard
 
class  passportElementInternalPassport
 
class  passportElementAddress
 
class  passportElementUtilityBill
 
class  passportElementBankStatement
 
class  passportElementRentalAgreement
 
class  passportElementPassportRegistration
 
class  passportElementTemporaryRegistration
 
class  passportElementPhoneNumber
 
class  passportElementEmailAddress
 
class  passportElementError
 
class  PassportElementErrorSource
 
class  passportElementErrorSourceUnspecified
 
class  passportElementErrorSourceDataField
 
class  passportElementErrorSourceFrontSide
 
class  passportElementErrorSourceReverseSide
 
class  passportElementErrorSourceSelfie
 
class  passportElementErrorSourceTranslationFile
 
class  passportElementErrorSourceTranslationFiles
 
class  passportElementErrorSourceFile
 
class  passportElementErrorSourceFiles
 
class  PassportElementType
 
class  passportElementTypePersonalDetails
 
class  passportElementTypePassport
 
class  passportElementTypeDriverLicense
 
class  passportElementTypeIdentityCard
 
class  passportElementTypeInternalPassport
 
class  passportElementTypeAddress
 
class  passportElementTypeUtilityBill
 
class  passportElementTypeBankStatement
 
class  passportElementTypeRentalAgreement
 
class  passportElementTypePassportRegistration
 
class  passportElementTypeTemporaryRegistration
 
class  passportElementTypePhoneNumber
 
class  passportElementTypeEmailAddress
 
class  passportElements
 
class  passportElementsWithErrors
 
class  passportRequiredElement
 
class  passportSuitableElement
 
class  passwordState
 
class  paymentForm
 
class  paymentReceipt
 
class  paymentResult
 
class  paymentsProviderStripe
 
class  personalDetails
 
class  personalDocument
 
class  phoneNumberAuthenticationSettings
 
class  phoneNumberInfo
 
class  photo
 
class  photoSize
 
class  poll
 
class  pollOption
 
class  PollType
 
class  pollTypeRegular
 
class  pollTypeQuiz
 
class  profilePhoto
 
class  proxies
 
class  proxy
 
class  ProxyType
 
class  proxyTypeSocks5
 
class  proxyTypeHttp
 
class  proxyTypeMtproto
 
class  PublicChatType
 
class  publicChatTypeHasUsername
 
class  publicChatTypeIsLocationBased
 
class  PushMessageContent
 
class  pushMessageContentHidden
 
class  pushMessageContentAnimation
 
class  pushMessageContentAudio
 
class  pushMessageContentContact
 
class  pushMessageContentContactRegistered
 
class  pushMessageContentDocument
 
class  pushMessageContentGame
 
class  pushMessageContentGameScore
 
class  pushMessageContentInvoice
 
class  pushMessageContentLocation
 
class  pushMessageContentPhoto
 
class  pushMessageContentPoll
 
class  pushMessageContentScreenshotTaken
 
class  pushMessageContentSticker
 
class  pushMessageContentText
 
class  pushMessageContentVideo
 
class  pushMessageContentVideoNote
 
class  pushMessageContentVoiceNote
 
class  pushMessageContentBasicGroupChatCreate
 
class  pushMessageContentChatAddMembers
 
class  pushMessageContentChatChangePhoto
 
class  pushMessageContentChatChangeTitle
 
class  pushMessageContentChatDeleteMember
 
class  pushMessageContentChatJoinByLink
 
class  pushMessageContentMessageForwards
 
class  pushMessageContentMediaAlbum
 
class  pushReceiverId
 
class  recommendedChatFilter
 
class  recommendedChatFilters
 
class  recoveryEmailAddress
 
class  remoteFile
 
class  ReplyMarkup
 
class  replyMarkupRemoveKeyboard
 
class  replyMarkupForceReply
 
class  replyMarkupShowKeyboard
 
class  replyMarkupInlineKeyboard
 
class  RichText
 
class  richTextPlain
 
class  richTextBold
 
class  richTextItalic
 
class  richTextUnderline
 
class  richTextStrikethrough
 
class  richTextFixed
 
class  richTextUrl
 
class  richTextEmailAddress
 
class  richTextSubscript
 
class  richTextSuperscript
 
class  richTextMarked
 
class  richTextPhoneNumber
 
class  richTextIcon
 
class  richTextReference
 
class  richTextAnchor
 
class  richTextAnchorLink
 
class  richTexts
 
class  savedCredentials
 
class  scopeNotificationSettings
 
class  SearchMessagesFilter
 
class  searchMessagesFilterEmpty
 
class  searchMessagesFilterAnimation
 
class  searchMessagesFilterAudio
 
class  searchMessagesFilterDocument
 
class  searchMessagesFilterPhoto
 
class  searchMessagesFilterVideo
 
class  searchMessagesFilterVoiceNote
 
class  searchMessagesFilterPhotoAndVideo
 
class  searchMessagesFilterUrl
 
class  searchMessagesFilterChatPhoto
 
class  searchMessagesFilterCall
 
class  searchMessagesFilterMissedCall
 
class  searchMessagesFilterVideoNote
 
class  searchMessagesFilterVoiceAndVideoNote
 
class  searchMessagesFilterMention
 
class  searchMessagesFilterUnreadMention
 
class  searchMessagesFilterFailedToSend
 
class  searchMessagesFilterPinned
 
class  seconds
 
class  secretChat
 
class  SecretChatState
 
class  secretChatStatePending
 
class  secretChatStateReady
 
class  secretChatStateClosed
 
class  session
 
class  sessions
 
class  shippingOption
 
class  StatisticalGraph
 
class  statisticalGraphData
 
class  statisticalGraphAsync
 
class  statisticalGraphError
 
class  statisticalValue
 
class  sticker
 
class  stickerSet
 
class  stickerSetInfo
 
class  stickerSets
 
class  stickers
 
class  storageStatistics
 
class  storageStatisticsByChat
 
class  storageStatisticsByFileType
 
class  storageStatisticsFast
 
class  SuggestedAction
 
class  suggestedActionEnableArchiveAndMuteNewChats
 
class  suggestedActionCheckPhoneNumber
 
class  supergroup
 
class  supergroupFullInfo
 
class  SupergroupMembersFilter
 
class  supergroupMembersFilterRecent
 
class  supergroupMembersFilterContacts
 
class  supergroupMembersFilterAdministrators
 
class  supergroupMembersFilterSearch
 
class  supergroupMembersFilterRestricted
 
class  supergroupMembersFilterBanned
 
class  supergroupMembersFilterMention
 
class  supergroupMembersFilterBots
 
class  tMeUrl
 
class  TMeUrlType
 
class  tMeUrlTypeUser
 
class  tMeUrlTypeSupergroup
 
class  tMeUrlTypeChatInvite
 
class  tMeUrlTypeStickerSet
 
class  tMeUrls
 
class  tdlibParameters
 
class  temporaryPasswordState
 
class  termsOfService
 
class  testBytes
 
class  testInt
 
class  testString
 
class  testVectorInt
 
class  testVectorIntObject
 
class  testVectorString
 
class  testVectorStringObject
 
class  text
 
class  textEntities
 
class  textEntity
 
class  TextEntityType
 
class  textEntityTypeMention
 
class  textEntityTypeHashtag
 
class  textEntityTypeCashtag
 
class  textEntityTypeBotCommand
 
class  textEntityTypeUrl
 
class  textEntityTypeEmailAddress
 
class  textEntityTypePhoneNumber
 
class  textEntityTypeBankCardNumber
 
class  textEntityTypeBold
 
class  textEntityTypeItalic
 
class  textEntityTypeUnderline
 
class  textEntityTypeStrikethrough
 
class  textEntityTypeCode
 
class  textEntityTypePre
 
class  textEntityTypePreCode
 
class  textEntityTypeTextUrl
 
class  textEntityTypeMentionName
 
class  TextParseMode
 
class  textParseModeMarkdown
 
class  textParseModeHTML
 
class  thumbnail
 
class  ThumbnailFormat
 
class  thumbnailFormatJpeg
 
class  thumbnailFormatPng
 
class  thumbnailFormatWebp
 
class  thumbnailFormatGif
 
class  thumbnailFormatTgs
 
class  thumbnailFormatMpeg4
 
class  TopChatCategory
 
class  topChatCategoryUsers
 
class  topChatCategoryBots
 
class  topChatCategoryGroups
 
class  topChatCategoryChannels
 
class  topChatCategoryInlineBots
 
class  topChatCategoryCalls
 
class  topChatCategoryForwardChats
 
class  Update
 
class  updateAuthorizationState
 
class  updateNewMessage
 
class  updateMessageSendAcknowledged
 
class  updateMessageSendSucceeded
 
class  updateMessageSendFailed
 
class  updateMessageContent
 
class  updateMessageEdited
 
class  updateMessageIsPinned
 
class  updateMessageInteractionInfo
 
class  updateMessageContentOpened
 
class  updateMessageMentionRead
 
class  updateMessageLiveLocationViewed
 
class  updateNewChat
 
class  updateChatTitle
 
class  updateChatPhoto
 
class  updateChatPermissions
 
class  updateChatLastMessage
 
class  updateChatPosition
 
class  updateChatIsMarkedAsUnread
 
class  updateChatIsBlocked
 
class  updateChatHasScheduledMessages
 
class  updateChatDefaultDisableNotification
 
class  updateChatReadInbox
 
class  updateChatReadOutbox
 
class  updateChatUnreadMentionCount
 
class  updateChatNotificationSettings
 
class  updateScopeNotificationSettings
 
class  updateChatActionBar
 
class  updateChatReplyMarkup
 
class  updateChatDraftMessage
 
class  updateChatFilters
 
class  updateChatOnlineMemberCount
 
class  updateNotification
 
class  updateNotificationGroup
 
class  updateActiveNotifications
 
class  updateHavePendingNotifications
 
class  updateDeleteMessages
 
class  updateUserChatAction
 
class  updateUserStatus
 
class  updateUser
 
class  updateBasicGroup
 
class  updateSupergroup
 
class  updateSecretChat
 
class  updateUserFullInfo
 
class  updateBasicGroupFullInfo
 
class  updateSupergroupFullInfo
 
class  updateServiceNotification
 
class  updateFile
 
class  updateFileGenerationStart
 
class  updateFileGenerationStop
 
class  updateCall
 
class  updateNewCallSignalingData
 
class  updateUserPrivacySettingRules
 
class  updateUnreadMessageCount
 
class  updateUnreadChatCount
 
class  updateOption
 
class  updateStickerSet
 
class  updateInstalledStickerSets
 
class  updateTrendingStickerSets
 
class  updateRecentStickers
 
class  updateFavoriteStickers
 
class  updateSavedAnimations
 
class  updateSelectedBackground
 
class  updateLanguagePackStrings
 
class  updateConnectionState
 
class  updateTermsOfService
 
class  updateUsersNearby
 
class  updateDiceEmojis
 
class  updateAnimationSearchParameters
 
class  updateSuggestedActions
 
class  updateNewInlineQuery
 
class  updateNewChosenInlineResult
 
class  updateNewCallbackQuery
 
class  updateNewInlineCallbackQuery
 
class  updateNewShippingQuery
 
class  updateNewPreCheckoutQuery
 
class  updateNewCustomEvent
 
class  updateNewCustomQuery
 
class  updatePoll
 
class  updatePollAnswer
 
class  updates
 
class  user
 
class  userFullInfo
 
class  UserPrivacySetting
 
class  userPrivacySettingShowStatus
 
class  userPrivacySettingShowProfilePhoto
 
class  userPrivacySettingShowLinkInForwardedMessages
 
class  userPrivacySettingShowPhoneNumber
 
class  userPrivacySettingAllowChatInvites
 
class  userPrivacySettingAllowCalls
 
class  userPrivacySettingAllowPeerToPeerCalls
 
class  userPrivacySettingAllowFindingByPhoneNumber
 
class  UserPrivacySettingRule
 
class  userPrivacySettingRuleAllowAll
 
class  userPrivacySettingRuleAllowContacts
 
class  userPrivacySettingRuleAllowUsers
 
class  userPrivacySettingRuleAllowChatMembers
 
class  userPrivacySettingRuleRestrictAll
 
class  userPrivacySettingRuleRestrictContacts
 
class  userPrivacySettingRuleRestrictUsers
 
class  userPrivacySettingRuleRestrictChatMembers
 
class  userPrivacySettingRules
 
class  UserStatus
 
class  userStatusEmpty
 
class  userStatusOnline
 
class  userStatusOffline
 
class  userStatusRecently
 
class  userStatusLastWeek
 
class  userStatusLastMonth
 
class  UserType
 
class  userTypeRegular
 
class  userTypeDeleted
 
class  userTypeBot
 
class  userTypeUnknown
 
class  users
 
class  validatedOrderInfo
 
class  venue
 
class  video
 
class  videoNote
 
class  voiceNote
 
class  webPage
 
class  webPageInstantView
 
class  acceptCall
 
class  acceptTermsOfService
 
class  addChatMember
 
class  addChatMembers
 
class  addChatToList
 
class  addContact
 
class  addCustomServerLanguagePack
 
class  addFavoriteSticker
 
class  addLocalMessage
 
class  addLogMessage
 
class  addNetworkStatistics
 
class  addProxy
 
class  addRecentSticker
 
class  addRecentlyFoundChat
 
class  addSavedAnimation
 
class  addStickerToSet
 
class  answerCallbackQuery
 
class  answerCustomQuery
 
class  answerInlineQuery
 
class  answerPreCheckoutQuery
 
class  answerShippingQuery
 
class  blockMessageSenderFromReplies
 
class  canTransferOwnership
 
class  cancelDownloadFile
 
class  cancelUploadFile
 
class  changeImportedContacts
 
class  changePhoneNumber
 
class  changeStickerSet
 
class  checkAuthenticationBotToken
 
class  checkAuthenticationCode
 
class  checkAuthenticationPassword
 
class  checkChangePhoneNumberCode
 
class  checkChatInviteLink
 
class  checkChatUsername
 
class  checkCreatedPublicChatsLimit
 
class  checkDatabaseEncryptionKey
 
class  checkEmailAddressVerificationCode
 
class  checkPhoneNumberConfirmationCode
 
class  checkPhoneNumberVerificationCode
 
class  checkRecoveryEmailAddressCode
 
class  cleanFileName
 
class  clearAllDraftMessages
 
class  clearImportedContacts
 
class  clearRecentStickers
 
class  clearRecentlyFoundChats
 
class  close
 
class  closeChat
 
class  closeSecretChat
 
class  confirmQrCodeAuthentication
 
class  createBasicGroupChat
 
class  createCall
 
class  createChatFilter
 
class  createNewBasicGroupChat
 
class  createNewSecretChat
 
class  createNewStickerSet
 
class  createNewSupergroupChat
 
class  createPrivateChat
 
class  createSecretChat
 
class  createSupergroupChat
 
class  createTemporaryPassword
 
class  deleteAccount
 
class  deleteChatFilter
 
class  deleteChatHistory
 
class  deleteChatMessagesFromUser
 
class  deleteChatReplyMarkup
 
class  deleteFile
 
class  deleteLanguagePack
 
class  deleteMessages
 
class  deletePassportElement
 
class  deleteProfilePhoto
 
class  deleteSavedCredentials
 
class  deleteSavedOrderInfo
 
class  deleteSupergroup
 
class  destroy
 
class  disableProxy
 
class  discardCall
 
class  disconnectAllWebsites
 
class  disconnectWebsite
 
class  downloadFile
 
class  editChatFilter
 
class  editCustomLanguagePackInfo
 
class  editInlineMessageCaption
 
class  editInlineMessageLiveLocation
 
class  editInlineMessageMedia
 
class  editInlineMessageReplyMarkup
 
class  editInlineMessageText
 
class  editMessageCaption
 
class  editMessageLiveLocation
 
class  editMessageMedia
 
class  editMessageReplyMarkup
 
class  editMessageSchedulingState
 
class  editMessageText
 
class  editProxy
 
class  enableProxy
 
class  finishFileGeneration
 
class  forwardMessages
 
class  generateChatInviteLink
 
class  getAccountTtl
 
class  getActiveLiveLocationMessages
 
class  getActiveSessions
 
class  getAllPassportElements
 
class  getApplicationConfig
 
class  getArchivedStickerSets
 
class  getAttachedStickerSets
 
class  getAuthorizationState
 
class  getAutoDownloadSettingsPresets
 
class  getBackgroundUrl
 
class  getBackgrounds
 
class  getBankCardInfo
 
class  getBasicGroup
 
class  getBasicGroupFullInfo
 
class  getBlockedMessageSenders
 
class  getCallbackQueryAnswer
 
class  getCallbackQueryMessage
 
class  getChat
 
class  getChatAdministrators
 
class  getChatEventLog
 
class  getChatFilter
 
class  getChatFilterDefaultIconName
 
class  getChatHistory
 
class  getChatListsToAddChat
 
class  getChatMember
 
class  getChatMessageByDate
 
class  getChatMessageCount
 
class  getChatNotificationSettingsExceptions
 
class  getChatPinnedMessage
 
class  getChatScheduledMessages
 
class  getChatStatistics
 
class  getChatStatisticsUrl
 
class  getChats
 
class  getConnectedWebsites
 
class  getContacts
 
class  getCountries
 
class  getCountryCode
 
class  getCreatedPublicChats
 
class  getCurrentState
 
class  getDatabaseStatistics
 
class  getDeepLinkInfo
 
class  getEmojiSuggestionsUrl
 
class  getFavoriteStickers
 
class  getFile
 
class  getFileDownloadedPrefixSize
 
class  getFileExtension
 
class  getFileMimeType
 
class  getGameHighScores
 
class  getGroupsInCommon
 
class  getImportedContactCount
 
class  getInactiveSupergroupChats
 
class  getInlineGameHighScores
 
class  getInlineQueryResults
 
class  getInstalledStickerSets
 
class  getInviteText
 
class  getJsonString
 
class  getJsonValue
 
class  getLanguagePackInfo
 
class  getLanguagePackString
 
class  getLanguagePackStrings
 
class  getLocalizationTargetInfo
 
class  getLogStream
 
class  getLogTagVerbosityLevel
 
class  getLogTags
 
class  getLogVerbosityLevel
 
class  getLoginUrl
 
class  getLoginUrlInfo
 
class  getMapThumbnailFile
 
class  getMarkdownText
 
class  getMe
 
class  getMessage
 
class  getMessageEmbeddingCode
 
class  getMessageLink
 
class  getMessageLinkInfo
 
class  getMessageLocally
 
class  getMessagePublicForwards
 
class  getMessageStatistics
 
class  getMessageThread
 
class  getMessageThreadHistory
 
class  getMessages
 
class  getNetworkStatistics
 
class  getOption
 
class  getPassportAuthorizationForm
 
class  getPassportAuthorizationFormAvailableElements
 
class  getPassportElement
 
class  getPasswordState
 
class  getPaymentForm
 
class  getPaymentReceipt
 
class  getPhoneNumberInfo
 
class  getPollVoters
 
class  getPreferredCountryLanguage
 
class  getProxies
 
class  getProxyLink
 
class  getPushReceiverId
 
class  getRecentInlineBots
 
class  getRecentStickers
 
class  getRecentlyVisitedTMeUrls
 
class  getRecommendedChatFilters
 
class  getRecoveryEmailAddress
 
class  getRemoteFile
 
class  getRepliedMessage
 
class  getSavedAnimations
 
class  getSavedOrderInfo
 
class  getScopeNotificationSettings
 
class  getSecretChat
 
class  getStatisticalGraph
 
class  getStickerEmojis
 
class  getStickerSet
 
class  getStickers
 
class  getStorageStatistics
 
class  getStorageStatisticsFast
 
class  getSuitableDiscussionChats
 
class  getSupergroup
 
class  getSupergroupFullInfo
 
class  getSupergroupMembers
 
class  getSupportUser
 
class  getTemporaryPasswordState
 
class  getTextEntities
 
class  getTopChats
 
class  getTrendingStickerSets
 
class  getUser
 
class  getUserFullInfo
 
class  getUserPrivacySettingRules
 
class  getUserProfilePhotos
 
class  getWebPageInstantView
 
class  getWebPagePreview
 
class  hideSuggestedAction
 
class  importContacts
 
class  joinChat
 
class  joinChatByInviteLink
 
class  leaveChat
 
class  logOut
 
class  openChat
 
class  openMessageContent
 
class  optimizeStorage
 
class  parseMarkdown
 
class  parseTextEntities
 
class  pinChatMessage
 
class  pingProxy
 
class  processPushNotification
 
class  readAllChatMentions
 
class  readFilePart
 
class  recoverAuthenticationPassword
 
class  recoverPassword
 
class  registerDevice
 
class  registerUser
 
class  removeBackground
 
class  removeChatActionBar
 
class  removeContacts
 
class  removeFavoriteSticker
 
class  removeNotification
 
class  removeNotificationGroup
 
class  removeProxy
 
class  removeRecentHashtag
 
class  removeRecentSticker
 
class  removeRecentlyFoundChat
 
class  removeSavedAnimation
 
class  removeStickerFromSet
 
class  removeTopChat
 
class  reorderChatFilters
 
class  reorderInstalledStickerSets
 
class  reportChat
 
class  reportSupergroupSpam
 
class  requestAuthenticationPasswordRecovery
 
class  requestPasswordRecovery
 
class  requestQrCodeAuthentication
 
class  resendAuthenticationCode
 
class  resendChangePhoneNumberCode
 
class  resendEmailAddressVerificationCode
 
class  resendMessages
 
class  resendPhoneNumberConfirmationCode
 
class  resendPhoneNumberVerificationCode
 
class  resendRecoveryEmailAddressCode
 
class  resetAllNotificationSettings
 
class  resetBackgrounds
 
class  resetNetworkStatistics
 
class  saveApplicationLogEvent
 
class  searchBackground
 
class  searchCallMessages
 
class  searchChatMembers
 
class  searchChatMessages
 
class  searchChatRecentLocationMessages
 
class  searchChats
 
class  searchChatsNearby
 
class  searchChatsOnServer
 
class  searchContacts
 
class  searchEmojis
 
class  searchHashtags
 
class  searchInstalledStickerSets
 
class  searchMessages
 
class  searchPublicChat
 
class  searchPublicChats
 
class  searchSecretMessages
 
class  searchStickerSet
 
class  searchStickerSets
 
class  searchStickers
 
class  sendBotStartMessage
 
class  sendCallDebugInformation
 
class  sendCallRating
 
class  sendCallSignalingData
 
class  sendChatAction
 
class  sendChatScreenshotTakenNotification
 
class  sendChatSetTtlMessage
 
class  sendCustomRequest
 
class  sendEmailAddressVerificationCode
 
class  sendInlineQueryResultMessage
 
class  sendMessage
 
class  sendMessageAlbum
 
class  sendPassportAuthorizationForm
 
class  sendPaymentForm
 
class  sendPhoneNumberConfirmationCode
 
class  sendPhoneNumberVerificationCode
 
class  setAccountTtl
 
class  setAlarm
 
class  setAuthenticationPhoneNumber
 
class  setAutoDownloadSettings
 
class  setBackground
 
class  setBio
 
class  setBotUpdatesStatus
 
class  setChatClientData
 
class  setChatDescription
 
class  setChatDiscussionGroup
 
class  setChatDraftMessage
 
class  setChatLocation
 
class  setChatMemberStatus
 
class  setChatNotificationSettings
 
class  setChatPermissions
 
class  setChatPhoto
 
class  setChatSlowModeDelay
 
class  setChatTitle
 
class  setCommands
 
class  setCustomLanguagePack
 
class  setCustomLanguagePackString
 
class  setDatabaseEncryptionKey
 
class  setFileGenerationProgress
 
class  setGameScore
 
class  setInlineGameScore
 
class  setLocation
 
class  setLogStream
 
class  setLogTagVerbosityLevel
 
class  setLogVerbosityLevel
 
class  setName
 
class  setNetworkType
 
class  setOption
 
class  setPassportElement
 
class  setPassportElementErrors
 
class  setPassword
 
class  setPinnedChats
 
class  setPollAnswer
 
class  setProfilePhoto
 
class  setRecoveryEmailAddress
 
class  setScopeNotificationSettings
 
class  setStickerPositionInSet
 
class  setStickerSetThumbnail
 
class  setSupergroupStickerSet
 
class  setSupergroupUsername
 
class  setTdlibParameters
 
class  setUserPrivacySettingRules
 
class  setUsername
 
class  sharePhoneNumber
 
class  stopPoll
 
class  synchronizeLanguagePack
 
class  terminateAllOtherSessions
 
class  terminateSession
 
class  testCallBytes
 
class  testCallEmpty
 
class  testCallString
 
class  testCallVectorInt
 
class  testCallVectorIntObject
 
class  testCallVectorString
 
class  testCallVectorStringObject
 
class  testGetDifference
 
class  testNetwork
 
class  testProxy
 
class  testReturnError
 
class  testSquareInt
 
class  testUseUpdate
 
class  toggleChatDefaultDisableNotification
 
class  toggleChatIsMarkedAsUnread
 
class  toggleChatIsPinned
 
class  toggleMessageSenderIsBlocked
 
class  toggleSupergroupIsAllHistoryAvailable
 
class  toggleSupergroupSignMessages
 
class  transferChatOwnership
 
class  unpinAllChatMessages
 
class  unpinChatMessage
 
class  upgradeBasicGroupChatToSupergroupChat
 
class  uploadFile
 
class  uploadStickerFile
 
class  validateOrderInfo
 
class  viewMessages
 
class  viewTrendingStickerSets
 
class  writeGeneratedFilePart
 
+ + + + + + + + + + + + + + + + + + + +

+Typedefs

using int32 = std::int32_t
 
using int53 = std::int64_t
 
using int64 = std::int64_t
 
using string = std::string
 
using bytes = std::string
 
template<class Type >
using array = std::vector< Type >
 
using BaseObject = ::td::TlObject
 
template<class Type >
using object_ptr = ::td::tl_object_ptr< Type >
 
+ + + + + + + + + + + + +

+Functions

template<class Type , class... Args>
object_ptr< Type > make_object (Args &&... args)
 
template<class ToType , class FromType >
object_ptr< ToType > move_object_as (FromType &&from)
 
std::string to_string (const BaseObject &value)
 
template<class T >
std::string to_string (const object_ptr< T > &value)
 
+

Typedef Documentation

+ +

◆ int32

+ +
+
+ + + + +
using int32 = std::int32_t
+
+

This type is used to store 32-bit signed integers, which can be represented as Number in JSON.

+ +
+
+ +

◆ int53

+ +
+
+ + + + +
using int53 = std::int64_t
+
+

This type is used to store 53-bit signed integers, which can be represented as Number in JSON.

+ +
+
+ +

◆ int64

+ +
+
+ + + + +
using int64 = std::int64_t
+
+

This type is used to store 64-bit signed integers, which can't be represented as Number in JSON and are represented as String instead.

+ +
+
+ +

◆ string

+ +
+
+ + + + +
using string = std::string
+
+

This type is used to store UTF-8 strings.

+ +
+
+ +

◆ bytes

+ +
+
+ + + + +
using bytes = std::string
+
+

This type is used to store arbitrary sequences of bytes. In JSON interface the bytes are base64-encoded.

+ +
+
+ +

◆ array

+ +
+
+ + + + +
using array = std::vector<Type>
+
+

This type is used to store a list of objects of any type and is represented as Array in JSON.

+ +
+
+ +

◆ BaseObject

+ +
+
+ + + + +
using BaseObject = ::td::TlObject
+
+

This class is a base class for all TDLib API classes and functions.

+ +
+
+ +

◆ object_ptr

+ +
+
+ + + + +
using object_ptr = ::td::tl_object_ptr<Type>
+
+

A smart wrapper to store a pointer to a TDLib API object. Can be treated as an analogue of std::unique_ptr.

+ +
+
+

Function Documentation

+ +

◆ make_object()

+ +
+
+ + + + + + + + +
object_ptr<Type> td::td_api::make_object (Args &&... args)
+
+

A function to create a dynamically allocated TDLib API object. Can be treated as an analogue of std::make_unique. Usage example:

auto get_authorization_state_request = td::td_api::make_object<td::td_api::getAuthorizationState>();
auto message_text = td::td_api::make_object<td::td_api::formattedText>("Hello, world!!!",
auto send_message_request = td::td_api::make_object<td::td_api::sendMessage>(chat_id, 0, 0, nullptr, nullptr,
td::td_api::make_object<td::td_api::inputMessageText>(std::move(message_text), false, true));
Template Parameters
+ + +
TypeType of an object to construct.
+
+
+
Parameters
+ + +
[in]argsArguments to pass to the object constructor.
+
+
+
Returns
Wrapped pointer to the created object.
+ +
+
+ +

◆ move_object_as()

+ +
+
+ + + + + + + + +
object_ptr<ToType> td::td_api::move_object_as (FromType && from)
+
+

A function to cast a wrapped in td::td_api::object_ptr TDLib API object to its subclass or superclass. Casting an object to an incorrect type will lead to undefined behaviour. Usage example:

switch (call_state->get_id()) {
auto state = td::td_api::move_object_as<td::td_api::callStatePending>(call_state);
// use state
break;
}
// no additional fields, no casting is needed
break;
}
auto state = td::td_api::move_object_as<td::td_api::callStateReady>(call_state);
// use state
break;
}
// no additional fields, no casting is needed
break;
}
auto state = td::td_api::move_object_as<td::td_api::callStateDiscarded>(call_state);
// use state
break;
}
auto state = td::td_api::move_object_as<td::td_api::callStateError>(call_state);
// use state
break;
}
default:
assert(false);
}
Template Parameters
+ + + +
ToTypeType of a TDLib API object to move to.
FromTypeType of a TDLib API object to move from, this is auto-deduced.
+
+
+
Parameters
+ + +
[in]fromWrapped in td::td_api::object_ptr pointer to a TDLib API object.
+
+
+ +
+
+ +

◆ to_string() [1/2]

+ +
+
+ + + + + + + + +
std::string td::td_api::to_string (const BaseObjectvalue)
+
+

Returns a string representation of the TDLib API object.

Parameters
+ + +
[in]valueThe object.
+
+
+
Returns
Object string representation.
+ +
+
+ +

◆ to_string() [2/2]

+ +
+
+ + + + + + + + +
std::string td::td_api::to_string (const object_ptr< T > & value)
+
+

Returns a string representation of the TDLib API object.

Template Parameters
+ + +
TObject type, auto-deduced.
+
+
+
Parameters
+ + +
[in]valueThe object.
+
+
+
Returns
Object string representation.
+ +
+
+
+ + + + + + + diff --git a/data/core.telegram.org/tdlib/docs/td__json__client_8h.html b/data/core.telegram.org/tdlib/docs/td__json__client_8h.html new file mode 100644 index 0000000000..3726a4ae9a --- /dev/null +++ b/data/core.telegram.org/tdlib/docs/td__json__client_8h.html @@ -0,0 +1,430 @@ + + + + + + + + +TDLib: td/telegram/td_json_client.h File Reference + + + + + + + + + + + + +
+
+
+
+ +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
td_json_client.h File Reference
+
+
+

Description

+

C interface for interaction with TDLib via JSON-serialized objects. Can be used to easily integrate TDLib with any programming language which supports calling C functions and is able to work with JSON.

+

The JSON serialization of TDLib API objects is straightforward: all API objects are represented as JSON objects with the same keys as the API object field names. The object type name is stored in the special field "@type" which is optional in places where type is uniquely determined by the context. Fields of Bool type are stored as Boolean, fields of int32, int53, and double types are stored as Number, fields of int64 and string types are stored as String, fields of bytes type are base64 encoded and then stored as String, fields of array type are stored as Array. The main TDLib interface is asynchronous. To match requests with a corresponding response a field "@extra" can be added to the request object. The corresponding response will have an "@extra" field with exactly the same value.

+

A TDLib client instance can be created through td_json_client_create. Requests then can be sent using td_json_client_send from any thread. New updates and request responses can be received through td_json_client_receive from any thread. This function must not be called simultaneously from two different threads. Also note that all updates and request responses must be applied in the order they were received to ensure consistency. Given this information, it's advisable to call this function from a dedicated thread. Some service TDLib requests can be executed synchronously from any thread by using td_json_client_execute. The TDLib client instance can be destroyed via td_json_client_destroy.

+

General pattern of usage:

void *client = td_json_client_create();
// somehow share the client with other threads, which will be able to send requests via td_json_client_send
const double WAIT_TIMEOUT = 10.0; // seconds
int is_closed = 0; // should be set to 1, when updateAuthorizationState with authorizationStateClosed is received
while (!is_closed) {
const char *result = td_json_client_receive(client, WAIT_TIMEOUT);
if (result) {
// parse the result as JSON object and process it as an incoming update or an answer to a previously sent request
}
}
+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + +

+Functions

void * td_json_client_create ()
 
void td_json_client_send (void *client, const char *request)
 
const char * td_json_client_receive (void *client, double timeout)
 
const char * td_json_client_execute (void *client, const char *request)
 
void td_json_client_destroy (void *client)
 
int td_create_client_id ()
 
void td_send (int client_id, const char *request)
 
const char * td_receive (double timeout)
 
const char * td_execute (const char *request)
 
+

Function Documentation

+ +

◆ td_json_client_create()

+ +
+
+ + + + + + + +
void* td_json_client_create ()
+
+

Creates a new instance of TDLib.

Returns
Pointer to the created instance of TDLib.
+ +
+
+ +

◆ td_json_client_send()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void td_json_client_send (void * client,
const char * request 
)
+
+

Sends request to the TDLib client. May be called from any thread.

Parameters
+ + + +
[in]clientThe client.
[in]requestJSON-serialized null-terminated request to TDLib.
+
+
+ +
+
+ +

◆ td_json_client_receive()

+ +
+
+ + + + + + + + + + + + + + + + + + +
const char* td_json_client_receive (void * client,
double timeout 
)
+
+

Receives incoming updates and request responses from the TDLib client. May be called from any thread, but must not be called simultaneously from two different threads. Returned pointer will be deallocated by TDLib during next call to td_json_client_receive or td_json_client_execute in the same thread, so it can't be used after that.

Parameters
+ + + +
[in]clientThe client.
[in]timeoutThe maximum number of seconds allowed for this function to wait for new data.
+
+
+
Returns
JSON-serialized null-terminated incoming update or request response. May be NULL if the timeout expires.
+ +
+
+ +

◆ td_json_client_execute()

+ +
+
+ + + + + + + + + + + + + + + + + + +
const char* td_json_client_execute (void * client,
const char * request 
)
+
+

Synchronously executes TDLib request. May be called from any thread. Only a few requests can be executed synchronously. Returned pointer will be deallocated by TDLib during next call to td_json_client_receive or td_json_client_execute in the same thread, so it can't be used after that.

Parameters
+ + + +
[in]clientThe client. Currently ignored for all requests, so NULL can be passed.
[in]requestJSON-serialized null-terminated request to TDLib.
+
+
+
Returns
JSON-serialized null-terminated request response.
+ +
+
+ +

◆ td_json_client_destroy()

+ +
+
+ + + + + + + + +
void td_json_client_destroy (void * client)
+
+

Destroys the TDLib client instance. After this is called the client instance must not be used anymore.

Parameters
+ + +
[in]clientThe client.
+
+
+ +
+
+ +

◆ td_create_client_id()

+ +
+
+ + + + + + + +
int td_create_client_id ()
+
+

Returns an opaque identifier of a new TDLib instance. The TDLib instance will not send updates until the first request is sent to it.

Returns
Opaque identifier of a new TDLib instance.
+ +
+
+ +

◆ td_send()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void td_send (int client_id,
const char * request 
)
+
+

Sends request to the TDLib client. May be called from any thread.

Parameters
+ + + +
[in]client_idTDLib client identifier.
[in]requestJSON-serialized null-terminated request to TDLib.
+
+
+ +
+
+ +

◆ td_receive()

+ +
+
+ + + + + + + + +
const char* td_receive (double timeout)
+
+

Receives incoming updates and request responses. Must not be called simultaneously from two different threads. The returned pointer can be used until the next call to td_receive or td_execute, after which it will be deallocated by TDLib.

Parameters
+ + +
[in]timeoutThe maximum number of seconds allowed for this function to wait for new data.
+
+
+
Returns
JSON-serialized null-terminated incoming update or request response. May be NULL if the timeout expires.
+ +
+
+ +

◆ td_execute()

+ +
+
+ + + + + + + + +
const char* td_execute (const char * request)
+
+

Synchronously executes a TDLib request. A request can be executed synchronously, only if it is documented with "Can be called synchronously". The returned pointer can be used until the next call to td_receive or td_execute, after which it will be deallocated by TDLib.

Parameters
+ + +
[in]requestJSON-serialized null-terminated request to TDLib.
+
+
+
Returns
JSON-serialized null-terminated request response.
+ +
+
+
+ + + + + + + diff --git a/data/core.telegram.org/tdlib/docs/td__log_8h.html b/data/core.telegram.org/tdlib/docs/td__log_8h.html new file mode 100644 index 0000000000..aaee065771 --- /dev/null +++ b/data/core.telegram.org/tdlib/docs/td__log_8h.html @@ -0,0 +1,295 @@ + + + + + + + + +TDLib: td/telegram/td_log.h File Reference + + + + + + + + + + + + +
+
+
+
+ +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
td_log.h File Reference
+
+
+

Description

+

C interface for managing the internal logging of TDLib. By default TDLib writes logs to stderr or an OS specific log and uses a verbosity level of 5. These functions are deprecated since TDLib 1.4.0 in favor of the setLogVerbosityLevel, setLogStream and other synchronous requests for managing the intrenal TDLib logging.

+
+

Go to the source code of this file.

+ + + + +

+Typedefs

typedef void(* td_log_fatal_error_callback_ptr) (const char *error_message)
 
+ + + + + + + + + +

+Functions

TDJSON_DEPRECATED_EXPORT int td_set_log_file_path (const char *file_path)
 
TDJSON_DEPRECATED_EXPORT void td_set_log_max_file_size (long long max_file_size)
 
TDJSON_DEPRECATED_EXPORT void td_set_log_verbosity_level (int new_verbosity_level)
 
void td_set_log_fatal_error_callback (td_log_fatal_error_callback_ptr callback)
 
+

Typedef Documentation

+ +

◆ td_log_fatal_error_callback_ptr

+ +
+
+ + + + +
typedef void(* td_log_fatal_error_callback_ptr) (const char *error_message)
+
+

A type of callback function that will be called when a fatal error happens.

+
Parameters
+ + +
error_messageNull-terminated string with a description of a happened fatal error.
+
+
+ +
+
+

Function Documentation

+ +

◆ td_set_log_file_path()

+ +
+
+ + + + + + + + +
TDJSON_DEPRECATED_EXPORT int td_set_log_file_path (const char * file_path)
+
+

Sets the path to the file where the internal TDLib log will be written. By default TDLib writes logs to stderr or an OS specific log. Use this method to write the log to a file instead.

+
Parameters
+ + +
[in]file_pathNull-terminated path to a file where the internal TDLib log will be written. Use an empty path to switch back to the default logging behaviour.
+
+
+
Returns
True 1 on success, or 0 otherwise, i.e. if the file can't be opened for writing.
+ +
+
+ +

◆ td_set_log_max_file_size()

+ +
+
+ + + + + + + + +
TDJSON_DEPRECATED_EXPORT void td_set_log_max_file_size (long long max_file_size)
+
+

Sets the maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated. Unused if log is not written to a file. Defaults to 10 MB.

+
Parameters
+ + +
[in]max_file_sizeThe maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated. Should be positive.
+
+
+ +
+
+ +

◆ td_set_log_verbosity_level()

+ +
+
+ + + + + + + + +
TDJSON_DEPRECATED_EXPORT void td_set_log_verbosity_level (int new_verbosity_level)
+
+

Sets the verbosity level of the internal logging of TDLib. By default the TDLib uses a log verbosity level of 5.

+
Parameters
+ + +
[in]new_verbosity_levelNew value of logging verbosity level. Value 0 corresponds to fatal errors, value 1 corresponds to errors, value 2 corresponds to warnings and debug warnings, value 3 corresponds to informational, value 4 corresponds to debug, value 5 corresponds to verbose debug, value greater than 5 and up to 1024 can be used to enable even more logging.
+
+
+ +
+
+ +

◆ td_set_log_fatal_error_callback()

+ +
+
+ + + + + + + + +
void td_set_log_fatal_error_callback (td_log_fatal_error_callback_ptr callback)
+
+

Sets the callback that will be called when a fatal error happens. None of the TDLib methods can be called from the callback. The TDLib will crash as soon as callback returns. By default the callback is not set.

+
Parameters
+ + +
[in]callbackCallback that will be called when a fatal error happens. Pass NULL to remove the callback.
+
+
+ +
+
+
+ + + + + + + diff --git a/data/core.telegram.org/tdlib/getting-started.html b/data/core.telegram.org/tdlib/getting-started.html new file mode 100644 index 0000000000..b0038bd661 --- /dev/null +++ b/data/core.telegram.org/tdlib/getting-started.html @@ -0,0 +1,198 @@ + + + + + Getting started with TDLib + + + + + + + + + + + + + +
+ +
+
+
+ +

Getting started with TDLib

+ +
+ +

TDLib is a fully functional Telegram client which takes care of all networking, local storage and data consistency details. In this tutorial we describe the main concepts understanding of which is required for effecient TDLib usage.

+

TDLib interface

+

In this text, Client means an interface for interaction with a TDLib instance and Application means the program that uses TDLib to interact with Telegram.

+

The main TDLib API is fully-asyncronous. An Application can send a request to TDLib through Client.send method and receive a response asynchronously through the Client.receive method when it becomes available. The exact naming of these methods and the way in which requests are matched with responses is different for different TDLib interfaces, but the concept as a whole remains the same. For example, in TDLib JSON interface these methods are called td_json_client_send and td_json_client_receive, and their @extra field should be used to match requests with the corresponding responses.

+

In a high-level interface used by an Application the matching of responses with corresponding requests is often automated and transformed by some wrapper into a call to a continuation, a callback, a Promise or a Future to simplify the handling of responses.

+

Aside from responses to requests, an Application receives a lot of important data through incoming updates. Updates are used to pass new data from TDLib to the Application and often control the behavior of the Application, leaving no chance to implement something wrong. The correct handling of updates is crucial for creating an Application that is efficient and works correctly.

+
+

You can find a list of all available TDLib API methods in our web-documentation. You can also find the descriptions of all available TDLib methods and classes in the TDLIB API scheme.

+

TDLib can be used from any programming language. You can find a lot of examples of TDLib-based frameworks in various programming languages in our examples section.

+
+

TDLib glossary

+

This section describes the basic notions required for understanding the TDLib API. If you have used the TDLib-based Telegram Bot API most of them should be already familiar to you.

+

Telegram is a messenger, so the main object is a message. Each message belongs to some chat and has a unique identifier within that chat. Messages inside a chat should be sorted by that identifier. Telegram supports many different kinds of messages, so a message can have many different kinds of message content. Currently there are more than 40 different kinds of message content, for example messageText for text messages, messagePhoto for photos, or messageScreenshotTaken for notifications about screenshots taken by the other party.

+

A Telegram user is called user. Each user has a unique identifier and a first name, and can also have an optional last name, username and profile photo among other useful fields. Bot is a special type of user which can be controlled through the Telegram Bot API.

+

Each chat has members, i.e. users that immediately receive all messages sent to the chat. Currently there are 6 possible chat member statuses which describe different rights and restrictions a user can have in a chat, ranging from the owner of the chat who has more rights in the chat than any other user, to a user banned in the chat who is banned in the chat and can't return to it by self or even view chat messages, even if the chat is public.

+

As noted earlier, each message belongs to a chat. Currently there are 4 different types of chats on Telegram:

+
    +
  • Private chats are ordinary one-to-one chats with another user (or with oneself in the case of the special “Saved messages” chat).
  • +
  • Basic groups are basic groups with 0-200 members. Every basic group member has their own copy of the message history, so new basic group members may not see older messages (unless another user forwards their own copy to them).
  • +
  • Supergroups are groups with up to 200000 members who share a common message history, so new supergroup members can see all the previously sent messages (unless this is explicitly forbidden by the chat creator). There is a special kind of supergroups, called channels, which can have an unlimited number of members and where only the chat creator and some chat administrators can write. All other chat members can only read channel messages.
  • +
  • Secret chats are end-to-end encrypted one-to-one chats with another user, available only on the device which was used to initiate and accept the chat.
  • +
+

Each chat has a unique identifier, a title and an optional chat photo. Chats comprise sorted lists shown to the user, position in which is determined, roughly speaking, by the time of latest activity. The correct order of chats in chat lists is maintained by TDLib, so the Application only needs to listen to updates that change the chat.positions field and sort all chats by the pair (position.order, chat.id) in a given position.list.

+

Messages, chat photos and many other objects can have a file inside of them. Each file has an identifier and may be available locally on a hard drive or remotely on a cloud server. A file can be usually downloaded to the local hard drive or uploaded to Telegram cloud servers.

+

Messages with media content like photos or videos can have a short accompanying text called caption. The texts of text messages and media captions can contain fragments, which should be formatted in some unusual way. These fragments are called text entities and the combination of a text and its entities are referred together as a formatted text.

+

TDLib sends a lot of important data to the Application through updates. For example, if there is a user unknown to the Application, or some data about a user has changed, then TDLib immediately sends an updateUser to the Application.

+
+

You can find list of all currently available updates here »

+
+

User authorization

+

Authorization is an example of a behavior, which is controlled by TDLib through updates. Whenever an action is required to proceed with user authorization, the Application receives an updateAuthorizationState with the description of the current AuthorizationState. The Application only needs to handle this update appropriately to correctly implement user authorization.

+

The first authorization state received by the Application is always of the type authorizationStateWaitTdlibParameters. When it is received, the Application should provide parameters for TDLib initialization by calling the setTdlibParameters method. In this method the Application will need to specify, among other parameters:

+
    +
  • api_id — Application identifier for accessing the Telegram API, which can be obtained at https://my.telegram.org.
  • +
  • api_hash — Hash of the Application identifier for accessing the Telegram API, which can be obtained at https://my.telegram.org.
  • +
  • database_directory — The path to the directory on the local disk where the TDLib database is to be stored; must point to a writable directory.
  • +
  • use_message_database — If set to true, the library will maintain a local cache of chats and messages.
  • +
  • use_secret_chats — If set to true, support for secret chats will be enabled.
  • +
  • system_language_code — IETF language tag of the user's operating system language, like “en-GB”.
  • +
  • device_model — Model of the device the Application is being run on, like “Samsung X”.
  • +
+

After call to setTdlibParameters in case of success Application will receive updateAuthorizationState with new state and just needs to handle that update, nothing should be done explicitly. If setTdlibParameters fails, then authorization state is not changed and the Application should try to handle the current authorization state again.

+

The second received authorization state is always authorizationStateWaitEncryptionKey. When it is received, the database encryption key should be provided through a call to checkDatabaseEncryptionKey. For most mobile apps, you can provide an empty database encryption key here (more info). If user isn't authorized yet, then some of authorizationStateWaitPhoneNumber, authorizationStateWaitCode, authorizationStateWaitRegistration and authorizationStateWaitPassword authorization states may be received. After completing these authorization steps, the Application will receive authorizationStateReady, meaning that authorization was successful and ordinary requests can be sent now.

+
+

You can find complete examples of user authorization in our Java and C# examples.

+
+

Sending a message

+

To send any kind of message, the Application needs to call the method sendMessage providing a chat identifier and the content of the message to be sent. For example, the Application can send a text message using inputMessageText class as input message content, a photo using inputMessagePhoto or a location using inputMessageLocation. The Application can use inputFileLocal as InputFile in these objects to send a local file from the hard drive.

+
+

You can find examples of sending a text message in our Java and C# examples.

+
+

Handling updates

+

All updates and responses to requests should be handled in the order they are received. Here is a list of the most important updates and how they should be handled:

+
    +
  • updateAuthorizationState — The handling of this update is essential for correct user authorization.
  • +
  • updateNewChat — This update is received whenever a new chat is discovered. This update is guaranteed to come before the chat identifier is returned to the Application. So, whenever an Application receives a chat_id, it never needs to use a getChat request to receive the chat object. Instead it should maintain a cache of chats received through this update and take all the necessary data about chats from this cache.
  • +
  • updateUser — This update is received whenever a new user has been discovered or some data about a known user has changed. This update is guaranteed to come before the user identifier is returned to the Application. So, whenever an Application receives a user_id, it never needs to use the getUser request to receive the user object. Instead it should maintain a cache of users received through this update and take all the necessary data about users from this cache.
  • +
  • updateBasicGroup — This update is received whenever a new basic group has been discovered or some data about a known basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the Application. So, whenever an Application receives a basic_group_id, it never needs to use the getBasicGroup request to receive the basicGroup object. Instead it should maintain a cache of basic groups received through this update and take all the necessary data about basic groups from this cache.
  • +
  • updateSupergroup — This update is received whenever a new supergroup has been discovered or some data about a known supergroup has changed. This update is guaranteed to come before the supergroup identifier is returned to the Application. So, whenever an Application receives a supergroup_id, it never needs to use the getSupergroup request to receive the supergroup object. Instead it should maintain a cache of supergroups received through this update and take all the necessary data about supergroups from this cache.
  • +
  • updateSecretChat — This update is received whenever a new secret chat has been discovered or some data about a known secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the Application. So, whenever an Application receives a secret_chat_id, it never needs to use the getSecretChat request to receive the secret chat object. Instead it should maintain a cache of secret chats received through this update and take all the necessary data about secret chats from this cache.
  • +
  • updateNewMessage — This update is received whenever a new incoming or outgoing message is added to a chat.
  • +
  • updateMessageSendSucceeded — This update is received whenever a message is successfully sent.
  • +
  • updateMessageContent — This update is received whenever the content of a message changes.
  • +
  • updateFile — This update is received whenever information about a file is updated. The handling of this update is essential to follow the progress of files being downloaded or uploaded.
  • +
  • updateChatTitle, updateChatPhoto, updateChatPermissions, updateChatLastMessage, updateChatPosition, updateChatReadInbox, updateChatReadOutbox, updateChatReplyMarkup, updateChatDraftMessage, updateChatNotificationSettings, updateChatUnreadMentionCount, updateChatDefaultDisableNotification, updateChatIsBlocked, updateChatIsMarkedAsUnread, updateChatHasScheduledMessages, updateChatActionBar — These updates are received whenever some information about a chat changes, the chats cache should be updated accordingly
  • +
+
+

For a full list of currently available updates see the documentation for the Update class.

+

You can find an example of correct handling of some updates in our Java example.

+
+

Getting the lists of chats

+

Currently there are 3 different types of chat lists:
- Main chat list.
- Archive chat list.
- A folder chat list.

+

The positions of chats in chat lists are managed by TDLib, so the Application only needs to listen to updates that change the chat.positions field, maintain the list of all chats, sorted by the pair (position.order, chat.id) in descending order, and call getChats only if there are not enough known chats. Responses to getChats can be often safely ignored, because if all updates changing chat.positions are processed correctly, then the chat list should already be up to date. Because chats are sorted in descending order of position.order, the first request to getChats should have offset_order == 2^63 - 1 == 9223372036854775807 — the maximum possible value that a signed 64-bit integer can have. For optimal performance, the number of returned chats is chosen by TDLib and can be smaller than the specified limit. If the Application needs more chats, it should repeat the request with adjusted offset_order and offset_chat_id parameters.

+
+

You can find an example of retrieving the Main chat list in our Java example.

+
+

Getting chat messages

+

The Application can use the getChatHistory method to get messages in a chat. The messages will be returned in the reverse chronological order (i.e., in descending order of message_id). The Application can pass from_message_id == 0 to get messages from the last message. To get more messages than can be returned in one response, the Application needs to pass the identifier of the last message it has received as from_message_id to next request. For optimal performance, the number of the returned messages is chosen by TDLib and can be smaller than the specified limit. If the Application needs more messages, it needs to adjust the from_message_id parameter and repeat the request.

+
+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/core.telegram.org/tdlib/notification-api.html b/data/core.telegram.org/tdlib/notification-api.html new file mode 100644 index 0000000000..37fa29fe48 --- /dev/null +++ b/data/core.telegram.org/tdlib/notification-api.html @@ -0,0 +1,210 @@ + + + + + Notification API + + + + + + + + + + + + + +
+ +
+
+
+
+

Notification API

+ +

This article describes the TDLib Notification API introduced in TDLib 1.4.0.

+

Notification API overview

+

TDLib takes care of everything that is related to handling notifications (as usually, except for how exactly the notifications will be shown to the user). TDLib controls when notifications are shown to the user, when they are edited and removed, guarantees consistency of notifications with the database state and persistence of active notifications between client restarts.

+

All notifications shown to the user are combined into notification groups. For example, notifications about ordinary messages from the one chat belong to one notification group. This grouping is done automatically by TDLib based on message content and the user's notification settings. Currently, there are 4 different notification group types:

+
    +
  • Messages notification groups contain notifications with ordinary unread messages from a chat.
  • +
  • Mentions notification groups contain notifications with unread mentions of the current user, replies to their messages, and notifications about pinned messages in a chat.
  • +
  • SecretChat notification groups contain a single notification about creating a new secret chat.
  • +
  • Calls notification groups contain notifications about received calls in a chat.
  • +
+

TDLib ensures that the number of notification groups shown to the user any given moment is limited by the value of the notification_group_count_max option and that the number of active notifications, shown to the user in a notification group at any given time, is limited by the value of the notification_group_size_max option. Whenever the number of notification groups with active notifications exceeds notification_group_count_max, TDLib sends an update hiding all notifications from the oldest group. If subsequently all notifications are hidden in some other group, that first group can be silently brought back by an update from TDLib. Similarly, whenever the number of active notifications in a group exceeds notification_group_size_max, TDLib sends an update hiding the oldest notifications in the group. If subsequently some newer notifications are removed from the group, older notifications can be silently brought back by an update from TDLib.

+

To enable the TDLib Notificaition API you need to set option notification_group_count_max to a positive value, to disable the Notification API you can change the option value back to 0 or set the option value to empty.

+

Every notification group has a unique ID, which is a persistent small integer number, assigned consequently from 1. The client should not assume that the group‘s type and other fields are fixed, because TDLib may reuse the notification group ID whenever it’s known that the group will never be used again in the future. Every notification belongs to a notification group and has a globally unique ID, which is a persistent small integer number, assigned consequently from 1. Notification IDs are never reused and can be used together with their notification group ID to uniquely identify a notification. Within a notification group, notifications must be shown in the order defined by their IDs. If notification grouping isn't available in your operating system, the existence of notification groups can be safely ignored and notifications can be handled separately just by their unique ID.

+

Currently, there are 4 different kinds of notifications:

+
    +
  • NewMessage notifications contain the full information about a new incoming message received from the server. They may be located in Messages and Mentions notification groups.
  • +
  • NewPushMessage notifications contain information about a new incoming message received in a push notification. They contain only partial data about the message and will be replaced by NewMessage notifications as soon as the client downloads the necessary data. They may be located in Messages and Mentions notification groups.
  • +
  • NewSecretChat notifications inform about creating a new secret chat. Only one will be located in each SecretChat notification group. The group may be reused as soon as the notification is removed.
  • +
  • NewCall notifications contain information about a new incoming call. They are located in a Calls notification group. The group may be reused as soon as the notifications are removed.
  • +
+

Messages from new push message notifications will not be shown in the chat message list, but their message identifiers are known and they can be replied to and used in ViewMessages calls anyway.

+

Handling Notification API updates

+

Notification API introduced 4 new updates from TDLib, namely updateActiveNotifications, updateNotificationGroup, updateNotification and updateHavePendingNotifications.

+

If Notification API is enabled, the client receives an updateActiveNotifications update on startup, containing all notifications that are to be shown to the user. The client needs to synchronize the list of notifications that is shown to the user with the list received in updateActiveNotifications and save information about all active notifications in memory, because subsequent updates will contain only changes to the list of active notifications.

+

Whenever a notification is added to a group or is removed from a group, TDLib sends an updateNotificationGroup update to the client. Aside from the list of added notifications and list of identifiers of removed notifications, the update contains full information about the new type of the notification group, the identifier of the chat to which all notifications in the group now belong, the identifier of the chat the notification settings of which must be used to show the notification, a flag determining whether the notification must be shown with or without sound and the new total count of unread notifications in the group. Be aware that the total count of unread notifications in a group can be higher than the number of active notifications. Also note that some old notifications can be added through updateNotificationGroup when newer notifications are removed, so the client must ensure the correct notification order based on notification identifiers. Whenever possible, updateNotificationGroup updates for a group are combined into a single update, so the client can apply the changes together. TDLib also controls the delay before notifications are shown to the user in order to give them a chance to read the messages from a different device before the notification is shown, therefore the updates should be processed on the client side immediately without any additional delays.

+

Whenever an active notification is changed, TDLib sends an updateNotification update to the client. The update contains new content of the notification. The client should be ready to handle the change of notification type, for example, from NewPushMessage to NewMessage.

+

Whenever there are some received but delayed notifications or there can be some yet unreceived notifications because of unavailable network connection to the Telegram servers, TDLib informs the client about that via updateHavePendingNotifications update. Client is supposed to keep the application running in order to receive all delayed notifications. If there is no possibility to keep the application running, the client can close the TDLib instance in order to immediately receive all delayed notification updates.

+

TDLib tries to ensure that whenever a notification about a pinned message is sent, the pinned message is already available locally in the memory, so the client can use a new request getMessageLocally to get the pinned message. Also, updateNotification will be sent whenever pinned message is changed, despite that the notification itself wasn't changed.

+

Customizing the Notification API

+

The client controls the maximum number of active notification groups by using the option notification_group_count_max. This option's value defaults to 0, i.e. there are no active notification groups and the Notification API is effectively disabled. Any integer value between 0 and 25 can be used as the value of the option. Values above 25 are not allowed because most operating systems will not show so many notification groups anyway.

+

The client also controls the maximum number of active notifications in a group by using the option notification_group_size_max. This option's value defaults to 10 and can be set to any integer value between 1 and 25. Values above 25 are not allowed, because most operating systems will not show so many notifications in a group anyway.

+

The user may choose to show pinned messages or mentions among ordinary messages in the Messages notification group instead of the Mentions notification group and choose to not apply notification settings from the sender's private chat to them. This can be done on a per chat basis or for the whole chats notification scope via the new options disable_pinned_message_notifications and disable_mention_notifications which were added to chatNotificationSettings and scopeNotificationSettings classes.

+

Handling push notifications

+

In order to support multiple accounts in one app, the method registerDevice now returns a globally unique identifier of the push notification subscription. This identifier can be used to match a push notification with the corresponding account and process the notification only by the account for which the notification was sent.

+

Whenever a push notification is received, the client needs to call the synchronous method getPushReceiverId with the payload of the push notification. The method will return a globally unique identifier of the push notification subscription (aka push receiver ID), which can be used to find the TDLib instance which needs to be launched and used to process the push notification. If the method returns 0 as a push receiver ID, then the push notification should be processed by all clients (this usually happens when there is only one client).

+

To process a notification, the method processPushNotification needs to be called in the TDLib instance (or instances) found by push receiver ID. This method can be called before authorization and its execution will be automatically postponed until TDLib initialization. The method returns the result only after all updates caused by the push notification have been sent and the TDLib instance can be safely closed. If the method returns an error with the code 406, then the push notification is known to be unsupported and connection to the server is required to fetch new data. If any other error is returned, an error occurred while processing the push notification, i.e. the notification payload has failed to decrypt or parse. In that case, connection to the server isn't required, but there can be new notifications there. After a successful response from processPushNotification the TDLib instance can be immediately closed in order to reduce battery usage. Alternatively, the client can wait for an updateHavePendingNotifications update telling that there are no more delayed or unreceived notifications.

+

Android and iOS clients can opt-in to receive end-to-end encrypted push notifications via a Firebase Cloud Messaging or Apple Push Notification service VoIP notifications while subscribing to push notifications through registerDevice method. In case of Firebase Cloud Messaging, if end-to-end encrypted push notifications are disabled, push notifications are sent without content, so there no notifications of the type NewPushMessage will be created, the client will always need to connect to Telegram servers to download new messages whenever a push notification is received.

+

Examples of push notification payloads, which are accepted by TDLib:

+
{
+  "date": 1234567890,
+  "data": {
+    "custom": {
+      "msg_id": "1234567",
+      "from_id": "12345678",
+      "mtpeer": {
+        "ah": "-1234567",
+        "ph": {
+          "volume_id": "987654321",
+          "local_id": "98765",
+          "secret": "998877665544332211",
+          "file_reference": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
+          "dc_id": 6,
+          "_": "fileLocation"
+        }
+      }
+    },
+    "badge": "239",
+    "loc_key": "MESSAGE_TEXT",
+    "loc_args": [
+      "First name Last name",
+      "qwerty"
+    ],
+    "line1": "First name Last name",
+    "line2": "qwerty",
+    "random_id": 728931540,
+    "text": "First name Last name: qwerty",
+    "system": "Windows 10.0.20573.1"
+  }
+}
+{
+  "google.sent_time": 1234567890123,
+  "p": "jdTXkJnEMUTK6R82AB-55bLA3U_RB-2K-CLDz7mWp7ckjMIfnCoHEcm710SkN"
+}
+{
+  "date": 1234567890,
+  "loc_key": "CHAT_MESSAGE_TEXT",
+  "loc_args": [
+    "First name Last name",
+    "Chat title",
+    "qwerty"
+  ],
+  "custom": {
+    "msg_id": "1234567",
+    "channel_id": "56781234",
+    "chat_from_id": "12345678",
+    "mention": "1"
+  },
+  "badge": "239"
+}
+

Users removing active notifications

+

There are two methods for removing notifications from the list of active notifications when they are hidden by the user. If the user removes a single notification, it can be removed by calling the method removeNotification. If the user dismisses the whole notification group, this can be achieved using the method removeNotificationGroup. Removed notifications will never return to the list of active notifications, but can be still counted in the total count of unread notifications of the group.

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/tdlib/options.html b/data/core.telegram.org/tdlib/options.html new file mode 100644 index 0000000000..e9002abe27 --- /dev/null +++ b/data/core.telegram.org/tdlib/options.html @@ -0,0 +1,465 @@ + + + + + TDLib options + + + + + + + + + + + + + +
+ +
+
+
+ +

TDLib options

+ +

TDLib has many options that affect the behavior of the library. Each option has a name and a value. Value may be of one of the following types:

+ + + + + + + + + + + + + + + + + + + + + + + +
Type of valueDefault valueValue range
Integer064-bit integer
BooleanfalseTrue or false
StringAny Unicode string
+

List of options supported by TDLib

+

Options not mentioned in this list may be safely ignored.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeWritableDescription
always_parse_markdownBooleanYesIf true, text entities will be automatically parsed in all inputMessageText objects
archive_and_mute_new_chats_from_unknown_usersBooleanYesIf true, new chats from non-contacts will be automatically archived and muted. The option can be set only if the option “can_archive_and_mute_new_chats_from_unknown_users” is true. getOption needs to be called explicitly to fetch the latest value of the option, changed from another device
disable_contact_registered_notificationsBooleanYesIf true, notifications about the user's contacts who have joined Telegram will be disabled. User will still receive the corresponding message in the private chat. getOption needs to be called explicitly to fetch the latest value of the option, changed from another device
disable_persistent_network_statisticsBooleanYesIf true, persistent network statistics will be disabled, which significantly reduces disk usage
disable_sent_scheduled_message_notificationsBooleanYesIf true, notifications about outgoing scheduled messages that were sent will be disabled
disable_time_adjustment_protectionBooleanYesIf true, protection from external time adjustment will be disabled, which significantly reduces disk usage
disable_top_chatsBooleanYesIf true, support for top chats and statistics collection is disabled
ignore_background_updatesBooleanYesIf true, allows to skip all updates received while the TDLib instance was not running. The option does nothing if the database or secret chats are used
ignore_default_disable_notificationBooleanYesIf true, the disable_notification value specified in the request will be always used instead of the default value
ignore_inline_thumbnailsBooleanYesIf true, prevents file thumbnails sent by the server along with messages from being saved on the disk
ignore_platform_restrictionsBooleanYesIf true, chat and message restrictions specific to the currently used operating system will be ignored
ignore_sensitive_content_restrictionsBooleanYesIf true, sensitive content will be shown on all user devices. getOption needs to be called explicitly to fetch the latest value of the option, changed from another device
is_location_visibleBooleanYesIf true, other users will be allowed to see the current user's location
language_pack_database_pathStringYesPath to a database for storing language pack strings, so that this database can be shared between different accounts. By default, language pack strings are stored only in memory
language_pack_idStringYesIdentifier of the currently used language pack from the current localization target
localization_targetStringYesName for the current localization target (currently supported: “android”, “android_x”, “ios”, “macos” and “tdesktop”)
message_unload_delayIntegerYesThe maximum time messages are stored in memory before they are unloaded, 60-86400; in seconds. Defaults to 60 for users and 1800 for bots
notification_group_count_maxIntegerYesMaximum number of notification groups to be shown simultaneously, 0-25
notification_group_size_maxIntegerYesMaximum number of simultaneously shown notifications in a group, 1-25. Defaults to 10
onlineBooleanYesOnline status of the current user
prefer_ipv6BooleanYesIf true, IPv6 addresses will be preferred over IPv4 addresses
use_pfsBooleanYesIf true, Perfect Forward Secrecy will be enabled for interaction with the Telegram servers for cloud chats
use_quick_ackBooleanYesIf true, quick acknowledgement will be enabled for outgoing messages
use_storage_optimizerBooleanYesIf true, the background storage optimizer will be enabled
animated_emoji_sticker_set_nameStringNoName of a sticker set with animated emojis
animation_search_bot_usernameStringNoUsername of a bot which can be used in inline mode for animations search
authorization_dateIntegerNoPoint in time (Unix timestamp) when authorization was received
basic_group_size_maxIntegerNoMaximum number of members in a basic group
call_connect_timeout_msIntegerNoMaximum time to wait for call connection creation to be passed to libtgvoip
call_packet_timeout_msIntegerNoMaximum time to wait for call packet delivery to be passed to libtgvoip
can_archive_and_mute_new_chats_from_unknown_usersBooleanNoIf true, the option “archive_and_mute_new_chats_from_unknown_users” can be changed
can_ignore_sensitive_content_restrictionsBooleanNoIf true, the option “ignore_sensitive_content_restrictions” can be changed
enabled_proxy_idIntegerNoIdentifier of the enabled proxy
expect_blockingBooleanNoIf true, access to Telegram is likely blocked for the user
favorite_stickers_limitIntegerNoMaximum number of favorite stickers
forwarded_message_count_maxIntegerNoMaximum number of forwarded messages per one request
group_anonymous_bot_user_idIntegerNoIdentifier of the bot which is shown as the sender of anonymous messages in groups when viewed from an outdated client
message_caption_length_maxIntegerNoMaximum length of a message caption
message_text_length_maxIntegerNoMaximum length of a message text
my_idIntegerNoIdentifier of the current user
pinned_archived_chat_count_maxIntegerNoMaximum number of pinned cloud chats in the Archive chat list. The same amount of secret chats can be pinned locally
pinned_chat_count_maxIntegerNoMaximum number of pinned cloud chats in the Main chat list. The same amount of secret chats can be pinned locally
photo_search_bot_usernameStringNoUsername of a bot which can be used in inline mode for photos search
replies_bot_chat_idIntegerNoIdentifier of the @replies bot
suggested_language_pack_idStringNoIdentifier of the language pack, suggested for the user by the server
supergroup_size_maxIntegerNoMaximum number of members in a supergroup
t_me_urlStringNoCurrent value of t.me URL, i.e. https://t.me/
telegram_service_notifications_chat_idIntegerNoIdentifier of the Telegram Service Notifications chat
test_modeBooleanNoIf true, the test environment is being used instead of the production environment
unix_timeIntegerNoAn estimation of the current Unix timestamp. The option will not be updated automatically unless the difference between the previous estimation and the locally available monotonic clocks changes significantly
venue_search_bot_usernameStringNoUsername of a bot which can be used in inline mode for venues search
versionStringNoTDLib version. This options is guaranteed to come before all other updates since TDLib 1.4.0
+

Additionally any option beginning with 'x' or 'X' is writeable and can be safely used by the application to persistently store some small amount of data.

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/techfaq.html b/data/core.telegram.org/techfaq.html new file mode 100644 index 0000000000..063cf63e98 --- /dev/null +++ b/data/core.telegram.org/techfaq.html @@ -0,0 +1,333 @@ + + + + + FAQ for the Technically Inclined + + + + + + + + + + + + + +
+ +
+
+
+
+

FAQ for the Technically Inclined

+ +
+

This FAQ about MTProto is intended for advanced users. You may also want to check out our Basic FAQ.
Please note, that client developers are required to comply with the Security Guidelines.

+
+

+

General questions

+

Q: Why did you go for a custom protocol?

+

In order to achieve reliability on weak mobile connections as well as speed when dealing with large files (such as photos, large videos and files up to 2 GB each), MTProto uses an original approach. This document is intended to clarify certain details of our setup, as well as address some points that are difficult to understand at first glance.

+

Q: Where can I read more about the protocol?

+

Detailed protocol documentation is available here. Please note that MTProto supports two layers: client-server encryption that is used in Telegram cloud chats and end-to-end encryption that is used in Telegram Secret Chats. See below for more information.

+

If you have any comments, hit us up on Twitter.

+

Q: How does server-client encryption work in MTProto?

+

Server-client encryption is used in Telegram cloud chats. Here's a brief overview of the setup:

+ + +
Note 1
+

Each plaintext message to be encrypted in MTProto always contains the following data to be checked upon decryption in order to make the system robust against known problems with the components:

+
    +
  • server salt (64-Bit)
  • +
  • session id
  • +
  • message sequence number
  • +
  • message length
  • +
  • time
  • +
+
Note 2
+

See additional comments on our use of IGE and message authentication.

+
Note 3
+

Telegram's End-to-end encrypted Secret Chats are using an additional layer of encryption on top of the described above.

+

Q: How does end-to-end encryption work in MTProto?

+

End-to-end encryption is used in Telegram Secret Chats. You can read more about it here: Secret Chats, End-to-End encryption. Here's a brief overview of the setup:

+
+ +
+ +

Please see these articles for details:

+ +

Q: Why are you not using X? (insert solution)

+

While other ways of achieving the same cryptographic goals, undoubtedly, exist, we feel that the present solution is both robust and also sucсeeds at our secondary task of beating unencrypted messengers in terms of delivery time and stability.

+

Q: Why are you mostly relying on classical crypto algorithms?

+

We prefer to use well-known algorithms, created in the days when bandwidth and processing power were both a much rarer commodity. This has valuable side-effects for modern-day mobile development and sending large files, provided one takes care of the known drawbacks.

+

The weakspots of such algorithms are also well-known, and have been exploited for decades. We use these algorithms in such a combination that, to our best knowledge, prevents any known attack from possibly succeeding. Although we’d be grateful to see any evidence of the contrary (so far absent) and update our system accordingly.

+

Q: I'm a security expert and I think your protocol is not secure.

+

If you have any comments, we would be happy to hear them at security@telegram.org. We award bounties to those who help us discover and fix vulnerabilities in our clients and protocol.

+

You are also welcome to join in our competition — we are offering $300,000 to the first person to break Telegram encryption. Check out the contest announcement.

+

Encryption

+

Q: How are MTProto messages authenticated?

+

All Telegram apps ensure that msg_key is equal to SHA-256 of a fragment of the auth_key concatenated with the decrypted message (including 12…1024 bytes of random padding). It is important that the plaintext always contains message length, server salt, session_id and other data not known to the attacker.

+

It is crucial that AES decryption keys depend both on msg_key, and on auth_key, known only to the parties involved in the exchange.

+

Q: Are you doing Encrypt-then-MAC, MAC-then-Encrypt or MAC-and-Encrypt?

+

We do none of the above, strictly speaking. For message authentication, we compute SHA-256(auth_key_fragment + AES_decrypt(…,encrypted_message)) upon message receipt and compare this value to the msg_key received with the encrypted message.

+
+

See also: Why not Encrypt-then-MAC?

+
+

Q: Why don't you go for a standard encrypt-then-MAC approach?

+

Using encrypt-then-MAC, e.g. involving GCM (Galois Counter Mode), would enable the receiving party to detect unauthorized or modified ciphertexts, thus eliminating the need to decrypt them in case of tampering.

+

In MTProto, the clients and the server authenticate messages by ensuring that SHA-256(auth_key_fragment + plaintext + padding) = msg_key and that the plaintext always contains message length, server salt, session_id and other data not known to a potential attacker before accepting any message. These security checks performed on the client before any message is accepted ensure that invalid or tampered with messages will always be safely (and silently) discarded.

+

This way we arrive at the same result. The difference is that the security check is performed before decryption in Encrypt-then-MAC and after decryption in MTProto – but in either case before a message is accepted. AES encryption / decryption on devices currently in use is comparable in speed with the additional HMAC computation required for the encrypt-then-MAC approach.

+

Q: Do you still use SHA-1?

+

The current version of the protocol is using SHA-256. MTProto 1.0 used to rely on SHA-1 (see this FAQ for details).

+

In MTProto 2.0, SHA-1 is used only where the choice of hash function is irrelevant for security, e.g.:

+ +

Q: Do you use IGE? IGE is broken!

+

Yes, we use IGE, but it is not broken in our implementation. The fact that we do not use IGE as MAC together with other properties of our system makes the known attacks on IGE irrelevant.

+

IGE, just as the ubiquitous CBC, is vulnerable to blockwise-adaptive CPA. But adaptive attacks are only a threat for as long as the same key can be used in several messages (not so in MTProto).

+

Adaptive attacks are even theoretically impossible in MTProto, because in order to be encrypted the message must be fully formed first, since the key is dependent on the message content. As for non-adaptive CPA, IGE is secure against them, as is CBC.

+

Authentication

+

Q: How is the server authenticated during DH key exchange?

+

The DH exchange is authenticated with the server's public RSA-key that is built into the client (the same RSA-key is also used for protection against MitM attacks).

+

Q: How are clients authenticated?

+

Various secrets (nonce, server_nonce, new_nonce) exchanged during key generation guarantee that the DH-key can only be obtained by the instance that initiated the exchange.

+

Notice that new_nonce is transferred explicitly only once, inside an RSA-encrypted message from the client to the server.

+

Q: How are Secret Chats authenticated?

+

Keys for end-to-end encrypted secret chats are generated by a new instance of DH key exchange, so they are known only to the parties involved and not to the server. To establish the identities of these parties and to ensure that no MitM is in place, it is recommended to compare identicons, generated from hashes of the DH secret chat keys (key visualizations).

+

Q: How are Voice Calls authenticated?

+

Keys for end-to-end encrypted calls are generated using the Diffie-Hellman key exchange. Users who are on a call can ensure that there is no MitM by comparing key visualizations.

+

To make key verification practical in the context of a voice call, Telegram uses a three-message modification of the standard DH key exchange for calls:

+
    +
  • A->B : (generates a and) sends g_a_hash := hash(g^a)
  • +
  • B->A : (stores g_a_hash, generates b and) sends g_b := g^b
  • +
  • A->B : (computes key (g_b)a, then) sends g_a := ga
  • +
  • B : checks hash(g_a) == g_a_hash, then computes key (g_a)^b
  • +
+

The idea is that Alice commits to a specific value of a (and of g_a), but does not reveal g_a to Bob (or Eve) until the very last step. Bob has to choose his value of b and g_b without knowing the true value of g_a. If Eve is performing a Man-in-the-Middle attack, she cannot change a depending on the value of g_b received from Bob and she also can't tune her value of b depending on g_a. As a result, Eve only gets one shot at injecting her parameters — and she must fire this shot with her eyes closed.

+

Thanks to this modification, it becomes possible to prevent eavesdropping (MitM attacks on DH) with a probability of more than 0.9999999999 by using just over 33 bits of entropy in the visualization. These bits are presented to the users in the form of four emoticons. We have selected a pool of 333 emoji that all look quite different from one another and can be easily described in simple words in any language.

+

You can read more about key verification for Telegram calls here.

+

Q: Do you have Forward Secrecy?

+

Telegram's Secret chats support Perfect Forward Secrecy, you can read more about it here.

+

Protection against known attacks

+

Known-Plaintext Attacks

+

By definition, the known-plaintext attack (KPA) is an attack model for cryptanalysis where the attacker has samples of both the plaintext, and its encrypted version (ciphertext).

+

AES IGE that is used in MTProto is robust against KPA attacks (see this, if you wonder how one can securely use IGE). On top of that, the plaintext in MTProto always contains server_salt and session id.

+

Chosen-Plaintext Attacks

+

By definition, a chosen-plaintext attack (CPA) is an attack model for cryptanalysis which presumes that the attacker has the capability to choose arbitrary plaintexts to be encrypted and obtain the corresponding ciphertexts.

+

MTProto uses AES in IGE mode (see this, if you wonder how one can securely use IGE) that is secure against non-adaptive CPAs. IGE is known to be not secure against blockwise-adaptive CPA, but MTProto fixes this in the following manner:

+

Each plaintext message to be encrypted always contains the following to be checked upon decryption:

+
    +
  • server salt (64-Bit)
  • +
  • message sequence number
  • +
  • time
  • +
+

On top of this, in order to replace the plaintext, you would also need to use the right AES key and iv, both dependent on the auth_key. This makes MTProto robust against a CPA.

+

Chosen-Ciphertext Attacks

+

By definition, a chosen-ciphertext attack (CCA) is an attack model for cryptanalysis in which the cryptanalyst gathers information, at least in part, by choosing a ciphertext and obtaining its decryption under an unknown key. In the attack, an adversary has a chance to enter one or more known ciphertexts into the system and obtain the resulting plaintexts. From these pieces of information the adversary can attempt to recover the hidden secret key used for decryption.

+

Each time a message is decrypted in MTProto, a check is performed to see whether msg_key is equal to the SHA-256 of a fragment of the auth_key concatenated with the decrypted message (including 12…1024 bytes of random padding). The plaintext (decrypted data) also always contains message length, server salt and sequence number. This negates known CCAs.

+

What about IND-CCA?

+

MTProto 2.0 satisfies the conditions for indistinguishability under chosen ciphertext attack (IND-CCA).

+
+

Read more about IND-CCA in MTProto 1.0

+
+

Replay attacks

+

Replay attacks are denied because each plaintext to be encrypted contains the server salt and the unique message id and sequence number.

+

This means that each message can only be sent once.

+

Man-in-the-middle attacks

+

Telegram has two modes of communication — ordinary chats using client-server encryption and Secret Chats using end-to-end encryption.

+

Client-Server communication is protected from MiTM-attacks during DH key generation by means of a server RSA public key embedded into client software. After that, if both clients trust the server software, the Secret Chats between them are protected by the server from MiTM attacks.

+

The interface offers a way of comparing Secret Chat keys for users who do not trust the server. Visualizations of the key are presented in the form of identicons (example here). By comparing key visualizations users can make sure no MITM attack had taken place.

+

Hash collisions for Diffie-Hellman Keys

+

Currently, the fingerprint uses 128-bits of SHA-1 concatenated with 160 bits from the SHA-256 of the key, yielding a total of 288 fingerprint bits, thus negating the possibility of hash-collision attacks.

+
+

Read more about fingerprints in earlier versions of Telegram

+
+

Length extension attacks

+

By definition, length extension attacks are a type of attack when certain types of hashes are misused as message authentication codes, allowing for inclusion of extra information.

+

A message in MTProto consists of an msg_key, equal to the SHA-256 of a fragment of the auth_key concatenated with the plaintext (including some additional parameters and 12…1024 bytes of random padding), followed by the ciphertext. The attacker cannot append extra bytes to the end and recompute the SHA-256, since the SHA-256 is computed from the plaintext, not the ciphertext, and the attacker has no way to obtain the ciphertext corresponding to the extra plaintext bytes she may want to add.

+

Apart from that, changing the msg_key would also change the AES decryption key for the message in a way unpredictable for the attacker, so even the original prefix would decrypt to garbage — which would be immediately detected since the app performs a security check to ensure that the SHA-256 of the plaintext (combined with a fragment of the auth_key) matches the msg_key received.

+

Encrypted CDNs

+

As of Telegram 4.2, we support encrypted CDNs for caching media from public channels with over 100.000 members. The CDN caching nodes are located in regions with significant Telegram traffic where we wouldn't want to place Telegram servers for various reasons.

+
+

For technical details of the implementation, encryption and verification of data, see the CDN manual.

+
+

See this document for a Persian version of this FAQ.
بخش فارسی

+

Q: Why did you decide to use CDNs?

+

We use our own distributed servers to speed up downloads in regions where freedom of speech is guaranteed — and even there we don't take this for granted. But when Telegram becomes immensely popular in other areas, we can only rely on CDNs which we treat rather like ISPs from the technical standpoint in that they only get encrypted data they can't decipher.

+

Thanks to this technology, the download speed for public photos and videos can become significantly higher in regions like Turkey, Indonesia, South America, India, Iran or Iraq without the slightest compromise in security.

+

Q: Can the CDN decipher the files?

+

No. Each file that is to be sent to the CDN is encrypted with a unique key using AES-256-CTR encryption. The CDN can't access the data it stores because these keys are only accessible to the main MTProto server and to the authorized client.

+

Q: Can the CDN substitute the data with their own version?

+

No. Data downloaded from CDN caching nodes is always verified by the receiving Telegram app by way of a hash: attackers won’t be able to replace any files with their own versions.

+

Q: Can the CDN delete any files?

+

No. CDN nodes only cache encrypted copies of files, originals are stored on the Telegram servers. The user is notified about receiving the file by the Telegram server. If the CDN caching node doesn't give the file to the user, the user will receive the file from the Telegram server directly.

+

Q: Can CDNs be used for censorship?

+

No. All original files are stored on the Telegram servers. The CDNs only get encrypted data — and they can't decipher it. They can't substitute any data. And in case of any problems with the CDN, the file will be simply delivered to the users directly from the Telegram servers. Users will always get their data, nobody can stop this.

+

Q: Can I verify this?

+

Yes. Anyone can verify our CDN implementation by checking the source code of Telegram apps and inspecting traffic.

+

Q: Does this affect private data?

+

No. The CDN caching nodes are not a part of the Telegram cloud. CDN caching nodes are used only for caching popular public media from massive channels. Private data never goes there.

+

Q: Is this connected with government requests to move private data to their territory?

+

No. We haven't entered in any agreements with any government regarding the CDNs and the CDNs are not part of any deal. The only purpose of CDNs is to securely improve connectivity in high demand regions where Telegram can't place its servers.

+

Q: Does this give some countries any influence over Telegram?

+

No. We have taken special precautions to make sure that no country gains any leverage over Telegram by way of the CDN caching nodes:

+
    +
  • The CDNs do not belong to Telegram – all the risks are on a third-party company that supplies us with CDN nodes around the world.
  • +
  • We did not invest anything in these CDNs and will only be paying for traffic that is used to pass cached items from our main clusters and to the end users.
  • +
+

As the result, if any country decides to mess with the CDN in their region, they gain nothing except for reducing connectivity for their own citizens – and Telegram loses nothing of value.

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/themes.html b/data/core.telegram.org/themes.html new file mode 100644 index 0000000000..2229d80861 --- /dev/null +++ b/data/core.telegram.org/themes.html @@ -0,0 +1,143 @@ + + + + + Creating Custom Cloud Themes + + + + + + + + + + + + + +
+ +
+
+
+
+

Creating Custom Cloud Themes

+ +

Official Telegram apps support custom cloud themes as of version 5.11. Everyone is welcome to create and share their themes.

+

Creating a theme

+

You can use the Online Theme Editor (use a VPN if it is blocked in your country) to create new Telegram themes from scratch or edit existing ones. Simply log in with your Telegram account and pick a platform to start editing the relevant theme file – or import an existing theme.

+
    +
  • Set a name for your theme using the name attribute
  • +
  • Set colors for elements using hex codes or the color picker
  • +
  • Press ‘Save and apply theme’ to push changes to all users of your theme
  • +
+

Checking your theme in-app

+

Once you have saved a theme for the first time, Telegram will send you a message with its sharing link. Open the link in the app to switch to your theme.

+

You can always switch to your theme in Settings > Chat Settings. On iOS and MacOS native app – Settings > Appearance.

+

Publishing your theme

+

Each theme has a t.me/addtheme link which people can use to switch to your theme. You can choose a beautiful short link (e.g., https://t.me/addtheme/desert) by changing the shortname attribute. If you add support for multiple platforms, the same link can be used for setting your theme on all of them.

+

Updating your theme

+

Your theme gets updated automatically for all its users whenever you save and apply changes.

+

Including a chat background

+

Your themes can include a custom wallpaper. To do this, simply go to Settings > Chat Settings > Chat Background. On iOS and MacOS native app – Settings > Appearance > Chat Background.

+

Open any background and tap the sharing button in the top right corner, then copy its t.me/bg/... link. In the theme file, set this link as the value of the wallpaper attribute.

+

For Telegram Desktop, if you want to make the background tiled, add ?mode=tiled at the end of the link. For example:

+
wallpaper: t.me/bg/-jI7lnO3DFABAAAA1vXcFaZP_Vo?mode=tiled
+

Creating themes in-app

+

If you prefer a more WYSIWYG approach, try creating themes using the in-app tools for customizing appearance. Telegram for Android and Telegram Desktop have advanced in-app theme editors. Telegram for iOS and MacOS allow choosing a custom accent color from the color wheel and a background, then saving the result as a custom theme.

+

Once you have saved a new theme in any of the apps, it also becomes accessible in the online editor.

+

Read more

+ +
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/type/Audio.html b/data/core.telegram.org/type/Audio.html new file mode 100644 index 0000000000..07852bed3d --- /dev/null +++ b/data/core.telegram.org/type/Audio.html @@ -0,0 +1,128 @@ + + + + + Audio + + + + + + + + + + + + + +
+ + + +
+ + + + + + diff --git a/data/core.telegram.org/type/DecryptedDataBlock.html b/data/core.telegram.org/type/DecryptedDataBlock.html new file mode 100644 index 0000000000..3b2d6dd625 --- /dev/null +++ b/data/core.telegram.org/type/DecryptedDataBlock.html @@ -0,0 +1,128 @@ + + + + + DecryptedDataBlock + + + + + + + + + + + + + +
+ + + +
+ + + + + + diff --git a/data/core.telegram.org/type/DecryptedMessage.html b/data/core.telegram.org/type/DecryptedMessage.html new file mode 100644 index 0000000000..18e5ee15d7 --- /dev/null +++ b/data/core.telegram.org/type/DecryptedMessage.html @@ -0,0 +1,140 @@ + + + + + DecryptedMessage + + + + + + + + + + + + + +
+ +
+
+
+ +

DecryptedMessage

+ +

Object describes the contents of an encrypted message.

+

+
===8===
+decryptedMessage#1f814f1f random_id:long random_bytes:bytes message:string media:DecryptedMessageMedia = DecryptedMessage;
+decryptedMessageService#aa48327d random_id:long random_bytes:bytes action:DecryptedMessageAction = DecryptedMessage;
+
+===17===
+decryptedMessage#204d3878 random_id:long ttl:int message:string media:DecryptedMessageMedia = DecryptedMessage;
+decryptedMessageService#73164160 random_id:long action:DecryptedMessageAction = DecryptedMessage;
+
+===45===
+decryptedMessage#36b091de flags:# random_id:long ttl:int message:string media:flags.9?DecryptedMessageMedia entities:flags.7?Vector<MessageEntity> via_bot_name:flags.11?string reply_to_random_id:flags.3?long = DecryptedMessage;
+
+===73===
+decryptedMessage#91cc4674 flags:# no_webpage:flags.1?true silent:flags.5?true random_id:long ttl:int message:string media:flags.9?DecryptedMessageMedia entities:flags.7?Vector<MessageEntity> via_bot_name:flags.11?string reply_to_random_id:flags.3?long grouped_id:flags.17?long = DecryptedMessage;

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/type/DecryptedMessageAction.html b/data/core.telegram.org/type/DecryptedMessageAction.html new file mode 100644 index 0000000000..02a3f8c20a --- /dev/null +++ b/data/core.telegram.org/type/DecryptedMessageAction.html @@ -0,0 +1,145 @@ + + + + + DecryptedMessageAction + + + + + + + + + + + + + +
+ +
+
+
+ +

DecryptedMessageAction

+ +

Object describes the action to which a service message is linked.

+

+
===8===
+decryptedMessageActionSetMessageTTL#a1733aec ttl_seconds:int = DecryptedMessageAction;
+decryptedMessageActionReadMessages#c4f40be random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionDeleteMessages#65614304 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionScreenshotMessages#8ac1f475 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionFlushHistory#6719e45c = DecryptedMessageAction;
+
+===17===
+decryptedMessageActionResend#511110b0 start_seq_no:int end_seq_no:int = DecryptedMessageAction;
+decryptedMessageActionNotifyLayer#f3048883 layer:int = DecryptedMessageAction;
+decryptedMessageActionTyping#ccb27641 action:SendMessageAction = DecryptedMessageAction;
+
+===20===
+decryptedMessageActionRequestKey#f3c9611b exchange_id:long g_a:bytes = DecryptedMessageAction;
+decryptedMessageActionAcceptKey#6fe1735b exchange_id:long g_b:bytes key_fingerprint:long = DecryptedMessageAction;
+decryptedMessageActionAbortKey#dd05ec6b exchange_id:long = DecryptedMessageAction;
+decryptedMessageActionCommitKey#ec2e0b9b exchange_id:long key_fingerprint:long = DecryptedMessageAction;
+decryptedMessageActionNoop#a82fdd63 = DecryptedMessageAction;

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/type/DecryptedMessageLayer.html b/data/core.telegram.org/type/DecryptedMessageLayer.html new file mode 100644 index 0000000000..c698efedc0 --- /dev/null +++ b/data/core.telegram.org/type/DecryptedMessageLayer.html @@ -0,0 +1,129 @@ + + + + + DecryptedMessageLayer + + + + + + + + + + + + + +
+ +
+
+
+ +

DecryptedMessageLayer

+ + + +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/type/DecryptedMessageMedia.html b/data/core.telegram.org/type/DecryptedMessageMedia.html new file mode 100644 index 0000000000..bf28500b9d --- /dev/null +++ b/data/core.telegram.org/type/DecryptedMessageMedia.html @@ -0,0 +1,149 @@ + + + + + DecryptedMessageMedia + + + + + + + + + + + + + +
+ +
+
+
+ +

DecryptedMessageMedia

+ +

Object describes media contents of an encrypted message.

+

+
===8===
+decryptedMessageMediaEmpty#89f5c4a = DecryptedMessageMedia;
+decryptedMessageMediaPhoto#32798a8c thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaVideo#4cee6ef3 thumb:bytes thumb_w:int thumb_h:int duration:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaGeoPoint#35480a59 lat:double long:double = DecryptedMessageMedia;
+decryptedMessageMediaContact#588a0a97 phone_number:string first_name:string last_name:string user_id:int = DecryptedMessageMedia;
+decryptedMessageMediaDocument#b095434b thumb:bytes thumb_w:int thumb_h:int file_name:string mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaAudio#6080758f duration:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+
+===17===
+decryptedMessageMediaVideo#524a415d thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaAudio#57e0a9cb duration:int mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+
+===23===
+decryptedMessageMediaExternalDocument#fa95b0dd id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector<DocumentAttribute> = DecryptedMessageMedia;
+
+===45===
+decryptedMessageMediaPhoto#f1fa8d78 thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes caption:string = DecryptedMessageMedia;
+decryptedMessageMediaVideo#970c8c0e thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes caption:string = DecryptedMessageMedia;
+decryptedMessageMediaDocument#7afe8ae2 thumb:bytes thumb_w:int thumb_h:int mime_type:string size:int key:bytes iv:bytes attributes:Vector<DocumentAttribute> caption:string = DecryptedMessageMedia;
+decryptedMessageMediaVenue#8a0df56f lat:double long:double title:string address:string provider:string venue_id:string = DecryptedMessageMedia;
+decryptedMessageMediaWebPage#e50511d8 url:string = DecryptedMessageMedia;

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/type/DisabledFeature.html b/data/core.telegram.org/type/DisabledFeature.html new file mode 100644 index 0000000000..3cb70c2c4f --- /dev/null +++ b/data/core.telegram.org/type/DisabledFeature.html @@ -0,0 +1,128 @@ + + + + + DisabledFeature + + + + + + + + + + + + + +
+ + + +
+ + + + + + diff --git a/data/core.telegram.org/type/MessageReactionsList.html b/data/core.telegram.org/type/MessageReactionsList.html new file mode 100644 index 0000000000..9b7f6be3f2 --- /dev/null +++ b/data/core.telegram.org/type/MessageReactionsList.html @@ -0,0 +1,128 @@ + + + + + MessageReactionsList + + + + + + + + + + + + + +
+ + + +
+ + + + + + diff --git a/data/core.telegram.org/type/Video.html b/data/core.telegram.org/type/Video.html new file mode 100644 index 0000000000..07f2eb6427 --- /dev/null +++ b/data/core.telegram.org/type/Video.html @@ -0,0 +1,128 @@ + + + + + Video + + + + + + + + + + + + + +
+ + + +
+ + + + + + diff --git a/data/core.telegram.org/type/account.SentChangePhoneCode b/data/core.telegram.org/type/account.SentChangePhoneCode new file mode 100644 index 0000000000..75077c664c --- /dev/null +++ b/data/core.telegram.org/type/account.SentChangePhoneCode @@ -0,0 +1,128 @@ + + + + + Account.SentChangePhoneCode + + + + + + + + + + + + + +
+ + + +
+ + + + + + diff --git a/data/core.telegram.org/type/auth.CheckedPhone b/data/core.telegram.org/type/auth.CheckedPhone new file mode 100644 index 0000000000..fc50fb2606 --- /dev/null +++ b/data/core.telegram.org/type/auth.CheckedPhone @@ -0,0 +1,128 @@ + + + + + Auth.CheckedPhone + + + + + + + + + + + + + +
+ + + +
+ + + + + + diff --git a/data/core.telegram.org/type/contacts.Link b/data/core.telegram.org/type/contacts.Link new file mode 100644 index 0000000000..9b169b7230 --- /dev/null +++ b/data/core.telegram.org/type/contacts.Link @@ -0,0 +1,128 @@ + + + + + contacts.Link + + + + + + + + + + + + + +
+ + + +
+ + + + + + diff --git a/data/core.telegram.org/type/help.ProxyData b/data/core.telegram.org/type/help.ProxyData new file mode 100644 index 0000000000..74b4b9f7c4 --- /dev/null +++ b/data/core.telegram.org/type/help.ProxyData @@ -0,0 +1,130 @@ + + + + + Help.ProxyData + + + + + + + + + + + + + +
+ + + +
+ + + + + + diff --git a/data/core.telegram.org/type/messages.FoundGifs b/data/core.telegram.org/type/messages.FoundGifs new file mode 100644 index 0000000000..45502897c9 --- /dev/null +++ b/data/core.telegram.org/type/messages.FoundGifs @@ -0,0 +1,128 @@ + + + + + Messages.FoundGifs + + + + + + + + + + + + + +
+ + + +
+ + + + + + diff --git a/data/core.telegram.org/type/messages.SentMessage b/data/core.telegram.org/type/messages.SentMessage new file mode 100644 index 0000000000..fd5144a3fa --- /dev/null +++ b/data/core.telegram.org/type/messages.SentMessage @@ -0,0 +1,128 @@ + + + + + messages.SentMessage + + + + + + + + + + + + + +
+ + + +
+ + + + + + diff --git a/data/core.telegram.org/type/messages.StatedMessage b/data/core.telegram.org/type/messages.StatedMessage new file mode 100644 index 0000000000..70318f3ec2 --- /dev/null +++ b/data/core.telegram.org/type/messages.StatedMessage @@ -0,0 +1,128 @@ + + + + + messages.StatedMessage + + + + + + + + + + + + + +
+ + + +
+ + + + + + diff --git a/data/core.telegram.org/type/messages.StatedMessages b/data/core.telegram.org/type/messages.StatedMessages new file mode 100644 index 0000000000..a789574721 --- /dev/null +++ b/data/core.telegram.org/type/messages.StatedMessages @@ -0,0 +1,128 @@ + + + + + messages.StatedMessages + + + + + + + + + + + + + +
+ + + +
+ + + + + + diff --git a/data/core.telegram.org/widgets.html b/data/core.telegram.org/widgets.html new file mode 100644 index 0000000000..f9bb329ce4 --- /dev/null +++ b/data/core.telegram.org/widgets.html @@ -0,0 +1,141 @@ + + + + + Telegram Widgets + + + + + + + + + + + + + +
+ +
+
+
+
+

Telegram Widgets

+ +

Telegram widgets offer a quick way to add a sharing button to your pages, embed posts from public channels or groups. Widgets can also help your users log in with Telegram or view Telegram Discussions on your website.

+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/widgets/discussion.html b/data/core.telegram.org/widgets/discussion.html new file mode 100644 index 0000000000..030bf7db75 --- /dev/null +++ b/data/core.telegram.org/widgets/discussion.html @@ -0,0 +1,226 @@ + + + + + Discussion Widget + + + + + + + + + + + + + + + +
+ +
+
+
+ +

Discussion Widget

+ +

You can embed discussions from any public channel on your website. You only need a link to a post with comments to embed it together with all discussion.

+

If you have a website with articles and a telegram channel where you post links to these articles, you can use this widget to show discussions from that channel on your website. In this case you only need a link to the channel. Discussions will be available on your website as soon as you post a link into the channel. For this to work, you should add the <link rel="canonical" href="%page_url%"> tag to the page header where %page_url% is the canonical URL of the current page.

+

Configure widget

+

You can choose options for your widget using the form below.

+

+
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+
+ +
+ +
+
+ + + + + + + +
+ + +
+
+ +
+ +
+ +
Make sure you have a <link rel="canonical" href="%page_url%"> tag in the page header with the canonical url of the current page.
+
+
+ +
+
+
+
+
+

+

Basic comments

+

If you're looking to simply add Telegram comments to pages on your website, without linking them with a channel, you can use our basic comments solution.

+
+ +
+ +
+
+ +
+ + + + + + + + + + diff --git a/data/core.telegram.org/widgets/login.html b/data/core.telegram.org/widgets/login.html new file mode 100644 index 0000000000..b0cd268ee0 --- /dev/null +++ b/data/core.telegram.org/widgets/login.html @@ -0,0 +1,404 @@ + + + + + Telegram Login Widget + + + + + + + + + + + + + + +
+ +
+
+
+ +

Telegram Login Widget

+ +
+

The Telegram login widget is a simple way to authorize users on your website.
Check out this post for a general overview of the widget.

+
+

Setting up a bot

+

To use the login widget, you'll need a Telegram bot.

+

We strongly recommend that the profile picture of the bot you use for authorization corresponds with your website‘s logo, and that the bot’s name reflects that connection.

+

Users will see this message when they log into your website:

+
+ +
+ +

It is more likely that users will log in if your bot has a name and logo they expect to see.

+

Linking your domain to the bot

+

Once you have chosen a bot, send the /setdomain command to @Botfather to link your website's domain to the bot. Then configure your widget below and embed the code on your website.

+

Widget configuration

+

+
+ +
+
+
+ +
+ +
+ + +
+ Log in below to load your bots with linked domains +
+
+ +
+ +
+ + + +
+
+ +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+
+
+

+

Receiving authorization data

+

After a successful authorization, the widget can return data in two ways:

+
    +
  • by redirecting the user to the URL specified in the data-auth-url attribute with the following parameters: id, first_name, last_name, username, photo_url, auth_date and hash;
  • +
  • by calling the callback function data-onauth with the JSON-object containing id, first_name, last_name, username, photo_url, auth_date and hash fields.
  • +
+

Checking authorization

+

You can verify the authentication and the integrity of the data received by comparing the received hash parameter with the hexadecimal representation of the HMAC-SHA-256 signature of the data-check-string with the SHA256 hash of the bot's token used as a secret key.

+

Data-check-string is a concatenation of all received fields, sorted in alphabetical order, in the format key=<value> with a line feed character ('\n', 0x0A) used as separator – e.g., 'auth_date=<auth_date>\nfirst_name=<first_name>\nid=<id>\nusername=<username>'.

+

The full check might look like:

+
data_check_string = ...
+secret_key = SHA256(<bot_token>)
+if (hex(HMAC_SHA256(data_check_string, secret_key)) == hash) {
+  // data is from Telegram
+}
+

To prevent the use of outdated data, you can additionally check the auth_date field, which contains a Unix timestamp when the authentication was received.

+

Sample implementation

+

You can find sample PHP code for checking authorization and receiving data about a logged in user on this page.

+
+ +
+ +
+
+ +
+ + + + + + + + + diff --git a/data/core.telegram.org/widgets/post.html b/data/core.telegram.org/widgets/post.html new file mode 100644 index 0000000000..e56ad51075 --- /dev/null +++ b/data/core.telegram.org/widgets/post.html @@ -0,0 +1,240 @@ + + + + + Post Widget + + + + + + + + + + + + + + + +
+ +
+
+
+ +

Post Widget

+ +

You can embed messages from public groups and channels anywhere. Here’s what an embed of a Telegram message looks like when included on a web page:

+

+ +

+
+ +

To get the HTML-code for embedding a message, just open its t.me link (e.g., t.me/durov/43) in a web browser and click < > EMBED:

+
+ +
+ +

Configure widget

+

You can choose more options using the form below.

+

+
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ +
+ +
+ + + +
+
+ +
+ +
+
+ + + + + + + +
+ + +
+
+ +
+ +
+ +
+
+ +
+
+
+
+
+

+
+ +
+ +
+
+ +
+ + + + + + + + + + diff --git a/data/core.telegram.org/widgets/share.html b/data/core.telegram.org/widgets/share.html new file mode 100644 index 0000000000..48ce73e36f --- /dev/null +++ b/data/core.telegram.org/widgets/share.html @@ -0,0 +1,250 @@ + + + + + Sharing Button + + + + + + + + + + + + + + +
+ +
+
+
+ +

Sharing Button

+ +

A Telegram Sharing Button is an easy way to let users forward content from your website or app to their friends, Channels or Saved Messages on Telegram.

+
+ TITLE +
+ +

When a user presses the button, Telegram asks them to choose a chat, group or channel where your link will be shared. You can also add some text that describes the link – the user will be able to edit it before sending the message.

+
+ TITLE +
+ +
+

Check out posts on the Telegram Blog for working examples of sharing buttons.

+
+

Adding Telegram sharing buttons to your website

+

Widget Constructor

+

Use this constructor to get embeddable code for your website.

+


+ +

+
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ +
+
+ +
+
+
+
+
+

+

Custom buttons

+

Feel free to create your own custom UI for the button. The only thing you need to make it work is to point the user to this URL on click:

+
https://t.me/share/url?url={url}&text={text}
+

where {url} is the URL the user will be sharing and {text} is an optional description that will be included with the link. Both values should be URL-encoded.

+

Here is a sample code for PHP:

+
/**
+ * @param string $url Absolute URL to share, e.g. "https://example.com/path/to/article?with=params"
+ * @param string $text Optional comment to share URL with, e.g. "Check out this article!"
+ * @return string Button HTML markup, feel free to modify to your taste
+ */
+function telegramForwardButton($url, $text = '') {
+  $share_url = 'https://t.me/share/url?url='.rawurlencode($url).'&text='.rawurlencode($text);
+  return "<a href=\"{$share_url}\">Share</a>";
+}
+

You are welcome to use the Telegram Logos in your custom button design.

+

Integrations and libraries

+ +

If you have a library, plugin or integration script for Telegram sharing buttons, please contact @BotSupport and we'll add you to this list.

+
+ +
+ +
+
+ +
+ + + + + + + + + diff --git a/data/instantview.telegram.org/samples.html b/data/instantview.telegram.org/samples.html new file mode 100644 index 0000000000..de8376107b --- /dev/null +++ b/data/instantview.telegram.org/samples.html @@ -0,0 +1,395 @@ + + + + + Sample Templates - Instant View + + + + + + + + + + +
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+

Sample Templates

+

In this section, you can check out the exact same templates that we're currently using to generate Instant View pages for posts on Medium, Telegra.ph, and the Telegram Blog. We've added many comments to these templates, so they literally speak for themselves.

+ +
+

+ medium.com7 +

+
+
+

7 pages

+

Not modified

+
+
+ +
+

+ telegra.ph2 +

+
+
+

2 pages

+

Not modified

+
+
+ +
+

+ telegram.org7 +

+
+
+

7 pages

+

Not modified

+
+
+ +
+
+
+
+
+ + + + + + + + + diff --git a/data/telegram.org/api.html b/data/telegram.org/api.html new file mode 100644 index 0000000000..d6a3659f3e --- /dev/null +++ b/data/telegram.org/api.html @@ -0,0 +1,284 @@ + + + + + Telegram Messenger + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ + + + + + +
+ +

Why Telegram?

+ +
+
+
+
+

Simple

+
Telegram is so simple you already know how to use it.
+
+
+ +
+
+
+

Private

+
Telegram messages are heavily encrypted and can self-destruct.
+
+
+ +
+
+
+

Synced

+
Telegram lets you access your chats from multiple devices.
+
+
+ +
+
+
+

Fast

+
Telegram delivers messages faster than any other application.
+
+
+ +
+
+
+

Powerful

+
Telegram has no limits on the size of your media and chats.
+
+
+ +
+
+
+

Open

+
Telegram has an open API and source code free for everyone.
+
+
+ +
+
+
+

Secure

+
Telegram keeps your messages safe from hacker attacks.
+
+
+ +
+
+
+

Social

+
Telegram groups can hold up to 200,000 members.
+
+
+ +
+
+
+

Expressive

+
Telegram lets you completely customize your messenger.
+
+
+
+ +
+ +
+ +
+
+
+ + + + + + + + diff --git a/data/telegram.org/blog/200-million.html b/data/telegram.org/blog/200-million.html new file mode 100644 index 0000000000..9e98f87b71 --- /dev/null +++ b/data/telegram.org/blog/200-million.html @@ -0,0 +1,222 @@ + + + + + 200,000,000 Monthly Active Users + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

200,000,000 Monthly Active Users

+ +
+ +
+ +

Within the last 30 days, Telegram was used by 200,000,000 people. This is an insane number by any standards. If Telegram were a country, it would have been the sixth largest country in the world.

+
+ +
+ +

We owe reaching this milestone to you alone – our users. We have never promoted Telegram with ads, so all these 200 million people are on Telegram because you invited them to join.

+

This is why you – our users – have been and will always be our only priority. Unlike other popular apps, Telegram doesn’t have shareholders or advertisers to report to. We don’t do deals with marketers, data miners or government agencies. Since the day we launched in August 2013 we haven’t disclosed a single byte of our users' private data to third parties.

+

We operate this way because we don’t regard Telegram as an organization or an app. For us, Telegram is an idea; it is the idea that everyone on this planet has a right to be free.

+
+

Above all, we at Telegram believe in people. We believe that humans are inherently intelligent and benevolent beings that deserve to be trusted; trusted with freedom to share their thoughts, freedom to communicate privately, freedom to create tools. This philosophy defines everything we do.

+
+

This was the reason why Telegram became the first messaging app to roll out end-to-end encryption to tens of millions of users in 2013. This was also the reason why Telegram became the first mainstream messaging app to fully open source its client code, and why Telegram became the first popular messenger to provide 100% open APIs for third party app and bot developers.

+

Over the years, our unconditional trust in people allowed us to do things other apps were hesitant to implement; things such as support for insanely large group chats, unlimited broadcast channels and a free user-generated sticker platform. In all these cases, our belief in people yielded extraordinary results, and users put these tools to great use.

+

What inspires us most is that, judging by the rapid growth of Telegram’s popularity, this belief might be mutual. While we unconditionally believe in people, it turns out 200,000,000 humans also believe in us.

+

Thank you for this – we will always have your back.

+

+
+

+ + +

March 22, 2018,
Pavel Durov

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/admin-revolution.html b/data/telegram.org/blog/admin-revolution.html new file mode 100644 index 0000000000..8748be07d9 --- /dev/null +++ b/data/telegram.org/blog/admin-revolution.html @@ -0,0 +1,261 @@ + + + + + Supergroups 10,000: Admin Tools & More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Supergroups 10,000: Admin Tools & More

+ +
+ +
+ +
+ +
+ +
+

This is an old blog post. In case you missed it, groups can already have up to 200,000 members each.

+
+

With Telegram 4.1, we're increasing the maximum size of supergroups to 10,000 members each. That’s a lot of people packed into one group, and now users and admins can use search to find specific users among them:

+
+ +

Search for members

+
+ +

Admins can also search for members in their channels.

+

With groups as big as 10,000 people – the size of a decent small town – you may be looking for some more powerful management tools. And that’s exactly what Telegram 4.1 gives you.

+ + +

Admin Rights

+

You can now add admins with specific sets of privileges to help you run your community. Choose who among your trusted admins will be able to add new users, manage messages, block members, edit group info, or even add new admins.

+
+ +

Admin rights

+
+ +

Partial Bans

+

Admins who don’t want to completely ban members from their supergroups can now partially restrict their rights in order to stop behavior that's causing problems. You can put nasty users into read-only mode or maybe stop them from sending stickers or media for a certain period of time. Now you can do all of this with absolute precision:

+
+ +

Partial bans

+
+ +

Even robots can get in on the fun. With Bot API version 3.1, you can use admin bots to automatically impose temporary or permanent bans based on member actions. Check out the docs here to start building your robotic police force today.

+

Recent Admin Actions

+

When multiple admins are working with one group, it’s easy to get confused about which admin did what and when (or which admin bot has gone Skynet on your members). That’s why we've added a “Recent Actions” section to the admins page. This section stores a log of all service actions taken in the group in the last 48 hours and is visible to admins only.

+
+
+ +

Recent admin actions

+
+
+ +

Precise filters

+
+ +

Recent actions in supergroups also show messages that were deleted in the last 48 hours and the original versions of edited messages for the same period, so nasty behavior like self-deleted spam will no longer help anyone escape the admins’ wrath.

+

Sharing and Android Pay

+

In other news, Telegram 4.1 for iOS brings you an improved sharing extension. When sharing stuff from other apps to Telegram you can add an optional comment and select multiple recipients easily. 3D Touch on the app icon to see some new actions, including taking a photo/video and sending it to multiple recipients.

+
+ +

New sharing extension

+
+ +

On Android, Telegram 4.1. gets you Android Pay support for Bot Payments and improved media selection – photos and videos are now shown together when sharing from the attachment menu or gallery.

+

Free speech

+

This update also features anti-censorship tools such as the ability to set up a Proxy server in the “Data and Storage” section of the Settings.

+

We believe in free and secure communication. It’s our responsibility to offer technology to defend our users’ right to privacy and freedom of speech around the world.

+

June 30, 2017
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/albums-saved-messages.html b/data/telegram.org/blog/albums-saved-messages.html new file mode 100644 index 0000000000..32dc0b530d --- /dev/null +++ b/data/telegram.org/blog/albums-saved-messages.html @@ -0,0 +1,268 @@ + + + + + Albums, Saved Messages and Better Search + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Albums, Saved Messages and Better Search

+ +
+ +
+ +
+ +
+ +

Starting with Telegram 4.5, whenever you send multiple photos or videos they are grouped into albums. Each album can include up to 10 photos or videos, arranged in the chat as elegantly proportioned thumbnails. They will also result in one notification instead of ten on the recipient’s side.

+
+
+ +
+
+ +

Photo Order

+

From now on, you can control the order in which photos are sent. Each photo you choose for sharing will show its sequence number. This makes it easy to double check that your “before-and-after” pics will be sent in the correct order.

+

Multiple Profile Photos

+

When viewing a photo from an album, you’ll see other pictures from the same group as thumbnails in the lower part of the screen. Profile photos are now also displayed this way, which makes them much easier to navigate.

+
+
+ +
+
+ +

Saved Messages

+

You can now bookmark important messages by quickly forwarding them to Saved Messages – your personal cloud storage for any messages or media you may want to send or forward there. Each saved message has a “go to” button that takes you to the right place in the chat where it was originally posted.

+
+ +

Saved Messages Chat

+
+ +

The Saved Messages chat is always displayed at the top of the list in the sharing and forwarding menus. This makes it easy to save your favorites while keeping things as tidy as before.

+
+ +

Number One in the Sharing Menu

+
+ +

Saved Messages are easy to find: they are accessible both from the Chats list and from the side panel on Android / Settings on iOS.

+

Improved Search

+

Speaking of finding things, we’ve upgraded the global search algorithm used for finding public channels, groups and bots. Now you can search for public channels and bots by their titles, and most popular items will always be displayed first.

+

Pinned Messages in Channels

+

Channel admins can now pin messages to focus their subscribers’ attention on important announcements. This tool can also come in handy if you want to help new subscribers navigate your channel.

+
+ +

Pinned Message

+
+ + +

iOS: New Settings, iPhone X Support

+

Telegram 4.5 comes packed with goodies for iOS users. The Settings screen and the context menu in chats got a makeover. Version 4.5 also works great on iPhone X.

+
+
+ +

Redesigned Settings

+
+
+ +

Edit Settings

+
+ +

And that’s it for today. We hope you enjoy these new features while we’re working on the next update!

+
+

+
+ +

November 15, 2017
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/android-2-0.html b/data/telegram.org/blog/android-2-0.html new file mode 100644 index 0000000000..f66e78b9d7 --- /dev/null +++ b/data/telegram.org/blog/android-2-0.html @@ -0,0 +1,257 @@ + + + + + Telegram 2.0 for Android: Material Design + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Telegram 2.0 for Android: Material Design

+ +
+ +
+ +

Telegram for Android received a massive update today, featuring a full redesign along Android 5.0 material guidelines and adding long awaited features such as instant full-text cloud search, new flexible privacy settings for last-seen timestamps and account self-destruction.

+

Material Design

+

Every screen was updated to make Telegram consistent with Android 5.0 design standards and animations. We've also added support for the new standards on Android 4.x and even on older 2.x devices.

+
+ + + + + +
+
+ + +

Demo

+

Here‘s what Telegram’s new material design looks like in motion on a Google Nexus phone, just to give you a taste of the animations:

+
+
+
+
+
+
+ +
+
+ + +

Instant Full-Text Search

+

You can now find any message you sent or received in Telegram by using the universal search. Tapping a message in search results sends you to its place in your message history. This way you can find stuff even if you only vaguely remember the context.

+
+ + +
+
+ +

The search is much faster than what you have in GMail and other apps. Our technology guarantees that even if your inbox grows to several hundred thousands of messages, instant search will stay just as fast.

+

Hiding Last Seen Time

+

We take privacy very seriously, so we invested a lot of time and effort to make this feature right. As a result, the Who can see your Last Seen time control allows unprecedented precision and flexibility.

+
+ + + +

+
+ +

In fact, it's so good that we wrote a whole separate blog post about it. Read more here:
Privacy Revolution — Last Seen Done Right »

+

Account Self-Destruction

+

Big companies like to accumulate data about their users and keep it for an indefinite time. Telegram is not a commercial organization and we value our disk space greatly. Last year we introduced self-destructing messages, today we are adding self-destructing accounts.

+

From now on, if you stop using Telegram and do not login for at least 6 months, your account will be deleted along with all messages, media, contacts and every other piece of data you store in the Telegram cloud. You can change the exact period after which your inactive account will self-destruct – with options ranging from 1 month to 1 year.

+

..but I'm on iOS

+

Most of these new features are also avaible to iOS fans among Telegram users — except for material design of course. In order to maintain the balance, we're also adding a few nifty features to our iOS app today. Read all about them here:
The new Telegram for iOS — GIF search and more »

+

+ +

The Telegram Team,
November 19, 2014

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/android-gif.html b/data/telegram.org/blog/android-gif.html new file mode 100644 index 0000000000..8837a752ca --- /dev/null +++ b/data/telegram.org/blog/android-gif.html @@ -0,0 +1,218 @@ + + + + + GIF and Image Search on Android + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

GIF and Image Search on Android

+ +
+ +
+ +

One of the best beloved features of our iOS app finally comes to Telegram for Android. You can now easily search the web for GIFs and images and send them to your friends.

+

To do this, simply open the Gallery attachment menu — you will find the new Search Web and Search GIF tabs at the top.

+
+ + + + + + +
+
+ +

Your recent gifs and images will be saved, so you can send them again with just a few taps. This is very useful when you're out of words and emoji are just not enough.

+

+ +

Stay tuned for more updates this year!

+

December 20,
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/android-streaming.html b/data/telegram.org/blog/android-streaming.html new file mode 100644 index 0000000000..5a0c1b8d75 --- /dev/null +++ b/data/telegram.org/blog/android-streaming.html @@ -0,0 +1,241 @@ + + + + + Streaming and Auto-Night Mode on Android + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Streaming and Auto-Night Mode on Android

+ +
+ +
+ +
+ +
+ +

Today's 4.8 update to Telegram for Android introduces video streaming. You can now start watching videos right away – without having to fully download them first.

+
+ +

Streaming-ready video in a chat

+
+ +

All videos newly uploaded from official Telegram apps can be streamed with version 4.8. You can see the caching progress as a light grey strip:

+
+ +

Streaming in progress

+
+ +

Auto-Night Mode

+

As of this update, Telegram for Android can automatically switch to the dark version of the interface after nightfall or in low-light conditions. To set up Auto-Night Mode, go to Settings > Theme > Auto-Night Mode.

+
+ +

Auto-night mode settings

+
+ +

Telegram for Android supports a multitude of custom themes, so you can choose which theme the app will switch to using the ‘Preferred Night Theme’ setting.

+

Сonnected websites

+

We're also launching a Telegram Login Widget today. Version 4.8 includes a ‘Logged in with Telegram’ section in the Privacy & Security settings that lists all the websites you are logged in to via Telegram.

+
+

Read more about the Telegram Login Widget

+
+

All these features are also coming to iOS, so stay tuned for our next updates.

+

+ +

February 6, 2018,
The Telegram Team

+

P.S.

+

Don‘t miss the other updates we’ve launched in the last few days:

+ +
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/android-themes.html b/data/telegram.org/blog/android-themes.html new file mode 100644 index 0000000000..deebf62ddd --- /dev/null +++ b/data/telegram.org/blog/android-themes.html @@ -0,0 +1,246 @@ + + + + + Custom Themes + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Custom Themes

+ +
+ +
+ +
+ +
+ +

We believe in freedom. This is why Telegram is a free and open platform – for stickers, for bots, and even for third-party client apps. We believe that if we give you freedom, you’ll know what to do with it.

+

Starting today, 85% of Telegram users can completely change what Telegram looks like for them. We are rolling out Custom Themes on Android, and will later support them on less popular platforms.

+

To switch to a different theme or create a new one, go to Settings > Theme. We‘ve included a Dark Theme in that menu for those of you who don’t want to use Telegram as a flashlight in dark places.

+
+
+ +

The new dark theme

+
+
+ +

Easy on the eyes

+
+ +

Create Your Own

+

We've also added a Theme Editor to the app. You can now create new themes and easily share them with other users.

+
+
+ +

Choose an element

+
+
+ +

Pick a color

+
+ +

Just like stickers and bots, Telegram themes are part of an open platform, so anybody can create a theme and dazzle the world with new colors and backgrounds. Here's another example of a theme created by our users:

+
+
+ +

Theme preview: Chats list

+
+
+ +

Chat screen

+
+ +

Check out the @AndroidThemes and Desktop Themes channels for more new themes made by Telegram users.

+

If you're using our iOS app, hold on for a couple of weeks. You‘ll get themes eventually, but for now we’re building something different for you – and it’s truly epic.

+

+ +

February 20, 2017
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/android-wear-2-0.html b/data/telegram.org/blog/android-wear-2-0.html new file mode 100644 index 0000000000..28a06a9ad0 --- /dev/null +++ b/data/telegram.org/blog/android-wear-2-0.html @@ -0,0 +1,224 @@ + + + + + Telegram for Android Wear 2.0 + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Telegram for Android Wear 2.0

+ +
+ +
+ +
+ +
+ +

Google has just unveiled Android Wear 2.0, the latest in smartwatch platforms. It supports standalone apps, so today we're releasing Telegram for Android Wear 2.0. It‘s everything you’d want from a perfect watch app — compact, beautiful, and super-fast.

+
+ +
+ +

Using this tiny yet powerful app, you can browse your chats and quickly reply to messages with voice, text, emoji, or stickers. You can also view your contacts and even create groups right from your watch.

+
+
+ +
+
+ +

The smartwatch app also supports several themes in different colors. By the way, theme support is coming to our main Android app soon, so stay tuned.

+

Telegram for Android Wear 2.0 is available for download on Google Play. If you have Android Wear 2.0 installed on your watch, just search for Telegram in the store.

+

+ +

February 9, 2017
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/apple-watch.html b/data/telegram.org/blog/apple-watch.html new file mode 100644 index 0000000000..0c4e6a5656 --- /dev/null +++ b/data/telegram.org/blog/apple-watch.html @@ -0,0 +1,225 @@ + + + + + Telegram on Apple Watch + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Telegram on Apple Watch

+ +
+ +
+ +
+

Telegram for iOS reaches version 3.0 today, packed with the Bot Platform, dedicated sticker tabs and our first take on Apple Watch support.

+
+

Finally! Telegram 3.0 arrived with full Apple Watch support. You can view your recent chats and reply to messages with stickers, locations, emoji, preset phrases or dictated text. You can also view user and group profiles, start new chats, and even block users.

+
+ + + + +
+
+ +

Chats on your Apple Watch will show all the content available on Telegram: photos, stickers, locations, documents and videos. For those cases when the watch can‘t handle something, we’ve added a shortcut to easily open any message on your Phone.

+
+ + + + +
+ +

We've made sure that Telegram on Apple Watch does as much as the platform can support right now — and that it does more than any other messaging app out there.

+

+ +

The Telegram Team,
June 24, 2015

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/archive-and-new-design.html b/data/telegram.org/blog/archive-and-new-design.html new file mode 100644 index 0000000000..87317315f9 --- /dev/null +++ b/data/telegram.org/blog/archive-and-new-design.html @@ -0,0 +1,318 @@ + + + + + Archived Chats, a New Design and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Archived Chats, a New Design and More

+ +
+ +
+ +
+ Introducing archived chats, a new design and more +
+ +

Today's update gives you the tools to sort your messages with archived chats, a new design on Android and a handful of other nifty features to make the most of your messenger.

+

Everything in its place

+

Introducing archived chats, the new tool for spring cleaning in your chat list. Sort your active and inactive chats, separate personal stuff from work or banish annoying contacts to your archive for some spectacular revenge!

+
+ +
+ +

Swipe left on a chat to transfer it to your archived chats folder. When an archived chat gets a notification, it will pop out of the folder and back into your chat list. Muted chats will stay archived forever.

+

You can hide the archive by swiping left on it. See it again by dragging the screen down.

+
+ +
+ +

Pin an unlimited number of chats in your archive to keep your messages in the order you want. When chats pop out of your archive with a notification, you can archive them again to return them to their original place within the folder.

+
+ Pinned chats in the archive +
+ +

Bulk actions for a busy chat list

+

Time is money and money buys cat food, so don't waste time and make the most of the bulk actions in your chat list, now also available on Telegram for Android. Long tap on a chat to open the new menu where you can select multiple chats and then pin, mute, archive or delete them, all faster than ever before.

+
+ +
+ +

Android's new clothes

+

Telegram for Android got a lot slicker, starting with the app's new icon and down to every menu in the app sporting a new design.

+
+ Telegram for Android's new icon +

New app icon

+
+ +
+ Redesigned menus +

Slick new menus

+
+ + +

Selecting messages in chats is now not only more stylish but also more functional – note the new quick forwarding button which appears right under your thumb:

+
+ +
+ +

More info at a glance

+

With the expanded chat list, you can see more text from the messages in your list. Simply select Three lines in the Chat Settings menu to see up to three lines per chat instead of the usual two.

+
+ Chat settings, choose between two or three lines per chat +

Chat list view settings

+
+ +

Share and share a lot

+

Want to share a message far and wide? Pull up the new streamlined sharing menu to cover the entire screen and select your whole gang. And don‘t fret if you’re short on words, the comment field now supports emoji.

+
+ The new sharing menu with online badges and emoji support +

New sharing menu

+
+ +

The new design also makes it easier to share sticker packs.

+
+ Sticker pack viewer with the new sharing buttons +

New sticker pack viewer

+
+ +

You shall not pass

+

Meanwhile on iOS, passcode settings have been made more stylish and more robust to accommodate 6-digit codes, in addition to the previous 4-digit and custom alphanumeric options. Keep it secret, keep it safe 🔒.

+
+ +
+ + +

Another new feature on iOS allows clearing your recently used stickers so nobody can prove how much you love sending funny dog stickers.

+
+ Clear recent stickers on iOS +

Clear recent stickers

+
+ +

We also thought that large emoji feel more natural without chat bubbles and made them look like little stickers instead. Aren't they cute?

+
+ Clear recent stickers on iOS +

New look for large emoji

+
+ +

Easier forwarding, links to messages, online badges

+

Ever selected the wrong chat when forwarding a message? Tap the message snippet above the text box before sending to change where the message is forwarded to.

+
+ Switch recipient when forwarding messages +

Switch recipient

+
+ +

If you'd rather point to a particular spot in a conversation, you can now copy links to messages in private groups and channels – just like you could with public messages. Needless to say, links to private chats will only work for members of their respective communities.

+
+ Copy links to individual messages in a private community +

Links to individual messages

+
+ +

Last but not least, you can now instantly see who's online from the chat list and sharing menu to find out who else might be watching cat videos in the middle of the night.

+
+ Online badges in chats +
+ +

As always, stay tuned for more updates on all our platforms — we look forward to popping back out of your archive with the next version.

+

+ +

May 9, 2019
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/autoplay.html b/data/telegram.org/blog/autoplay.html new file mode 100644 index 0000000000..12c70cf21e --- /dev/null +++ b/data/telegram.org/blog/autoplay.html @@ -0,0 +1,245 @@ + + + + + Autoplaying Videos, Automatic Downloads and Multiple Accounts + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Autoplaying Videos, Automatic Downloads and Multiple Accounts

+ +
+ +
+ +
+ Autoplaying Videos and New Automatic Download Settings +
+ +

Today's update will make Telegram chats livelier with Autoplaying Videos. Smaller videos will start playing without sound when they reach your screen. To unmute them, simply press the volume buttons on your device.

+
+ +
+ +

If you like to be in control of your data usage, try the new auto-download settings. It‘s easy to see your current settings at a glance and we’ve added a new quick way to switch between Low, Medium and High presets for Mobile, Roaming and Wi-Fi.

+

You can also manually set up automatic downloads by chat type, media type and file size. The app will remember your choices as the Custom preset in case you need to temporarily switch to Low and back — or the other way around.

+

To Each According to Their Needs

+

Default settings for data usage have become more generous but depend on the affordability of mobile data in your country. We know that in some places it's easier to buy an aircraft carrier than download an extra 20MB (looking at you, Ethiopia). Telegram will try to download less data for users in such countries.

+

On the other hand, if you're likely to have a monster data allowance, Telegram will try to save you from tapping the “download” arrow too often.

+

These new default limits for automatic downloads are not set in stone. Starting today, we can change them remotely, based on your feedback and the cost of data in each country.

+

To Log Out or Not to Log Out?

+

New users often bring their logout habits from other apps and don't realize that this is rarely necessary on Telegram. To help them find their way around the app, the logout menu now shows several alternative options to logging out:

+
+ Logout Alternatives +

Logout Alternatives

+
+ + +

Multiple Account Support

+

Some of us have several phone numbers and multiple Telegram accounts: one for work, another strictly personal and a third one provided by benevolent aliens along with instructions to never use it except in a planetary emergency.

+

You can add all these accounts to your app and easily switch between up to 3 phone numbers without logging out.

+
+ Add account +

Add Account in Settings > Edit

+
+ +

If you've added several accounts, you will receive push notifications for all of them. Notifications will include information on which account they were sent to. You can also tap and hold on an account in Settings for a sneak peek of its chats list:

+
+ +
+ +

The multiple accounts feature was born in Telegram for Android and is now also available on iOS. We hope your alter-egos will be pleased.

+

+ +

February 26, 2019,
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/backgrounds-2-0.html b/data/telegram.org/blog/backgrounds-2-0.html new file mode 100644 index 0000000000..0248657e5f --- /dev/null +++ b/data/telegram.org/blog/backgrounds-2-0.html @@ -0,0 +1,231 @@ + + + + + Chat Backgrounds 2.0: Make Your Own + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Chat Backgrounds 2.0: Make Your Own

+ +
+ +
+ +
+ Telegram 5.3: Introducing the Backgrounds Platform +
+ +

No chat can be dull if you have a really cool chat background. Today's update will ensure you get one. You can now search the web for wallpapers, add effects and then share your backgrounds with friends via links.

+

Telegram backgrounds now support motion and blur effects. You can also set any color as your background, apply a pattern and tweak its intensity.

+
+ +
+ +

Just like before, you can set any photo from your gallery as your chat background. On Android, you can add some extra effects in the built-in photo editor.

+

Share links

+

Having used this new arsenal to create the perfect chat background, you can easily set it to Telegram on all your other devices. What's more, you can infect the rest of the world with your genius by sharing your background via a link, just like this one:
https://t.me/bg/l7jg-vpxmEYBAAAA1e0rNKySlkk

+
+ Message containning a Telegram background +
+ +

Search backgrounds

+

If you don‘t feel very creative and would like to simply set something nice real quick, we’ve added new backgrounds to the official selection.

+

We've also included a background search option. Find your dream wallpaper based on keywords or color and then set it in just a few taps.

+
+ Background Search Results +
+ +

We're also announcing the Instant View 2.0 Template Competition: two months, $300,000+ in prizes, $100 per template. See Instant View Contest 2.0 for details.

+

+ +

January 31, 2019
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/bot-revolution.html b/data/telegram.org/blog/bot-revolution.html new file mode 100644 index 0000000000..9682c5afb1 --- /dev/null +++ b/data/telegram.org/blog/bot-revolution.html @@ -0,0 +1,279 @@ + + + + + Telegram Bot Platform + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Telegram Bot Platform

+ +
+ +
+ +
+

UPD: Check out the new Inline bots as well!

+
+

Telegram is about freedom and openness – our code is open for everyone, as is our API. Today we’re making another step towards openness by launching a Bot API and platform for third-party developers to create bots.

+

Bots are simply Telegram accounts operated by software – not people – and they'll often have AI features. They can do anything – teach, play, search, broadcast, remind, connect, integrate with other services, or even pass commands to the Internet of Things.

+
+ + + +

+ +
+ + +

Today’s 3.0 update to the Telegram apps makes interacting with bots super-easy. In most cases you won’t even have to type anything, because bots will provide you with a set of custom buttons.

+
+

"Every application needs a slightly optimized set of buttons, just for it.
Steve Jobs, 2007 iPhone launch

+
+

Bots can now provide you with custom keyboards for specialized tasks that could look like this for example:

+
+ + + +
+ +

+ +

Here are some sample bots that were built by the platform's beta testers this past weekend:

+
    +
  • @ImageBot – send this bot a keyword and it’ll provide you with a relevant picture.
  • +
  • @TriviaBot – test your trivia knowledge or add to groups to compete with friends.
  • +
  • @PollBot – add this one to group chats to create polls.
  • +
  • @RateStickerBot – discover and rate new stickers.
  • +
  • @AlertBot – set a time and this bot will send you a reminder for anything you like.
  • +
  • @HotOrBot – find friends with this Tinder-like dating bot.
  • +
  • @GithubBot – track GitHub updates.
  • +
  • @StoreBot – find new bots and rate them.
  • +
+
+ +
+ +

Our beta testers needed only a few hours to build these bots – setting up a new bot is a breeze. Just generate a key with @BotFather and use a simple https API to control your bot. If you’re an engineer, check out our Introduction to bots for details.

+

Bots in Telegram will look different from human users: their chat and profile screens have a slightly different UI and they don't have access to all messages by default when added to groups.

+

Taking over the world

+

Once you've launched your bot, watch it spread. In Telegram, any forwarded message contains a link to its original sender. This means any message from your bot forwarded to a person or group is a messaging equivalent of a retweet – bots are viral.

+

Additionally, all bots have an Add To Group and a Share button in their profile. You can set up a description and link that will be used when people share your bot on Telegram or other platforms.

+
+ + + + + + +
+ +

+ +

A typical link to a bot looks like this:

+
+

https://telegram.me/your_bot

+
+

Opening such a link starts a chat with that bot if you have Telegram installed. These links are easy to identify because all bot usernames must end in bot.

+

If the bot developer wants to pass their bot some additional info (like an auth key for example, see deep linking), the link might also look like this:

+
+

https://telegram.me/your_bot?start=value

+
+

The bots are coming

+

Starting today, you'll see links like this in Telegram and elsewhere. Embrace them, they are bots! They will provide the services you asked us for – polls, news, games, integrations, e-butlers or cat images. Any dream can come true with bots.

+

+ +

The Telegram Team,
June 24, 2015

+

+ +

P.S. All bot developers are welcome to share ideas for our Bot API on @BotSupport.

+
+

You can read more about the our bot platform in the Introduction to Bots and in the Bot API Manual.

+
+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/bots-2-0.html b/data/telegram.org/blog/bots-2-0.html new file mode 100644 index 0000000000..e6e452abae --- /dev/null +++ b/data/telegram.org/blog/bots-2-0.html @@ -0,0 +1,260 @@ + + + + + Bot Platform 2.0 + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Bot Platform 2.0

+ +
+ +
+ +

At Telegram, we made it our mission to redefine the boundaries of what you can do with your messaging app. Last year we launched the Bot Platform that has unleashed the creativity of thousands of developers.

+

Today we are giving bot developers a whole new dimension with Bots 2.0: inline keyboards, callback and URL buttons, location permissions and on-the-fly message editing. The new bots can also generate any type of content for you to share with friends, including documents, MP3s, videos, stickers, animations and contacts.

+

To give you a taste of the new possibilities, we built some sample bots last weekend – @music, @youtube, @foursquare and @sticker (make sure your Telegram app was updated today before you try them).

+

New Keyboards, New Actions

+

Here's how @music works – it uses an inline keyboard that allows you to interact with it without sending any messages. And it updates its own messages on the fly as you flip through the pages of search results:

+
+
+ +
+
+ +

New Types of Content

+

The @music bot also works in inline mode, which means it can help you send MP3s to any of your chats, right from the input field:

+
+
+ +
+
+ +

Inline bots can now send all types of attachments that are available on Telegram. We suspect you're going to like the @sticker inline bot – it can find you relevant stickers based on emoji.

+

New Mechanics

+

Like the @music bot, @youtube also works in two modes. It uses the new clever chat switching mechanic to connect your Telegram account with YouTube:

+
+
+ +
+
+ +

Once a Youtube account is connected, you can access additional settings via the new menu option above the results.

+

New Permissions

+

Now, @foursquare is an inline bot that utilizes our new location features and helps you send addresses of places and venues nearby. Note how it asks for permission to use your location when you try to send something for the first time:

+
+
+ +
+
+ + +

New Horizons

+

These sample bots are but the beginning. Our Bot API 2.0 allows developers to create fluid and easy-to-use interfaces for powerful bots. And we will be seeing a lot of new ones in the coming months, after all, 2016 is the year of bots.

+

If you are a developer, take a look at our Introduction to Bots 2.0 and read the full changelog. Also, feel free to subscribe to our official @BotNews channel to stay up to date on platform news.

+

If you are a user, hang on – soon you will have plenty of cool bots to play with. Meanwhile, enjoy the sample bots!

+

+ + +
+

Oh. And we almost forgot we've got more new stuff today!
Read on about Sharing and Previews »

+
+

+ +

April 12, 2016
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/cache-and-stickers.html b/data/telegram.org/blog/cache-and-stickers.html new file mode 100644 index 0000000000..9e6d2b49ef --- /dev/null +++ b/data/telegram.org/blog/cache-and-stickers.html @@ -0,0 +1,231 @@ + + + + + Clearing Cache and Reordering Stickers + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Clearing Cache and Reordering Stickers

+ +
+ +
+ +

Unlike most messengers, Telegram can take up nearly zero space on your phone, even if you‘re using it heavily. When you remove Telegram data from your device’s local cache to free up space, we'll keep it in the cloud for as long as you need, with virtually no limitations.

+

Today we are introducing new cache management options that make it even easier to maintain Telegram’s slender footprint when space is short — without having to sacrifice useful data. The new Clear Cache option allows you to quickly delete cached media by type.

+
+ + + +

+
+ +

Using the Keep Media setting, you can control how long unused media stays on your device. If you haven't accessed a file for the specified time, it is automatically deleted from the cache. Naturally, your data will instantly re-download from the cloud the moment you access it again.

+

On iOS it is also possible to clear cached files on a chat-by-chat basis. On Android, this currently works with supergroups and channels (just tap and hold in the chats list, then ‘Delete from Cache’).

+
+ +

+
+ +

Available on iOS and Android (and coming to WindowsPhone soon), these simple settings help ensure that Telegram will only require the least amount of space on your devices.

+

Reorder Sticker Packs

+

We've also improved the ordering of sticker packs. You can now manually arrange your sticker packs in the order you prefer, and the order will be synced across your devices. Access sticker settings via the new button, right on the sticker panel.

+
+ + +

+
+ +

We're not done for 2015 yet, so watch out for more updates this year.

+

+ + +

December 8, 2015
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/calls.html b/data/telegram.org/blog/calls.html new file mode 100644 index 0000000000..3f85ae2fc9 --- /dev/null +++ b/data/telegram.org/blog/calls.html @@ -0,0 +1,266 @@ + + + + + Voice Calls: Secure, Crystal-Clear, AI-Powered + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Voice Calls: Secure, Crystal-Clear, AI-Powered

+ +
+ +
+ +
+ +
+ +
+

UPD, August 2020: Telegram also supports end-to-end encrypted video calls.

+

UPD, December 2020: You can start a voice chat with thousands of participants in any group.

+
+

Over the past few months, we’ve worked hard to make sure Telegram calls are the best in terms of quality, speed, and security. The wait is over: today Voice Calls are available all over the world in our mobile and desktop apps.

+

The Voice Call interface is familiar and easy to use, but as always, you get loads of innovation under the hood with Telegram.

+
+ +
+ +

Secure

+

Telegram Calls are built upon the time-tested end-to-end encryption of Telegram's Secret Chats. The key verification UI we came up with in 2013 to protect against man-in-the-middle attacks served well for Telegram (and for other apps that adopted it), but for Calls we needed something easier.

+

That's why we've improved the key exchange mechanism. To make sure your call is 100% secure, you and your recipient just need to compare four emoji over the phone. No lengthy codes or complicated pictures!

+
+ +

Key verification

+
+ +

Super-Fast

+

Whenever possible, your calls will go over a peer-to-peer connection, using the best audio codecs to save traffic while providing crystal-clear quality.

+

If a peer-to-peer connection can't be established, Telegram will use the closest server to you to connect you with the person you’re calling in the fastest way possible. Unlike other apps, Telegram has a distributed infrastructure all over the world which we’ve already been using to deliver your texts faster than other apps. Now these servers will also be used for calls.

+

In the coming months, we’ll be expanding our content delivery network around the globe, getting the connection up to light-speed even in remote areas.

+

AI-Powered

+

Each time you make a Voice Call on Telegram, a neural network learns from your and your device's feedback (naturally, it doesn't have access to the contents of the conversation, it has only technical information such as network speed, ping times, packet loss percentage, etc.). The machine optimizes dozens of parameters based on this input, improving the quality of future calls on the given device and network.

+

These parameters can also be adjusted during a conversation if there's a change in your connection. Telegram will adapt and provide excellent sound quality on stable WiFi — or use less data when you walk into a refrigerator with bad reception.

+

According to our tests, Telegram Calls are already superior to any of our competitors on comparable connections. But the quality of Telegram Calls will further improve as you and others use them, thanks to the built-in machine learning.

+

Complete Control

+

If you’re like us, you don’t like to be bothered. On Telegram, you can control who can and who can't call you with granular precision. You can even switch voice calls off altogether, blocking anyone and everyone from calling you.

+
+ +

Privacy settings for calls

+ +

By default, Telegram calls are lightweight and automatically adapt to the speed and type of your connection, so as to consume the least data possible. But if you want to reduce your data spending by another 25-30% at the expense of sound quality, you’re welcome to enable the Use Less Data option in Data and Storage Settings.

+

No Added Calories

+

Telegram is the most powerful messaging platform out there, but it is also famous for being the easiest one to use. We want to keep things this way, and that’s why by default we won’t clutter your screen with additional tabs and redundant buttons.

+

Once you start making calls, Telegram for iOS will offer you to add a dedicated tab for calls on the main screen of the app. Alternatively, you can turn the Calls tab on right away from the Recent Calls section in Settings. On Android, the call tab is accessible via the pull-out main menu on the left.

+

It's always easy to make a call, even if you've never opened the calls tab. As soon as Voice Calls are enabled for your country, a phone icon will appear on every profile page. You can also call by tapping the top bar in a chat and choosing 'Call' on iOS. On Android, the Call button is in the '…' menu at the top.

+
+ +

New call button

+
+ +

One more thing

+

For those of you who don’t do voice calls, v.3.18 brings something different: direct control over the quality of videos you share. Use this brand-new setting to select the degree of compression before sending a video. For the first time in the history of messaging, you can preview how the recipient will see your video before you send it.

+
+
+ +
+
+ +

The app will remember the compression rate you selected and will use it by default for your future video uploads.

+

+ +

And that's it for today. Stay tuned, there's always more coming!

+

+ +

March 30, 2017
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/captions-places.html b/data/telegram.org/blog/captions-places.html new file mode 100644 index 0000000000..2254e3b42e --- /dev/null +++ b/data/telegram.org/blog/captions-places.html @@ -0,0 +1,244 @@ + + + + + Places, Captions and more + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Places, Captions and more

+ +
+ +
+ +

Today we are adding several long-awaited features in one epic update to our Android and iOS apps.

+

Places

+

When sharing a location, you can now choose venues and landmarks. And when viewing a location, you can get directions. The section was also beautifully redesigned.

+
+ + + +
+
+ +

Photo Captions

+

Another thing Telegram was lacking – captions for photos. You can now add them to any picture you send, just tap the T in the photo editing panel.

+
+ + + +
+
+ +

New Voice Messages

+

You can now see whether the recipient has listened to your voice message — and keep track of which ones you've listened to yourself. Voice messages that have not been played yet are now marked with a small dot.

+
+ +
+
+ +

Smart Notifications

+

Tired of buzzing notifications from active group chats? Sick of multiple notifications every time somebody forwards you a dozen messages? Getting notifications on mobile while chatting with the same person from your desktop? Fixed! Starting today, you will be notified only when it is necessary.

+

Rich link previews

+

As promised, link previews now work for almost any news site — in addition to previews for the most popular services like YouTube and Twitter.

+

Android Goodies

+

Telegram for Android joins the iOS app in showing extended ‘typing’ statuses: you can now see when your chat partner is sending you a photo or recording a voice message. Scrolling and photo animations have become smoother than ever.

+

Last but not least, we've fully redesigned the emoji menu on Android so that it now features a dedicated stickers tab. This is the first drumbeat of the stickers revolution that is coming to Telegram soon.

+
+ +
+
+ +

Invite Links for Groups

+

OK, this feature is so awesome that it deserves a separate post.

+

+ +

The Telegram Team,
April 30, 2015

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/channels-2-0.html b/data/telegram.org/blog/channels-2-0.html new file mode 100644 index 0000000000..a9e9e69d75 --- /dev/null +++ b/data/telegram.org/blog/channels-2-0.html @@ -0,0 +1,246 @@ + + + + + Channels 2.0 and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Channels 2.0 and More

+ +
+ +
+ +

Telegram channels are becoming a worldwide trend. Each day they get more than 400,000,000 views. Today we are introducing several features that will make channels and bots even more powerful tools for connecting with your audience.

+

Links to Posts

+

The Quick Share menu now allows you to copy links to individual messages inside a channel. You can send these links to friends outside of Telegram or post them to other social networks. Following such links will open the channel and highlight the message.

+
+ +

Copy Share Link

+
+ +

Silent Messages

+

“Is it OK to post now?” “Is this urgent enough to notify everyone?” If you're a channel admin, you know these questions too well. Luckily, you can now send silent messages that will not notify your subscribers. This is very useful for late night or non-urgent updates. Tap on the bell icon to toggle silent messages on and off.

+
+ +

Silent messages

+
+ +

Admin Signatures

+

There are times when it‘s important to know who posted a certain message. Starting today, you can enable signatures in Channel Info. New messages will be signed with the posting admin’s chosen screen name but will not link to their profile.

+
+
+ +

Channel Settings

+
+
+ +

Signed Messages

+
+ +

Edit Messages in Channels and Supergroups

+

Made a typo? Missed a word? Itching to add something? As of today, you can edit your messages after they were posted. Tap the message (double tap on iOS), then press ‘Edit’. This feature works with supergroups and channels because they both use the same underlying technology.

+

Quick Share Button for Bots

+

Many news organizations are building bots to provide tailored subscriptions. In this update we've made it easier to share the links, pictures and videos you get from bots. Check out the new official @forbesbot to see how this works.

+
+ +

Quick Share button for bots

+
+ +

Bonus: Sticker Previews

+

In other news, sticker previews now work everywhere including sticker suggestions when you type an emoji and the ‘Add stickers’ screen. Tap and hold on a sticker to see it in full size before sending. The devil's in the details, right?

+

Try it out with the Harry set: https://telegram.me/addstickers/harry

+

+ +

And that‘s all we’ve got for you this month.
Stay tuned for more updates in March!

+

+ +

February 24, 2016
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/channels.html b/data/telegram.org/blog/channels.html new file mode 100644 index 0000000000..8ccc467a99 --- /dev/null +++ b/data/telegram.org/blog/channels.html @@ -0,0 +1,224 @@ + + + + + Channels: Broadcasting Done Right + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Channels: Broadcasting Done Right

+ +
+ +
+ +
+

UPD: See Channels 2.0 for info on links to posts, silent messages and admin signatures.

+
+

Today we are introducing Channels, a new tool for broadcasting your messages to large audiences. Channels replace the old Broadcast lists and are better in every way. They can have an unlimited number of members, they can be public with a permanent URL and each post in a channel has its own view counter.

+
+ +

+
+ +

Views from forwarded copies of your messages will be included in the total count. Last but not least, new members can see the entire message history in a channel once they join — all the way to day one.

+

If you'd like an example, join our official Telegram channel to get notified about our updates, or try creating your own channels from the ‘New Message’ menu.

+

iOS 9 Notifications

+

In other good news, we‘ve added Quick Replies from notifications, which are now supported on iOS 9 devices. This means you can reply to messages in Telegram, directly from your iPhone’s lock screen. Split View and more iOS 9 features will become available in early October.

+

Unfortunately, due to a bug in iOS 9, it is currently not possible to display the input field for Quick Replies right away — you‘ll need to press the ’Reply' button in order for it to appear. Quick replies will work as expected when iOS 9.1 is released with the relevant bugfixes.

+

Photo Editor

+

The in-app Photo Editor for iOS was updated with tools to adjust an image's tint, fade, and curves. The existing shadows and highlights tools default to 50% and are now functional in both directions.

+
+ + +

+
+ +

September 22, 2015
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/contacts-local-groups.html b/data/telegram.org/blog/contacts-local-groups.html new file mode 100644 index 0000000000..8bb903d917 --- /dev/null +++ b/data/telegram.org/blog/contacts-local-groups.html @@ -0,0 +1,272 @@ + + + + + Location-Based Chats, Adding Contacts Without Phone Numbers and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Location-Based Chats, Adding Contacts Without Phone Numbers and More

+ +
+ +
+ +
+ Telegram 5.8: Adding Contacts Without Phone Numbers, Location-Based Chats and More +
+ +

In the previous update, we improved privacy settings and added a way for you to control who can see your phone number. Today we're making it easier to exchange contact info on Telegram.

+

All new chats now have an Add to Contacts button at the top. This allows you to quickly add anyone who messages you to your Telegram contacts, even if you don't know their phone number yet.

+
+ Add/Block Buttons in a Chat +
+ +

If you'd prefer they disappeared instead, the Block button is right next door.

+

Add People Nearby

+

Ever scrambled for business cards at a beach party? Or dropped somebody's phone into the pool in a “let me type in my number for you” moment? Worry no more.

+

Simply open Contacts > Add People Nearby to quickly exchange contact info with Telegram users who are standing next to you (and also have this section open).

+
+ +
+ +

This feature comes in especially handy when several people meet to perform the take-my-number dance. Now you can catch all your pokémon in just a few taps.

+

Location-Based Chats

+

Speaking of pokémon, the new People Nearby section also shows Groups Nearby – location-based group chats open for anyone around to join.

+
+ +
+ +

Tap Create a Local Group to unite your dormitory or apartment building, and maybe you can get Todd in 2C to finally turn his music down.

+
+ Location-based group +
+ +

This update opens up a new world of location-based group chats for anything from conferences, to festivals, to stadiums, to campuses, to chatting with people hanging out in the same cafe.

+

Transfer Group Chats

+

If you ever get tired of being the host of your group, you can pass the burden on to another administrator. Telegram apps now support transferring ownership rights from any groups and channels to other users.

+

Grant full admin rights to your Chosen One to see the Transfer Ownership button.

+
+ Transfer group ownership +
+ +

Whether your watch has ended, or you have some business to attend to in King's Landing, passing the torch is a simple, two-tap affair.

+

Enhanced Notification Exceptions

+

Notification Exceptions just got more powerful. You can now toggle message previews for specific chats. If you have many exceptions, use Search to find the right chat — or ‘Delete All’ to get back to square one instantly.

+
+ Notification exceptions +
+ +

Siri Shortcuts

+

Owners of iOS devices can now use Siri shortcuts to open chats with people. No hands just got no-handsomer.

+
+ Siri +
+ +

Theme Picker and Icon style

+

We've also revamped the Appearance settings on iOS so that it's easier to see what the different themes will look like even before you apply them.

+
+ New theme picker on iOS +
+ +

A while back, the Telegram X app for iOS was promoted, becoming the official Telegram, and its previous shell was removed from the store. If you are still using it for some reason, this is a good time to switch — ol' Telegram X is now three versions behind the main branch.

+

Some users told us they didn't want to switch because they liked the Telegram X icon better. So this update adds a way for your iOS app icon to get back in black:

+
+ Pick your poison +
+ +

By the way, Telegram X for Android is still there and is not going anywhere for now. If you're looking for an alternative interface, feel free to give it a try.

+

+ +

June 23, 2019
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/crowdsourcing-a-more-secure-future.html b/data/telegram.org/blog/crowdsourcing-a-more-secure-future.html new file mode 100644 index 0000000000..e29085770c --- /dev/null +++ b/data/telegram.org/blog/crowdsourcing-a-more-secure-future.html @@ -0,0 +1,212 @@ + + + + + Crowdsourcing a More Secure Future + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Crowdsourcing a More Secure Future

+ +
+ +
+ +

A few days ago we launched a contest to improve Telegram's security and are delighted to already have the first results. A Russian IT-community user identified a potentially vulnerable spot in our secret chat implementation. While this would not help him decipher the traffic and win the contest, his achievement deserves a notice — and a big prize.

+
+

The habrahabr user x7mz had discovered that in case the Telegram server could be seized by a malicious third party, it could send different nonce numbers to each of the clients participating in a secret chat.

+

These nonce numbers were introduced to add more randomness to the secret chat keys, mostly because of possible undiscovered vulnerabilities of the random generators on mobile devices (for example, one such vulnerability was found this August in android phones).

+

As was pointed out, this solution would have also made it possible for the visual representations of the shared secret key to be identical in case of a man-in-the-middle attack — provided such attack was done by the seized server. Obviously, the server has been under Telegram's control all this time, so this theoretical threat never had a chance to come to life.

+
+

The developer who found the potential weakness has earned a reward of $100,000. We have contacted him to find out how he would like to collect his prize.

+

A similar reward awaits anyone who finds viable ways of compromising MTProto’s security (and there is an outstanding reward of $200,000 for deciphering Telegram traffic). All submissions to security@telegram.org which result in a change of code or configuration are eligible for bounties, ranging from $500 to $100,000 or more, depending on the severity of the issue.

+

This story showcases the importance of keeping the protocol specification and source code open — this way thousands of bright minds from all over the world can help us find potential vulnerabilities and improve the protocol.

+

Let’s keep on looking for any weak spots. Together we can make Telegram unbreakable.

+

December 21, 2013
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/cryptocontest-ends.html b/data/telegram.org/blog/cryptocontest-ends.html new file mode 100644 index 0000000000..bc5c0410a8 --- /dev/null +++ b/data/telegram.org/blog/cryptocontest-ends.html @@ -0,0 +1,214 @@ + + + + + Crypto Contest Ends + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Crypto Contest Ends

+ +
+ +
+ +
+

This contest is over, but Telegram's bug bounty program is always open.

+

Security researchers are welcome to submit any issues they find in the Telegram apps or protocol to us at security@telegram.org. All submissions which result in a change of code or configuration are eligible for bounties, ranging from $500 to $100,000 or more, depending on the severity of the issue.

+
+

The current round of our contest to crack Telegram’s encryption ends with no winners. Despite the $300,000 bounty and the fact that contestants could act as the Telegram server passing info between the users (i.e. use any kinds of active attacks, manipulate traffic etc.) no one could decipher their Secret Chats by the beginning of February.

+

To demonstrate that the contest was fair, we‘ve added a decryption method to the contest bot’s list of commands – KEY. KEY returns the 256-byte encryption key used in the secret chat, so the task of the contest is now easily achieved.

+

Why are contests important?

+

One of the reasons we trust Telegram’s Secret Chats more than many of their alternatives, is that they're open to scrutiny from the world’s security experts. And while having open source apps and a well documented API makes this kind of scrutiny possible, it is our contests that create incentive for it.

+

That’s why we will definitely launch the next round of our contest later this year. It’ll take us some time to determine whether we can further simplify the task for the contestants. Once ready, we’ll announce the new round on Twitter.

+

Thank you for the vast amount of advice and comments you sent us during these last few months - your input allows us to improve Telegram with each new build.

+

+ +

February 11, 2015
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/cryptocontest.html b/data/telegram.org/blog/cryptocontest.html new file mode 100644 index 0000000000..70fad66826 --- /dev/null +++ b/data/telegram.org/blog/cryptocontest.html @@ -0,0 +1,224 @@ + + + + + $300,000 for Cracking Telegram Encryption + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

$300,000 for Cracking Telegram Encryption

+ +
+ +
+ +
+

This contest is over, but Telegram's bug bounty program is always open.

+

Security researchers are welcome to submit any issues they find in the Telegram apps or protocol to us at security@telegram.org. All submissions which result in a change of code or configuration are eligible for bounties, ranging from $500 to $100,000 or more, depending on the severity of the issue.

+
+

Earlier this year we had a contest to decipher intercepted Telegram messages, that did not produce a winner. Today we announce a new contest with an easier task and a larger prize — $300,000 for cracking Telegram's encryption, and this time contestants can not only monitor traffic, but also act as the Telegram server and use active attacks, which vastly increases their capabilities.

+

In this contest you assume the role of a malicious entity in full control of both the communication lines and the Telegram servers themselves.

+
+

UPD The current round of the contest is over. Go to results »

+
+

Your goal is to extract sensitive data (a secret email address) from a Secret Chat between two users — Nick and Paul. You control the entire process, from chat creation to the sending of each individual message and can perform various active attacks, including MITM, KPA, CPA, replay attacks, etc.

+

Contest Interface

+

In order to facilitate the task, we have created an interface, using which you can act as the server and determine which side gets what data. For more details, please check out the Cracking Contest Description.

+

Objectives

+

In order to confirm that Telegram crypto was indeed cracked and claim your $300,000, you‘ll need to send an email to the secret email address that you’ve extracted from one of the messages exchanged by Paul and Nick.

+

Your email must contain:
- The entire text of the message that contained the secret email.
- Session logs for the successful attempt with your user_id.
- A detailed explanation of the attack on the protocol.
- Your bank account details to receive the $300,000 prize.

+

There is also a bonus objective with an independent prize of $100,000.
See full description for details »

+

End Date

+

To prove that the competition was fair, we will add a command that returns the keys used for encryption as soon as a winner is announced. In case there is no winner by February 4, 2015, decryption commands will be added at that date.

+
+
+
+ +

November 4, 2014
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/desktop-1-0.html b/data/telegram.org/blog/desktop-1-0.html new file mode 100644 index 0000000000..1ae7605293 --- /dev/null +++ b/data/telegram.org/blog/desktop-1-0.html @@ -0,0 +1,250 @@ + + + + + Telegram Desktop reaches version 1.0 – and it's BEAUTIFUL + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Telegram Desktop reaches version 1.0 – and it's BEAUTIFUL

+ +
+ +
+ +
+ +
+ +

Telegram was available for desktops and laptops since 2013. Today it finally graduates to version 1.0 with a fabulous new design.

+

Consistent material design, great animations, and support for custom themes make Telegram for Windows, Mac, and Linux the tool for messaging from your Mac or PC.

+

This is what Telegram Desktop 1.0 looks like:

+
+
+ +

Login Screen

+
+
+ +

Your Chats

+
+
+ +

Smooth animations are now everywhere:

+
+ +
+ +

Custom Themes

+

If you're looking for an alternative design, Telegram Desktop also supports customized themes. Anyone can make a theme for Telegram Desktop. This theme, for example, changes green outgoing messages to blue:

+
+ +

Blue theme

+
+ +

And here’s a third-party night mode theme:

+
+ +

Dark theme

+
+ +

What Else Makes Telegram Desktop Cool?

+

The best thing about Telegram Desktop is that it automatically syncs messages from your phone with your computer using Telegram’s encrypted cloud. Just install it and log in to your account! All your messages, documents, photos and videos will be synced for you from the secure cloud.

+

Thanks to Cloud Drafts, you can even start typing on your phone, then continue on your desktop when you reach home or work.

+

Who needs email now? Telegram Desktop is many times faster and handles attachments like a pro. Just share your t.me/username with those who want to reach you.

+

+ +

January 11, 2017
The Telegram Team

+

+ +

P.S. For desktop experiences, we also have Telegram Web and Telegram Mac, but our founder insists that Telegram Desktop is the way to go on all platforms.

+

P.P.S. If you're looking for an easy way to get your emails right in Telegram, check out this Gmail bot. Helps one to stay in touch with those who insist on using antique methods of communication.

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/desktop-compact.html b/data/telegram.org/blog/desktop-compact.html new file mode 100644 index 0000000000..056b5b4214 --- /dev/null +++ b/data/telegram.org/blog/desktop-compact.html @@ -0,0 +1,213 @@ + + + + + Telegram Desktop Adds Compact Mode + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Telegram Desktop Adds Compact Mode

+ +
+ +
+ +

The official Telegram app for Windows, OSX and Linux is now available in compact mode — you can resize the window so that only a single column remains. This makes it easier to use Telegram on smaller desktop or laptop screens.

+
+ + + +
+ +

You can download Telegram Desktop at desktop.telegram.org. As of last week, this app is also available in the Mac AppStore, alongside with our native OSX app.

+

To log in on your computer, simply enter your phone number and get a code delivered via Telegram to your phone. All your messages (except those from Secret Chats) are instantly synced between all your devices, so you can continue right where you left off.

+

+ +

December, 22
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/discover-stickers-and-more.html b/data/telegram.org/blog/discover-stickers-and-more.html new file mode 100644 index 0000000000..f0d9403d60 --- /dev/null +++ b/data/telegram.org/blog/discover-stickers-and-more.html @@ -0,0 +1,246 @@ + + + + + Sticker Search, Multiple Photos, and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Sticker Search, Multiple Photos, and More

+ +
+ +
+ +
+ +
+ +
+

In other news: Telegram has now reached 200 million monthly active users.

+
+

Today we're launching Telegram 4.8 for iOS and Telegram 4.8.5 for Android which make it much easier to discover new stickers. From now on, when you type one emoji, you will see suggestions not just from the sticker sets you've added, but also from other popular sets.

+
+ +

Suggested Stickers

+
+ +

Sticker Search

+

We've added search for sticker sets. Scroll up in the sticker panel to find the new search field that will help you find something quickly – be it a set you've added, or a brand new pack of easter bears.

+
+ +
+ +

Multi-Shot Sending

+

Need a couple of extra selfies to maximize dramatic effect? Dog can't stop doing adorable tricks? Not a problem. Use the new + button when taking a photo to take and send multiple media one after another.

+
+ +

Take & Send Multiple Photos

+
+ +

Auto-Night Mode and Connected Websites

+

Telegram for iOS v.4.8 also includes some of the goodies which Android users have been enjoying since the previous release. With Auto-Night Mode settings you can automatically switch to the dark version of the interface after nightfall or in low-light conditions:

+
+ +

Auto-Night Mode Settings on iOS

+
+ +

As of v.4.8, the iOS app also supports text formatting in media captions, reporting individual messages in public entities, and has a section where you can manage connected websites.

+

Oh, and we've optimized battery usage so that you can enjoy all of the above even longer on a single charge.

+

+ +

March 22, 2018,
The Telegram Team

+

+ +
+

P.S. In case you missed this, Telegram has now reached 200 million active users.

+
+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/drafts.html b/data/telegram.org/blog/drafts.html new file mode 100644 index 0000000000..6d71fa9863 --- /dev/null +++ b/data/telegram.org/blog/drafts.html @@ -0,0 +1,242 @@ + + + + + Drafts, Picture-in-Picture, and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Drafts, Picture-in-Picture, and More

+ +
+ +
+ +

Telegram has replaced email for business communication for many of our users. But in a messenger, a lot of people are competing for your attention. Sometimes they interrupt you halfway through typing an important message, and you forget all about it. Good news! With our latest update, this is no longer a problem.

+

Today we're introducing Drafts. Unfinished messages are now clearly visible in the chats list, and the chat with an unsent draft will move to the top. What's more – all your drafts are now synced across all your devices. Now you can start typing on your phone, then continue on your computer – right where you left off.

+
+ +

Drafts in the chats list

+
+ +

Picture-in-Picture

+

On iOS, YouTube and Vimeo videos get a new button in the bottom right corner. Tap it to shrink the video and continue watching and listening while accomplishing other tasks.

+
+
+ +
+
+ +

You can drag the minimized video around the screen so that it doesn't get in the way. On iPads, videos in PiP mode will follow you around even if you switch to a different app. PiP will become available for all videos in Telegram in one of the next updates.

+

Internal Video Player for Android

+

Android users will enjoy the new built-in video player, available for Android 4.1+.

+
+ +

New built-in video player on Android

+
+ + +

…and more

+

On top of this, Telegram v.3.10 allows you to view the entire set of a group‘s profile pictures instead of just the latest one. The beautiful ’Scroll to bottom' button with an unread messages counter has made it to Android and Telegram Desktop.

+
+ +

New unread messages counters

+ + +

We've improved design across all of our apps. Telegram Desktop now sports nifty blue unread message counters, new buttons, and fully revamped profile pages.

+

+ +

We at Telegram are hard at work expanding the boundaries of what you can do with a messaging app. Stay tuned for more updates coming soon!

+

+ +

June 14, 2016
The Telegram Team +

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/edit.html b/data/telegram.org/blog/edit.html new file mode 100644 index 0000000000..44de1a781c --- /dev/null +++ b/data/telegram.org/blog/edit.html @@ -0,0 +1,245 @@ + + + + + Edit Messages, New Mentions and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Edit Messages, New Mentions and More

+ +
+ +
+ +

Farewell to typos! Starting today, you can edit the text of your messages after sending them. This works across all Telegram chats, including groups and one-on-one conversations.

+
+ +

Edit messages

+
+ +

Simply tap and hold on a message, then press ‘Edit’. If you're on desktop, press the up arrow button to edit your last message. The messages will display a small ‘edited’ label so that it's easy to tell which were altered.

+

New Mentions

+

Mentioning other people in groups is handy since it sends them a notification about your message even if they muted the group. Starting today, you can mention any members in a group – even if they don't have a username. Just type the @ symbol and select whoever you would like to address. Easy!

+
+ +

Mention group members

+
+ +

People List

+

Speaking of addressing people, you can now get to your recent chats much faster using the new People list in Search.

+
+ +

Recent chats

+
+ + +

Bot Attachments

+

We've also made it easier for you to access your favorite inline bots. Simply scroll down the attachment menu – and there they are. The more you use them, the higher they will climb.

+
+ +

Bots in attachment menu

+
+ +

Naturally, you will only see inline bots in the attachment menu if you used them at least once. Try @youtube, @gif or @imdb if you don't know where to start. Check out this post for more info on how to use inline bots.

+

Interface Improvements

+

We‘ve added quick sharing buttons to forwarded messages from bots, channels, and public groups. Notifications about messages with stickers will now show the relevant emoji so that you’ll know the general idea at first glance.

+
+ +

Scroll to bottom

+
+ +

Last but not least, if you're on iOS, your app now remembers the scroll position in chats when switching to a different chat and back. And scrolling up in a chat summons a new button that will send you back to the bottom in one tap. This button also displays a handy unread message counter if new ones are waiting for you there.

+

+ +

And that's it for today. Stay tuned for more updates coming soon!

+

+ +

May 15, 2016
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/encrypted-cdns.html b/data/telegram.org/blog/encrypted-cdns.html new file mode 100644 index 0000000000..c65852293a --- /dev/null +++ b/data/telegram.org/blog/encrypted-cdns.html @@ -0,0 +1,228 @@ + + + + + More Speed and Security! + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

More Speed and Security!

+ +
+ +
+ +
+
+ +

We at Telegram love to build sophisticated technologies that combine speed with security. Starting with Telegram 4.2, we support CDN caching. CDNs are third-party caching nodes that we’ll use to cache publicly available videos and photos posted in massive channels (say, with 100,000+ subscribers) for users in remote locations where Telegram is popular.

+

This will increase download speeds for tens of millions of users as CDN caching allows data to travel shorter distances and helps avoid bottlenecks that exist between regions.

+

While these caching nodes are only used to temporarily store public media (imagine Telegram versions of superpopular YouTube hits), all data that goes through them is encrypted with a key unknown to the caching nodes. In other words, we treat these CDN caching nodes just like we treat your internet provider – they only ever get encrypted junk they can't decipher.

+

Here’s how it works

+
+ +
+ +

If you're interested in the technical details, feel free to check out this page that describes the relevant encryption and security checks. And as always – the updated source code for the Telegram apps is open and available for your scrutiny. Security experts are welcome to verify the implementation of CDNs based on the open source code we make available for all of our apps.

+

Thanks to this technology, the download speed for public photos and videos in places like South America, Turkey, Indonesia, India, Iran or Iraq will significantly increase without the slightest compromise in security.

+

To sum up

+
    +
  • Download speeds for popular public media are set to increase several times for millions of Telegram users.
  • +
  • CDN caching nodes are not Telegram servers and not part of the Telegram cloud.
  • +
  • CDNs are used only for caching popular public media from massive channels. Private data never goes there.
  • +
  • CDNs only get encrypted data and they never have the keys: even if they are accessed by hackers or third parties, the attacker won’t be able to decipher the files.
  • +
  • Data downloaded from CDN caching nodes is always verified by the receiving Telegram app by way of hash: attackers won’t be able to replace any files with their own versions.
  • +
  • Detailed technical info about CDNs can be found here, the updated source code of Telegram apps ready for CDN support can be found here.
  • +
  • Telegram 4.2 also includes a bucketful of other goodies for you to enjoy.
  • +
+

+ +

Stay safe (and fast)!

+

July 23, 2017
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/export-and-more.html b/data/telegram.org/blog/export-and-more.html new file mode 100644 index 0000000000..278ddc235b --- /dev/null +++ b/data/telegram.org/blog/export-and-more.html @@ -0,0 +1,238 @@ + + + + + Chat Export Tool, Better Notifications and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Chat Export Tool, Better Notifications and More

+ +
+ +
+ +
+ +
+ +

Today’s Telegram update brings you an easy way to save conversations on your disk. In just a few taps, you can export some (or all) of your chats, including photos and other media they contain. As a result you’ll get all your data accessible offline in JSON-format or in beautifully formatted HTML.

+
+ +

Data Export Results

+
+ +

To use this feature, make sure you have the latest version of Telegram Desktop installed on your computer, then click Settings > Export Telegram data. This tool will be particularly useful for users who have millions of messages and can’t easily access the oldest parts of their messaging history.

+
+ +
+ +

You can export individual chats by opening the menu in any chat and choosing Export chat history.

+

Exceptions in Notifications

+

Telegram was the first app to give its users notorious flexibility in fine-tuning how their message notifications work. Today we are taking this further by adding Exceptions to the notifications settings, where you can see which chats are excluded from the global settings you defined in Settings > Notifications.

+
+ +

Notifications Exceptions

+
+ +

Muting all chats but a few (or vice versa) has never been easier.

+

Improved Telegram Passport

+

We’ve been overwhelmed by the reception of Telegram Passport – the tool to log into third-party apps that require real-life identity. Just two weeks after its launch, Passport can be used to sign up for many services, from established sharing economy services to blockchain startups.

+
+To name just a few projects that integrated Telegram Passport: Sum & Substance (KYC & user verification), CEX.IO and Xena (cryptocurrency exchanges), CryptoPay (wallet), YouDrive (carsharing), Profi and Worki (job marketplaces), Minter Network and Minexcoin (blockchain startups), KICKICO, Cryptonomos and ICOadmin (ICO platforms).

+ +

Building on this success, today we’re upgrading Passport to support names in original languages and additional types of documents. We’ve also strengthened the algorithms that encrypt Passport data to better protect your data against hacking attacks coming from Telegram (however unlikely those may seem). This way we further ensure that only you have access to your private data.

+

Source Code and APIs

+

As always, you do not have to take our word on how our encryption works. The updated source code of Telegram apps reflecting all of today’s changes is available on GitHub and open for everybody to review. If you are a developer of a service that requires identity verification, make sure you check out these docs explaining how Telegram Passport can be integrated into your app.

+

+ +

August 27, 2018
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/files-on-steroids.html b/data/telegram.org/blog/files-on-steroids.html new file mode 100644 index 0000000000..79e4bd97fb --- /dev/null +++ b/data/telegram.org/blog/files-on-steroids.html @@ -0,0 +1,240 @@ + + + + + Sending Files On Steroids — And More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Sending Files On Steroids — And More

+ +
+ +
+ +

Many of you love Telegram for the ability to send huge files up to 1.5 Gb.

+

Today’s iOS update brings you a radically improved Send File menu. We have integrated cloud services like iCloud, DropBox, Google Drive and others, so you can now easily share your existing documents directly from the Send File menu.

+
+ + + + + + + +
+ +

Share multiple files and trim videos

+

Starting today, you can also share multiple media files at once and see their size and resolution before sending them. As for sharing videos, we added the long-awaited preview and trim functionality to the iOS app.

+

Another improvement that is specific to iOS for now is the ability to open locations in Google Maps and other non-default map applications, as well as get driving directions.

+
+ + + + +
+ +

Hashtags and Android features

+

Hashtags now support non-latin characters on both mobile platforms, and what is more important, recently used hashtags will be instantly suggested when you type the # symbol. This makes them much more usable.

+

As for improvements to the Android app, this update includes the ability to erase search history for Web images, GIFs and hashtags (simply tap and hold on recent items in search), sounds for incoming and outgoing messages in the currently opened chat and a multitude of design and UI improvements.

+

In fact, we were lucky to get feedback from the Google design team that provided ideas on how to improve the UI of our Android app. This release has some of these ideas implemented – for example, if you set a custom background for your Telegram chats, it will also be used in the Menu Drawer.

+
+ + + + + +
+ +

Stay tuned – we are shipping another great update next week.

+

+
+ +

March 25, 2015
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/games.html b/data/telegram.org/blog/games.html new file mode 100644 index 0000000000..44483ee907 --- /dev/null +++ b/data/telegram.org/blog/games.html @@ -0,0 +1,264 @@ + + + + + Gaming Platform 1.0 + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Gaming Platform 1.0

+ +
+ +
+ +

Last year we launched a Bot Platform for Telegram. Free, powerful, and open, it was an instant hit among users and developers. Today we are aiming to push the boundaries further by launching a bot-powered Gaming Platform on Telegram. That’s right: you can now use bots to play games in your chats, complete with graphics and sound.

+
+
+ +
+
+ +

Ready to Play

+

Hundreds of games are headed your way, but about 30 are ready to be played on Telegram now, most of them published by @gamee. You can start a game by interacting with their bot directly, or by invoking it from any of your chats. To do that, try typing “@gamee “ in a group and choose a game to start playing with your friends:

+
+ +

Select a game

+
+ +

If you spot a great game on Telegram, you can challenge your friends from other chats by sharing the game with them.

+
+ +

Challenge your friends

+
+ +

Better with Friends

+

The best part of the Telegram Gaming Platform is the competition across all your existing chats. We save high scores for every game played in every chat, and you can instantly check out how you and your friends are doing against each other. Every time there’s a new leader in the game, other playing members of the chat are notified that they need to step it up.

+
+
+ +

In-game high scores

+
+
+ +

New high score in chat

+
+ +

Easy to Build

+

Building games for Telegram is easy (check out the API). Here’s MathBattle, a game that took our developer only 3 hours to build. You can launch it from any chat by typing @gamebot and choosing Math Battle:

+
+
+ +
+
+ +

This is Corsairs, a demo game that took its dev just 5 hours to build and set up. That includes sound, graphics and animations:

+
+
+ +
+
+ +

While these demos look basic, Telegram games can be anything from simple arcades and puzzles to multiplayer 3D-shooters and real-time strategy games. The underlying technology is HTML5, so games are loaded on-demand as needed, just like ordinary webpages. Games will work on iPhones 4 and newer and on Android 4.4 devices and newer. Note that your friends will need Telegram 3.13 or higher to play.

+

If you are a developer, take a look at our Introduction to Games. Also, feel free to subscribe to our official @BotNews channel to stay up to date on platform news.

+

No Added Calories

+

We know you love Telegram because it’s lean and efficient. This is why the new Gaming Platform requires 0 bytes of disk space and won’t add a single byte to the size of our apps. The only thing we're adding today is countless more fun moments in your chats.

+

+ +

And now let's see how high you can score.

+

+ +

October 3, 2016
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/gif-revolution.html b/data/telegram.org/blog/gif-revolution.html new file mode 100644 index 0000000000..b3f38b2c5c --- /dev/null +++ b/data/telegram.org/blog/gif-revolution.html @@ -0,0 +1,224 @@ + + + + + GIF Revolution + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

GIF Revolution

+ +
+ +
+ +

Good news for GIF-lovers! As of today, you can send and download GIFs up to 20x faster. This is possible because we're now re-encoding all GIFs to mpeg4 videos that require up to 95% less disk space for the same image quality.

+

We've optimized our apps so that they can smoothly play even dozens of GIFs on the screen at the same time. GIFs will now play automatically, so there's no need to launch each one manually anymore. (You can turn this off in Settings when you need a break.)

+

Sending GIFs

+

To make sending your favorite animations easier, we've added a dedicated GIF tab to the sticker panel. Tap on GIFs in chats (long tap on iOS) and ‘Save’ to add them to the panel. Then send them to any chat in one tap.

+
+ +

+
+ +

iOS users can now also send GIFs from the Gallery using the fully redesigned attachment menu.

+
+ +
+
+ +

GIF Bot

+

Last but not least, our new Inline Bots feature offers another innovative way of finding and sharing GIFs. These bots deserve a separate blog post.

+
+

Read on!

+
+

+ +

The Telegram Team,
January 4, 2016

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/gifs.html b/data/telegram.org/blog/gifs.html new file mode 100644 index 0000000000..ddf5cd3df0 --- /dev/null +++ b/data/telegram.org/blog/gifs.html @@ -0,0 +1,223 @@ + + + + + GIF Search and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

GIF Search and More

+ +
+ +
+ +

OK, so there is a celebration in the Android camp today. Telegram for Android was redesigned and loaded with new features. But what about the iPhone fan army? It turns out, the iOS app got something just as great.

+

In addition to granular controls for hiding your Last Seen and other privacy settings, today’s iPhone update introduces a great media feature – Animated GIF search.

+

How Does This Work?

+

You can find and share images from the Web using the “Find Images” attachment option. Today the Web image search got two new tabs – GIFs and Recent. The GIFs tab allows you to search through thousands of great GIF animations, powered by Giphy. Just type in a keyword and have fun.

+

All images from the Web and GIFs you share will be saved in the Recent tab. You can go that tab whenever you're out of words and instantly share any of them just in three quick taps. If you forward an incoming GIF to a contact, that animation will also be available from the Recent tab. And yes, you can send multiple GIFs at once.

+
+
+ +
+
+ + +

One More Thing

+

Another media feature we added to the iPhone app today are previews for YouTube and Instagram links. If a message contains nothing but a link to YouTube or Instagram, it will be transformed into a thumbnail with relevant information, such as title and duration. Check it out!

+

..but I'm on Android

+

All of this is coming to our Android app in the next updates. So for now, sit back and enjoy your new privacy settings and material design. Soon we'll have GIFs and images for you as well!

+

+ +

The Telegram Team
November 19, 2014

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/inline-bots.html b/data/telegram.org/blog/inline-bots.html new file mode 100644 index 0000000000..9131f24aa2 --- /dev/null +++ b/data/telegram.org/blog/inline-bots.html @@ -0,0 +1,234 @@ + + + + + Introducing Inline Bots + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Introducing Inline Bots

+ +
+ +
+ +

Bots became an integral part of Telegram for many users, but communication with them wasn't always easy. You had to send them messages in separate chats or add them to your groups. Today we are introducing a quicker way to contact bots.

+

With the new inline mode, bots become omnipresent and can be used as a tool in any of your chats, groups or channels – it doesn't matter, whether the bot is a member or not. Inline bots can help you with dozens of different tasks, like quickly sending relevant GIFs, pictures from the Web, YouTube videos, Wikipedia articles, etc.

+
+
+ +
+
+ +

How does it work?

+

We've created several sample bots for you to try out: @gif, @vid, @pic, @bing, @wiki, @imdb and @bold. To see them in action, simply type one of their @usernames in the message field in any chat, then type some keywords. The bot will offer you relevant content.

+
+ + +
+
+ + +

Tap on an item to instantly send it to the chat. This way you can share stuff from bots without any hassle. Inline bots don't see any messages in your chats – they only receive what you type after their username in the input field.

+
+ + +
+
+ +

Tap on ‘via @username’ to send a new request to the bot. Recently used inline bots will also show up in the suggestion box when you type @ in the input field in any chat.

+

A new dimension for bots

+

Like pretty much everything else at Telegram, inline bots are part of an open platform, available for free to every developer in the world starting today. Hundreds of new inline bots are sure to arrive once developers start supporting the new mode.

+

If you are a developer, take a look at our Introduction to Inline Bots. Also, feel free to subscribe to our official @BotNews channel to stay up to date on platform news.

+

+ +

The Telegram Team,
January 4, 2016

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/instant-camera.html b/data/telegram.org/blog/instant-camera.html new file mode 100644 index 0000000000..e27a276aec --- /dev/null +++ b/data/telegram.org/blog/instant-camera.html @@ -0,0 +1,229 @@ + + + + + Instant Camera and More 3D Touch + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Instant Camera and More 3D Touch

+ +
+ +
+ +

When taking pictures, even a split second can make the difference between capturing the perfect moment or missing it entirely. Starting today, our iOS users can snap a photo or take a video in no time. To access your camera quickly, simply tap and hold the attachment button, and you're ready to shoot:

+
+
+ +
+
+ +

This quick camera interface defaults to selfie mode with flash on, but you can change this and it will remember your choice.

+

With this update it also becomes easier to record videos using the standard camera interface. Press and hold the big button and the recording starts. By popular demand, videos you record in-app will now be saved to your device in Full HD quality.

+

More 3D Touch and More

+

Starting today you can use 3D Touch to preview photos and videos everywhere, including the attachment menus, message history, and the Shared Media section. The same goes for profile pictures: That's right, you no longer need to go to chat info to check them out in full size.

+
+
+ +

We've also added Uber and Citymapper as options for opening a location:

+
+
+ +

And, speaking of opening stuff, we've fixed the issue with files – you can now open any file you get in other apps again. This is extremely useful, given that you can share and store an unlimited number of documents and files of any type on Telegram.

+

+ +

That's it for today, stay tuned for more updates coming soon! The cool features we are adding in the next release will be available for all platforms.

+

+ + +

April 28, 2016
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/instant-view-contest-200K.html b/data/telegram.org/blog/instant-view-contest-200K.html new file mode 100644 index 0000000000..1a20319ac2 --- /dev/null +++ b/data/telegram.org/blog/instant-view-contest-200K.html @@ -0,0 +1,273 @@ + + + + + Instant Views for Everyone & a $200K Contest + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Instant Views for Everyone & a $200K Contest

+ +
+ +
+ +
+

Version 4.0 is the mother of all Telegram updates. Note that we're also launching Video messages + Telescope and Payments for Bots today.

+
+
+ +
+ +
+

UPD 30.05: We've increased the prize fund of our contest to $315,000 by adding more target domains. Join today!

+
+

Rejoice, brethren and sistren, the day has come! Instant View is now ready to support thousands of websites, including your favorite ones. Soon you will no longer need to launch a web browser to view any article shared with you on Telegram, because today we are launching the Instant View Platform.

+

Instant What?

+

With Instant View, you can enjoy articles from any blog or media outlet in a uniform and easily readable way. Beyond merely showing the text of an article, Instant View pages support images, videos, and any other media. They work great even if the source website isn't optimized for mobile devices.

+
+
+ +

Instant View Button

+
+
+ +

Instant View Page

+
+ +

Instant View pages are lightweight and cached on Telegram servers, so they load instantly on pretty much any connection — hence the name. But the best part is that webmasters don't need to change anything on their sites for Instant Views to work.

+

Meet the Instant View Platform

+
+ +
+ +

To generate Instant View pages, our parser bot uses templates — sets of rules that tell the bot where to find useful content and what to ignore on a particular domain or URL. The bot uses these instructions to create a slim and beautiful Instant View representation of the source page.

+

Today we are launching the Instant View Platform that allows anyone to create their own templates for websites. Like everything else we launch, this platform is completely open. All are welcome to join us in our quest to make the world's information more accessible (in a much more elegant way) to users everywhere!

+
+

Start here, check out our samples, then open the Instant View Editor and you‘re ready to rock. Also, here’s the full reference doc in case you want to know everything.

+
+

$200,000 Competition for Rule Makers

+

To get the ball rolling, we're also launching a $200,000 (now $315,000!) crowdsourcing competition for template makers. If you know a bit of HTML and want to participate, check out the Contest page. The task is easy: choose a website from our list and be the first to come up with the perfect set of rules to parse articles from that site into the Instant View format. Head over to the docs to get started!

+

For each website that you were the first to describe with an accurate set of rules before the end of the contest, you get $100 from our fund. The one who manages to best describe the most contest domains with their templates will be declared the winner and will get $10,000 on top of the payout from their templates. The second place winner gets a $5,000 prize on top of what they made on successful template submissions.

+
+

Winning templates will be used to display Instant View pages to all Telegram users after we approve them.

+
+

Even if you don't know anything about HTML or programming, you can help our brave template-makers by finding and reporting issues with their work. If somebody wins with a bit of your help, you may get a share of the reward.

+

Tips for website owners

+

If you own a website and want your articles to be viewed natively inside Telegram, simply have a developer add a template for your site.

+

If you distribute your content via a Telegram channel, you don't even have to wait for us to approve your template. Simply send specially formatted links to your subscribers and they will get Instant View pages based on your template right away.

+

You can also direct users who view Instant View pages from your site to join your channel on Telegram (more on how to do that):

+
+ +

Join Button

+ +

If any of this seems too complicated, just sit back and relax: crowdsourcing will take care of it for you in due time.

+

One More Thing

+

In version 4.0 we‘ve added some nifty Instant View settings. You can now view your articles in dark, gray, or sepia-toned environments, as well as adjust the font type and size. The Auto-Night Theme setting will soothe your eyes by automatically showing dark pages when it’s late.

+
+ +

Instant View Settings

+
+ +

When you find something noteworthy on an Instant View page, simply long tap on the paragraph to select it for quickly copying or sharing it with your contacts.

+
+ +

Quick Copy / Share

+
+ +

+ +

Good luck making rules, identifying issues, or – if you’re a regular user – happy Instant Viewing!

+
+

P.S. Follow @IVContest to get the latest updates about the contest.

+
+

+ +

May 18, 2017
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/instant-view.html b/data/telegram.org/blog/instant-view.html new file mode 100644 index 0000000000..0cbcff1cdc --- /dev/null +++ b/data/telegram.org/blog/instant-view.html @@ -0,0 +1,268 @@ + + + + + Instant View, Telegraph, and Other Goodies + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Instant View, Telegraph, and Other Goodies

+ +
+ +
+ + +
+ +
+ +
Meet Instant View, an elegant way to view your dog articles with zero pageload time. To try it out, use Telegram version 3.14 to share a link to a Medium post or a TechCrunch article. This will get you an Instant View button that immediately shows a native page, saving you time and data.
+ +
+
+ +

Instant View button

+
+
+ +

Saves time and data

+
+ +

If you have feedback about the way an Instant View page was generated, ping our @previews bot. Only a handful of websites are supported at the moment, but we'll be adding more as we go. Eventually we want to provide Instant View pages for every story on the Web and thus devour the entire Internet (*evil laugh*).

+

Telegraph

+

Today we are launching Telegraph – a publishing tool that lets you create richly formatted posts with photos and all sorts of embedded stuff. Telegraph posts get beautiful Instant View pages on Telegram.

+

To try it, go to telegra.ph, publish a story, and share it on Telegram. With Telegraph, your Telegram channel can run stories just like the mainstream media (although you may find it tricky to become as biased).

+

Jump to Date

+

You can now travel in time to any moment in the past. Just tap Search inside a chat and choose a day using the Calendar tool.

+
+
+ +

Calendar button

+
+
+ +

Pick a day

+
+ +

Unfortunately, this doesn't work with dates from the future. Sorry, no flying cars and hoverboards for you today.

+

View Pack for Recent Stickers

+

Remember all those times when you had a sad Pepe among your recently sent stickers? If you‘re like us, your natural desire would’ve been to reunite the sad Pepe with the rest of his family by scrolling to the Pepe pack in your sticker panel.

+

You can now do that in an instant: try a long tap (or 3D-touch on iOS) on a recent sticker, then choose ‘View Pack’. Hey presto! For some mysterious reason, this also works with non-Pepe stickers.

+
+
+ +
+
+ + + +

Groups in Common

+

Sometimes you want to find a group in your chats, but can‘t recall the title. Here’s a life-hack for you: think about a contact of yours that was also a member in that group. This association technique may help you bring back the title too. If it doesn‘t, open that contact’s profile and tap Groups in Common.

+

Android Strikes Back

+

Some of you Android users told us we loved iPhones more than Androids. That almost made us cry (remember the sad Pepe in our recent stickers?). To make things right with you, we fired our iOS dev, who was too good.

+

Well, not really. We simply locked ourselves in the coding basement for several weeks to bring you this:

+
    +
  • A slick new interface for creating groups and selecting users in privacy settings (shiny animations included).
  • +
  • A new beautiful interface for notification settings.
  • +
  • Improved security for passcode locks (your chats won't be seen in the task switcher now). This one also works on iOS.
  • +
  • Improved camera speed when taking photos and videos.
  • +
  • Better video compression.
  • +
  • An improved and less obstructive photo viewer.
  • +
  • Easier editing of messages and adding captions to photos.
  • +
+

And that's just getting us warmed up. Make Android Great Again!

+

Also

+

Something big is brewing in our secret dungeons. Stay tuned.

+

+ +

November 22, 2016
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/invite-links.html b/data/telegram.org/blog/invite-links.html new file mode 100644 index 0000000000..107babc934 --- /dev/null +++ b/data/telegram.org/blog/invite-links.html @@ -0,0 +1,217 @@ + + + + + Migrating Existing Group Chats to Telegram + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Migrating Existing Group Chats to Telegram

+ +
+ +
+ +

In addition to numerous great features in today's update, we’re happy to introduce a new way to move your existing group chats to Telegram — invite links for admins.

+

Each passing month brings more reasons to switch to Telegram from older services. Persistent history, instant full-text search, open platform, unlimited file sharing, rich link previews, native desktop apps, replies, mentions, hashtags and much more.

+

And yet, if you‘ve ever tried moving your existing group chats from other apps to Telegram, you know it was not easy. There was simply too much work to do and too much friction — you had to collect everyone’s usernames or phone numbers and add them to your group one by one. We're glad to announce that these days are over.

+

Invite Links

+

With invite links for groups, all you have to do is send a link to your existing group chat in any messaging service that your friends might still be using. As soon as they get Telegram, they can instantly join your Telegram group just by following that link.

+

Where do you get the link? Once you've created a group on Telegram, head to the "Add participant…” section and tap “Invite to Group via Link”. Easy!

+
+ + + +
+
+ +


+ +

The Telegram Team,
April 30, 2015

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/link-preview.html b/data/telegram.org/blog/link-preview.html new file mode 100644 index 0000000000..ddbdc88e6f --- /dev/null +++ b/data/telegram.org/blog/link-preview.html @@ -0,0 +1,217 @@ + + + + + Link Previews + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Link Previews

+ +
+ +
+ +

In addition to new security features, today‘s update brings you rich link summaries. All links to tweets, Instagram photos and YouTube videos will now be beautifully rendered so that you’ll see what the link is all about before opening it.

+

Once you paste a URL to the message input field, Telegram will start analyzing the link and getting a preview for it. If you prefer to send a particular message without the preview, just tap the x to remove it.

+
+ + + + + +

+ +
+ +

Rich link previews are now shown for most websites.

+

+ +

April 8, 2015
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/live-locations.html b/data/telegram.org/blog/live-locations.html new file mode 100644 index 0000000000..0999cf9083 --- /dev/null +++ b/data/telegram.org/blog/live-locations.html @@ -0,0 +1,243 @@ + + + + + Live Locations, Media Player and Languages + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Live Locations, Media Player and Languages

+ +
+ +
+ +
+ +
+ +

Starting with Telegram 4.4, you can broadcast your current location to any chat in real time.

+

This is useful when you are on your way to an appointment or are trying to coordinate with friends at a large event. Instead of sending static locations on the map every minute, you can now share your Live Location with the people you’re meeting – for 15 minutes, 1 hour, or 8 hours.

+

To use this feature, select ‘Location’ from the attachment menu and choose ‘Share My Location for…’:

+
+
+ +
+
+ +

You can also share your Live Location in groups, and if other members of the group do the same, you’ll get an interactive map of everyone’s current coordinates. Thanks to a bar at the top of the screen, you will always remember who you’re sharing your location with. And you only need two taps to stop sharing whenever you choose to.

+

New Media Player

+

We’ve completely redesigned our in-app audio player to better support the playback of MP3s and other music files you send and receive. Try the @cctracks channel for a demo – we’ve uploaded some free music there to demonstrate how the new media player works. After downloading an audio file, tap the play button to start listening. To view the cover image and the rest of the chat's playlist, tap on the title of the playing track in the top bar.

+
+
+ +
+
+ + +

More Languages

+

We’re also launching a new translation platform for Telegram apps. Starting today, Telegram is available in French, Indonesian, Malay, Russian and Ukrainian – with more languages like Persian coming soon. Telegram now supports 13 languages, which are available in Settings.

+

If you don’t like how a specific element in Telegram's interface is translated in your language, you can now use the localization platform to suggest an alternative word or phrase. Everyone can suggest translations and vote for them, making Telegram localization a community-driven effort.

+
+ +

Screenshots make translations easier

+
+ +

Unlike other services, Telegram can instantly push new translations of words and phrases to the apps. Thanks to this, users won't need to wait for an update in the stores to get the new localized version.

+

This also means that our developers won't have to wait for all translations to be finished before the apps are released, so this new interface will speed up Telegram development too.

+

Better Group Chats

+

As always, we’re trying to make Telegram group chats better. In large groups, you can now recognize messages from admins by the new ‘admin’ badge. And Admins in supergroups can now control whether new members get to see the earlier message history.

+

+ +

October 10, 2017
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/login.html b/data/telegram.org/blog/login.html new file mode 100644 index 0000000000..72f63409f0 --- /dev/null +++ b/data/telegram.org/blog/login.html @@ -0,0 +1,257 @@ + + + + + Telegram Login for Websites + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Telegram Login for Websites

+ +
+

This post is from Feb 2018. For up-to date information on integrating services with Telegram please see this post. For Telegram Widgets, see this page.

+
+
+ +
+ +
+ +
+ +

Today we present a Telegram Login Widget for external websites. When you use Telegram login for the first time, our widget asks for your phone number and sends you a confirmation message via Telegram to authorize your browser.

+
+

Once this is done, you get a two-click login on every website that supports signing in with Telegram. Try it here:

+

Once this is done, you get a two-click login on every website that supports signing in with Telegram:

+
+
+ + +
+ +

+ +

Logging in will send your Telegram name, username, and your profile picture to the website owner. Your phone number remains hidden. The website can also request permission to send you messages from their bot.

+

Permission to speak

+

Telegram bots are a powerful communication tool, but until today they couldn't start a conversation. Even if you wanted them to reach out to you, you had to chat them up first.

+

With the new login widget, moving from interacting with a website to a conversation on Telegram becomes completely frictionless.

+
+ +

Message from a bot

+
+ +

The potential use cases are limitless. Bots could be used for providing customer support, accepting payments, or sending notifications of any kind – including account statements, shipment tracking, flight updates, and so much more.

+

Stay in control

+

After each login, Telegram will send you a summary message about the permissions you‘ve granted and the data you’ve passed to the website owner. You can revoke the authorization by tapping the appropriate button under the login summary.

+

Telegram for Android 4.8, also released today, includes a section in the Privacy & Security settings that lists all the websites where you logged in using Telegram. Other apps will soon follow.

+

+ +

This simple login tool is the first phase of the Telegram ID project, which we will be rolling out throughout this year.

+ +

+ +

February 6, 2018,
The Telegram Team

+

P.S.

+

Don‘t miss the other updates we’ve launched in the last few days:

+ +
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/masks.html b/data/telegram.org/blog/masks.html new file mode 100644 index 0000000000..e3d409d269 --- /dev/null +++ b/data/telegram.org/blog/masks.html @@ -0,0 +1,248 @@ + + + + + Photo Editor 2.0, Masks and Homemade GIFs + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Photo Editor 2.0, Masks and Homemade GIFs

+ +
+ +
+ +

Last year we introduced the most powerful photo editing tool ever to be implemented in a messaging app. This allowed you to instantly improve photos before sending them on iOS and Android.

+

Today we’re pushing the photo editor to the next level with the fun stuff: you can now add drawings, masks, stickers and text right onto your pictures.

+
+
+ +
+
+ +

This is easy: just choose a mask, and it will be automatically positioned in the right place. Telegram identifies faces on photos and uses mask meta-data to find the perfect spot.

+

Our artists created hundreds of beautiful and fun masks as examples, but everything we do here in Telegram is an open platform. So as of today, anyone can use the /newmasks command for the @stickers bot to upload their own masks.

+
+
+ +

Masks Button (top right)

+
+
+ +

Adding Masks

+
+ +

When opening a photo, you will see a list of mask sets that were used on it. This way popular custom masks will quickly become viral.

+

GIFs Democratized

+

Another thing that’s likely to spread virally now are your GIF-animations. Creating your own GIFs has never been easier: simply record a video in Telegram and tap the new “mute” button to share it as a looped autoplayed GIF.

+
+
+ +
+
+ +

The animation will be saved to your GIFs section so that you can quickly react to anything with a set of your own prerecorded GIF-emotions.

+

Trending stickers

+

The last addition to this entertainment-heavy update is the trending stickers tab. Whenever you’re feeling hungry for new stickers you can find the latest additions in the stickers panel in any of your chats.

+
+ +

In-chat Trending Stickers

+
+ +

+ +

We're back from the summer break, so watch out for more updates coming your way soon.

+

+ +

September 23, 2016
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/moar-stickers.html b/data/telegram.org/blog/moar-stickers.html new file mode 100644 index 0000000000..555343d5fd --- /dev/null +++ b/data/telegram.org/blog/moar-stickers.html @@ -0,0 +1,343 @@ + + + + + MOAR Stickers! + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

MOAR Stickers!

+ +
+ +
+ +

Two months ago we launched a new kind of stickers, bringing popular memes, art and history together as an enhanced way of expressing emotions. Over the last few days we've added 15 new stickers to the original set.

+

Start a message with an emoji from this list to see emotionally corresponding stickers:

+
+ + +
+
Napoléon Bonaparte:
"In France, only the impossible is admired" +
+
+ +
+
+ + +
+
Jimi Hendrix accepts the challenge +
+
+ +
+
+ + +
+
Dante's "What the HELL?!" +
+
+ +
+
+ + +
+
LOL Marley +
+
+ + +
+
+ + +
+
Screamin' Jay Hawkins:
"Don't put that spell on me!" + +
+
+ +
+
+ + +
+
Audrey is on the verge of tears +
+
+ +
+
+ + +
+
Malcolm X: "Mother of..." +
+
+ +
+
+ +
+
Virginia Woolf: "Go on..." +
+
+ +
+
+ + +
+
Poe is sceptical +
+
+ +
+
+ +
+
Coco Chanel is unmoved +
+
+ +
+
+ + +
+
Frederick Douglass is in a dark mood +
+
+ +
+
+ + +
+
Princess Diana blushing +
+
+ + +
+
+ + +
+
Julius Caesar approves +
+
+ +
+
+ + +
+
On second thought... No. +
+
+ +
+
+ + +
+
Kisses from Cleopatra +
+
+ +
+

Remember that it's easy to send your own stickers in Telegram. Simply send a .webp image with a transparency layer as a file in your chat, and it will become a sticker.

+

+ +

March 11, 2015
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/now-you-see-me.html b/data/telegram.org/blog/now-you-see-me.html new file mode 100644 index 0000000000..03739756c8 --- /dev/null +++ b/data/telegram.org/blog/now-you-see-me.html @@ -0,0 +1,235 @@ + + + + + Disappearing Media, Your Bio & More Speed + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Disappearing Media, Your Bio & More Speed

+ +
+ +
+ +
+ +
+ +

Telegram 4.2 is here! We have completely redesigned our photo editing tools, and it takes you even fewer taps to make your photos look amazing. In addition, you can now set a self-destruct timer for any photos and videos you share in private chats.

+
+ +
+ +

If you set a timer, the countdown starts the moment your recipient opens the photo or video you sent. After the time runs out, the photo/video will disappear forever, just like in Secret Chats.

+

If the recipient tries to make a screenshot of your disappearing media, you’ll get a notification immediately.

+

Who are you again?

+

Starting today, you can add a bio to your profile by typing a few words about yourself in Settings. Every time you stumble upon new users in large groups you might want to learn more about them. That's where bios can help.

+
+ +

Bio in your profile

+
+ +

More Speed and Security

+

On top of this, as of 4.2, Telegram apps will rely on a CDN (distributed network) to cache publicly available photos and videos posted in massive channels (100,000+ members). This will result in significantly higher download speeds for tens of millions of Telegram users around the world. Check out this post to learn more about how we managed to do it in a slick and secure way.

+

One More Thing

+

Stickers are now easier to use as you can enlarge the scrolling area. More legroom for your emotions!

+
+
+ +
+

+
+ +

July 23, 2017
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/passport.html b/data/telegram.org/blog/passport.html new file mode 100644 index 0000000000..f8e09835a2 --- /dev/null +++ b/data/telegram.org/blog/passport.html @@ -0,0 +1,233 @@ + + + + + Introducing Telegram Passport + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Introducing Telegram Passport

+ +
+ +
+ +
+ +
+ +

Our digital lives are getting closer and closer to the real world, and the number of services that need to know your real-life ID increases accordingly. Before today, this meant you had to upload the same document scans over and over for each new app. No more!

+

Meet Telegram Passport – a unified authorization method for services that require personal identification. Upload your documents once, then instantly share your data with services that require real-world ID (finance, ICOs, etc.).

+
+ +
+ +

Protected by End-to-End Encryption

+

Your identity documents and personal data will be stored in the Telegram cloud using End-to-End Encryption. It is encrypted with a password that only you know, so Telegram has no access to the data you store in your Telegram passport. When you share data, it goes directly to the recipient.

+
+ +

Sharing Data with an App

+
+ +

In the future, all Telegram Passport data will move to a decentralized cloud.

+

Try It Now

+

If you'd like to see a real-life implementation of Telegram Passport, head over to ePayments.com – the first electronic payments system to support registration and verification with Telegram Passport.

+

You can also try out how Telegram Passport works using this page to request data.

+

Please note that you need the latest version of Telegram to access this feature. Once you've uploaded some documents, you will see your data in Settings > Privacy & Security > Telegram Passport (on iOS: Settings > Telegram Passport).

+

Connect Telegram Passport

+

All developers are welcome to integrate Telegram Passport into their apps and services free of charge. It takes minimum effort and can save many hours of coding.

+

If you are building a service that requires real-life ID, check out the API docs for SDKs and examples.

+

Stay Tuned

+

In the future, we will be adding third-party verification for Telegram Passports. This way, services won't even need to request the data itself, instead relying on the fact that the Telegram account was approved by a verification provider and the person is real.

+

+ +

July 26, 2018
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/payments.html b/data/telegram.org/blog/payments.html new file mode 100644 index 0000000000..ff44bbe4da --- /dev/null +++ b/data/telegram.org/blog/payments.html @@ -0,0 +1,253 @@ + + + + + Payments for Bots + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Payments for Bots

+ +
+ +
+ +
+

UPD 2021: For up-to-date information about Payments on Telegram, see Payments 2.0 and the Payments Documentation.

+
+
+ +
+ +

Imagine a world where you can order pizza, pay for a pair of shoes, hire a cab, or refill your subway pass — all in a few button taps on Telegram.

+

To make this world possible, we are launching Bot Payments today. Bot developers can now accept payments from their users around the world, just like that:

+
+
+ +
+
+
+ +

If you have Telegram 4.0 (or newer) installed, you can order goods or services from bots that offer them. These bots may now add a Pay button to their messages. When you tap Pay, you'll be asked to fill in your credit card and shipping information and confirm the payment. Then you get what you paid for. Voila!

+

If your account is protected by 2-Step Verification, you can save your card for future purchases. If you do that, ordering stuff from bots will only take two taps. Bot Payments also support Apple Pay for a completely frictionless experience.

+

Check It Out Now

+

Try our demo @ShopBot to get a taste of what's coming. (Note: Our demo bot thinks it sells time machines, but they're not a part of what's coming. Sadly.) If you're looking to test a real payment with actual money, stop by our @TelegramDonate bot.

+

Telegram is an open platform, so bot developers can implement the necessary APIs and accept payments from users starting right now, without lengthy approval dramas. If you’re a bot developer, check out the docs immediately!

+

Behind the Scenes

+
+ +
+ +

At launch, most of the payments were handled by Stripe, but Telegram Bot Payments are a platform for payment providers all over the world. When accepting a payment from a user, the bot developer can choose between all available payment providers, selecting the one already used by the buyer or the one with the lowest commission.

+
+

UPD, 14.06.2017: Bot developers can now process payments from more than 200 countries via the global payment provider Paymentwall.

+

UPD, 02.06.2017: Yandex.Money and Payme are now also available as payment providers.

+

UPD, 01.09.2017: Rave by Flutterwave is now available, which is especially helpful for developers in Nigeria, Kenya, Ghana, South Africa, and Uganda.

+
+

This is just the beginning. In the next few days, payments will become available to developers in India via Razorpay, in Russia Qiwi will be joining the club a little later.

+

Follow our @BotNews channel to be the first to know about new providers joining.

+

If you’re a payment provider (especially in a developing country), click here to learn how to get on board.

+

Just Passing Through

+

Telegram acts as a messenger (pun intended) between the paying user, the bot developer, and their chosen payment system. The user sends their credit card details directly to the payment system. Then the payment system's response and the shipping details entered by the user are passed to the bot developer so that they can process the order.

+

Due to this structure, it is impossible for Telegram to handle complaints or cashbacks – any disputed payments are the responsibility of the bot developers, payment providers, and banks that participated in the exchange.

+

Since Telegram doesn't process the payments, we don't store and can't access any sensitive data. We also don't take any commission from payments and don't profit from these transactions.

+

Instead, we just do what every sheriff has to do with strangers passing through their turf: shoot the bad bots and award the good ones with a badge. We’re sure there’ll be plenty of good ones.

+

If You Are…

+ +

And if you're none of the above for some weird reason, be a user, do the right thing. Happy shopping, everyone!

+

+ +

May 18, 2017
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/permissions-groups-undo.html b/data/telegram.org/blog/permissions-groups-undo.html new file mode 100644 index 0000000000..431d142ff8 --- /dev/null +++ b/data/telegram.org/blog/permissions-groups-undo.html @@ -0,0 +1,265 @@ + + + + + Group Permissions, Undo Delete and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Group Permissions, Undo Delete and More

+ +
+ +
+ +
+ Introducing Telegram 5.2: New permissions for groups, unified group settings, undo deleting chats and more +
+ +

Ever wanted to run a sticker-free or GIF-free community? With group permissions, admins can now restrict all members from posting specific kinds of content. Or even restrict members from sending messages altogether – let the admins chat amongst themselves while everybody else witnesses their wisdom in silent awe.

+
+ +
+ +

In case you ever felt lonely in a group with 100,000 members, Telegram groups now support up to 200,000 members – so now you can feel twice as lonely 🙃. To make managing groups more enjoyable, we've streamlined all group interfaces, including the Settings screens, Admin panels and Member lists.

+
+ New group, redesigned empty screen +

A newly created group

+
+ +

As of today, supergroups and basic groups are simply groups. It now takes just a few taps to make any group public, add admins with granular privileges or toggle persistent history.

+

Have fun bossing around groups the size of the city of Kassel!

+

Undo clearing history and deleting chats

+

Deleting the wrong chat is rarely fun – but now you'll have a chance to reconsider.

+

When you delete a chat or clear chat history, you'll get a detailed confirmation dialog and an option to restore the chat within the next 5 seconds. Once the time is up, the chat is irretrievably lost in the jaws of Telegram’s underground data shredders.

+
+ +
+ +

If you relied on “I accidentally deleted the chat with my homework” in your studies, please accept our apologies. From now on, you'll have to blame your digital dog.

+

Sort your contacts

+

Back to the topic of bossing people around, you can now sort your contacts by name and by last seen time on both iOS and Android.

+
+
+ Sorting contacts on iOS +

iOS

+
+
+ Sorting contacts on Android +

Android

+
+ +

Thumbnails and download animations

+

Waiting for large media downloads to finish ranks very low on the list of “The Most Exciting Things to Do Online”. We decided to spice this process up a bit by improving our animation algorithms and adding an ultra-light thumbnail to each photo and video:

+
+ +
+ +

From now on, every photo you receive will start its life as an obscure blur instead of an empty square. Isn’t this just beautiful?

+

Search bars, dark mode and moar profile pics

+

Search bars on Telegram for iOS and the default dark mode theme on Android got some face-lifting. The Android app also allows you to set up a profile picture when you create an account, so expect to see more friends with faces from now on.

+

Meanwhile on Desktop…

+

The new group permissions also work in Telegram Desktop. Additionally, version 1.5.8 introduces support for automatically downloading files and music and choosing input and output devices for Telegram Calls.

+

Last but not least, you can now change your visuals before heading into an emoji fight:

+
+ Choose your emoji on Telegram Desktop +

Choose how you see emoji on Telegram Desktop

+
+ +

Another glorious Telegram update is coming in a week or two, so STAY TUNED!

+

+ +

January 21, 2019,
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/photo-editor-and-passcodes.html b/data/telegram.org/blog/photo-editor-and-passcodes.html new file mode 100644 index 0000000000..3fabe85491 --- /dev/null +++ b/data/telegram.org/blog/photo-editor-and-passcodes.html @@ -0,0 +1,252 @@ + + + + + Photo Editor and Passcode Lock + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Photo Editor and Passcode Lock

+ +
+ +
+ +

Today’s update to our iOS and Android apps reflects the essence of Telegram — a combination of easy-to-use privacy tools and popular mass market features.

+

Photo Editor

+

Each day Telegram users share 35 million photos, and this number is growing by the hour. For comparison, Instagram users shared 70 million photos daily in December. Yet up until now, messaging app users couldn’t enjoy a photo editing experience on the level that is offered by photo-sharing apps. We’re changing this today.

+
+
+ +
+
+ + +

With the new photo editor, you can crop, rotate and auto-enhance photos before sending them. On top of that, you can use Photoshop-class granular controls for brightness, contrast, warmth, saturation, highlights, sharpening, blurring and more.

+

The auto-enhance tool is our favorite though — it can improve photos in an instant.

+
+ + + + +
+
+ +

Passcode Lock

+

Telegram is one of the few messaging apps that can be used on multiple devices at once. While this is definitely convenient, it also raises the bar when it comes to privacy. What if one of your Telegram devices, e.g. an iPad or another tablet, is sometimes used by your colleagues or family members?

+

In order to give you more control in such cases, we are introducing passcodes. Starting today, you can lock your iOS or Android device with a passcode – a simple 4-digit PIN or a longer password. The iOS app, and soon the Android app as well, can use passwords to encrypt the local database against such extreme cases as phone theft.

+
+ + + + + + + + +

+
+ +Without entering this passcode, no one will be able to access your Telegram messages. When Telegram is locked, notifications about new messages will not include texts or sender names, so private data stays hidden from prying eyes. + +
+

+ +


+
+ +

Since unlocking Telegram each time can get annoying, we implemented both manual and auto-lock. You can lock the app manually from the chats screen or enable auto-lock after a specified period of inactivity. iOS users can use Touch ID to unlock the app.

+

+
+ +

February 25, 2015
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/pin-and-ifttt.html b/data/telegram.org/blog/pin-and-ifttt.html new file mode 100644 index 0000000000..243f330710 --- /dev/null +++ b/data/telegram.org/blog/pin-and-ifttt.html @@ -0,0 +1,263 @@ + + + + + Pinned Chats and IFTTT Integrations + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Pinned Chats and IFTTT Integrations

+ +
+ +
+ +
+ +
+ +

If you’re like us, you probably have dozens of active chats on Telegram. But none of them matter when you miss a new message from your Mom. Or Spouse. Or Mad Boss. Today we’re launching Telegram 3.15, which allows you to pin important conversations to the top of your inbox.

+

This feature is also valuable for teams that coordinate their work over Telegram. Pinned chats offer an easy way of keeping work-related chats reachable in a predictable order whenever you open Telegram.

+
+
+ +
+
+ +

To pin a chat, long tap on it (swipe left on iOS) and select Pin. Easy! You can pin up to 5 chats to the top (plus 5 secret chats).

+

IFTTT (If This Then That)

+

Starting today, you can link your Telegram account with more than 360 other services by setting up “If This Then That” integrations (or “Applets”). This works with anything from social networks like Twitter and Instagram, to productivity tools like Gmail or Pocket, entertainment apps like Spotify or Pinterest, cloud services like Dropbox or Google Drive, and Internet of Things devices like Nest, LIFX, or Philips Hue.

+

Telegram is the first messaging app to be fully integrated with IFTTT. Unlike most services, we allow two-way interactions: You can control other services via Telegram, or receive notifications and content like photos and videos when they do something.

+

You can also invite the @IFTTT bot to any of your groups so members can collaboratively interact with your services or devices.

+
+
+ +
+
+
+
+
+
+ + +

To get started, talk to the @IFTTT bot, then enable some Applets or create your own. Since the IFTTT platform supports over 360 services, endless combinations are possible. Here are just a few examples:

+ +
+

Check out the IFTTT website for a full list of existing Telegram Applets and don’t hesitate to create your own.

+
+

Making Android Great Again, Part 2

+

Remember our promise to Make Android Great Again? We were serious. In Telegram 3.15 for Android, we bring you three great features: High-precision rotation and cropping in the photo editor, a new player for Youtube videos with Picture-In-Picture mode, and forwarding messages and media to secret chats.

+

1. At long last, you can make that horizon look horizontal. Rotate your photos by any small number of degrees in the updated photo editor.

+
+ +

Rotate and Crop

+
+ + +

2. Want to continue chatting while watching a YouTube video? Tap the Picture-In-Picture icon in the new sleek video player for YouTube/Vimeo links. The video will shrink, and you can drag it around the screen so that it doesn't get in the way. The new video player also toggles fullscreen mode when you rotate your phone accordingly.

+
+ +

Picture-In-Picture

+
+ +

3. Secret Chats are the most secure way to share data on Planet Earth, and it is only natural they don’t let you forward stuff from them. However, they don’t restrict you from importing texts and media into them. With Telegram 3.15 for Android, you can forward messages and media from Cloud Chats and Channels to Secret Chats.

+

We know many of you got a bit addicted to Telegram updates, and keep asking us for more. We're happy to oblige. Stay tuned for more updates coming this December!

+


+ +

December 7, 2016
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/pinned-messages-locations-playlists/world.html b/data/telegram.org/blog/pinned-messages-locations-playlists/world.html new file mode 100644 index 0000000000..9a56b1437e --- /dev/null +++ b/data/telegram.org/blog/pinned-messages-locations-playlists/world.html @@ -0,0 +1,278 @@ + + + + + Pinned Messages 2.0, Improved Live Locations, Playlists and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Pinned Messages 2.0, Improved Live Locations, Playlists and More

+ +
+
+
+ +
+ +
+ +

Starting today you can pin several messages in every chat, get notified when friends get near if they are sharing their Live Location, send music as Playlists, and more.

+

Multiple Pinned Messages

+

Each chat now supports multiple pinned messages. To jump between them, simply tap the top bar several times – or use the new button to see all pinned messages on a separate page.

+
+ +
+ +

In addition to channels and groups, pinned messages now work in one-on-one chats.

+

Improved Live Locations

+

When friends share their live location, you can set up an alert that will notify you when they're close. Icons on the live location map also show which direction people are facing.

+
+ +
+ +

Playlists

+

When you send multiple songs at once, they'll be arranged together in a playlist – easier to play, forward, or comment on. Opening one of the songs will queue them all up in Telegram's built-in media player.

+
+ Playlist sent to a chat +
+ +

Sending multiple files together also displays them in one chat bubble. Just like with photo albums, you can always select each file or track individually.

+

Channel Post Stats

+

Comments have boosted subscriber activity in channels, and now we're introducing new tools for admins to track it. In addition to channel statistics, you can view stats for individual posts in your channel – including a list of public channels to which your post was forwarded.

+
+ Channel post stats page +
+ + +

New Animations on Android

+

Our Android developers added new animations for sending messages and switching songs in the music player.

+
+ +
+ +

Also on Android: when viewing a photo you’ve received, you can edit and send it back right away, instead of downloading and uploading it again. Just tap the brush button when viewing a photo to quickly draw or put stickers on it.

+

Jackpot

+

Send 🎰 to any chat to see if you hit the jackpot.

+
+ +
+ +

In case you missed it, this also works for 🎲, 🏀, ⚽️ and 🎯.

+

And More Animated Emoji

+

We've animated some new emoji for Halloween. To get one of these 👇 in a chat, simply send a message with a single emoji. When viewing animated emoji in chats, try tapping on ⚰️ or 🎃 for a surprise.

+
+ +
+ +

If you are not a fan of Halloween, we've got another new animated emoji for you:

+
+ +
+ +

How to Get This Update

+

The new version with these features is already available for all our Android users via Google Play or APK. If you're on iOS, you'll get the update as soon as either a) Apple finishes reviewing it OR b) you decide it's time to switch to Android. 👀 UPD: (October, 31) The iOS part of the update has now also been approved.

+

And that's it for today, stay tuned for the next update!

+

+ +

October 30, 2020
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + + diff --git a/data/telegram.org/blog/polls.html b/data/telegram.org/blog/polls.html new file mode 100644 index 0000000000..7990b383ae --- /dev/null +++ b/data/telegram.org/blog/polls.html @@ -0,0 +1,230 @@ + + + + + Polls: Bringing Choice to Communities + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Polls: Bringing Choice to Communities

+ +
+ +
+ +
+ +
+ +

Large communities on Telegram frequently use polls to coordinate their activities and stay in touch with their members. Today, we're rolling out a dedicated tool for polls in addition to existing bots like @vote. We hope the new built-in polls will be a welcome addition to groups with 100,000 members and channels with millions of subscribers.

+
+ +
+ +

Polls can be forwarded to increase reach and pinned for better visibility (and also to notify all members of the community).

+

At the moment, polls are anonymous, meaning that no one can see who voted for what. Going forward, we may introduce non-anonymous polls where the voters lists will be public, but such polls will be explicitly marked as non-anonymous.

+
+

Telegram has your back when it comes to privacy: we never disclose the private data you entrusted us with to third parties and never monetize it.

+
+
+

Image Search and Other Improvements on iOS

+

Back to more mundane matters, you can use Web Search again to find images when sending Photo & Video attachments or choosing profile pictures in our iOS app. Setting a Grinch avatar for Christmas has never been easier:

+
+ +
+ +

The Great iOS Bug Hunt goes on and the app received numerous fixes in version 5.1.1.

+

To name a few improvements: Clearing the cache in Settings > Data and Storage > Storage Usage now correctly reduces the space taken by the app. Files and media will keep downloading for a while after you close the app. You will see detailed progress when downloading and uploading files. We've also added online indicators for the ‘People’ section in search results.

+

Happy Winter Solstice!

+

+ +

December 22, 2018
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/privacy-discussions-web-bots.html b/data/telegram.org/blog/privacy-discussions-web-bots.html new file mode 100644 index 0000000000..21f058a86a --- /dev/null +++ b/data/telegram.org/blog/privacy-discussions-web-bots.html @@ -0,0 +1,284 @@ + + + + + Focused Privacy, Discussion Groups, Seamless Web Bots and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Focused Privacy, Discussion Groups, Seamless Web Bots and More

+ +
+ +
+ +
+ +
+ +

Telegram is about privacy. In 2014 we pioneered granular privacy settings in messaging. Today we are making them even more flexible with exceptions for group chats.

+

From now on, you can make something visible for all your classmates in one group chat and keep it private from, say, all your colleagues in another – with just two taps:

+
+ +
+ +

Settings will adjust automatically as people join and leave the groups. So when your half-brother unexpectedly gets a job as a data broker, you'll just need to kick him out of one group to update all your settings.

+

Who can see my phone number?

+

On Telegram, you can send messages in private chats and groups without making your phone number visible. But there may be cases when you want to make your number known (e.g. to all your coworkers), so we added a new dedicated privacy control – Who Can See My Number.

+
+ A screenshot of the redesigned Privacy & Security settings screen +

Redesigned privacy settings on iOS

+
+ + +

Meet Seamless Web Bots

+

We've made it easier to integrate bots with web services. Bots can now help you log in with your Telegram account on a website when you open a link. If you allow them to, you'll be logged in by the time the page loads in the browser:

+
+ A confirmation dialog that offers to open a link and optionally authorize on the website +
+ +

While this is purely optional, it opens the door for a vast variety of new bots. To try out this seamless authorization, press the ‘comments’ button under this post.

+

You can also make our sample @discussbot an admin in any of your broadcast channels to get a comments button under the posts you publish. The comments button opens a website where you are already logged in and ready to leave a comment. The bot will notify you if someone replies to what you wrote there.

+

Anyone can create similar bots to connect their existing services to Telegram on the fly. Integrating all kinds of social, gaming, productivity, dating or e-commerce services into your channels is now a breeze.

+

Broadcasts meet Group Chats

+

Telegram channels are a tool for broadcasting your thoughts to unlimited audiences. Telegram group chats offer a democratic way for communities of up to 200,000 members to discuss things.

+

Ever since we launched channels and groups, users have been asking us to add discussions to channels and announcements to groups. With this update, admins can add a group chat to their channel to serve as a discussion board:

+
+ +
+ +

Subscribers will see a ‘Discuss’ link on the bottom panel, and each new post from the channel will be automatically forwarded to and pinned in the discussion group.

+
+ +
+ +

View public channels

+

Speaking of channels, you can now view any public channel from the web – even if you aren‘t logged in to Telegram. The same also goes for those retro people who don’t have a Telegram account at all. Yet.

+
+ A public channel, as seen from the web +
+ +

Simply open the channel link in a browser and select “Preview channel” to see something like this: t.me/s/telegram

+

Scam Alerts

+

Telegram apps will now show a scam label for suspicious accounts.

+
+ Chat with a scammer +
+ +

iOS Goodies

+

In other news, Telegram 5.7 for iOS introduces thumbnails for PDF files. Keep in mind that Telegram lets you share files of any type, up to 1,5GB each in size (so you can telegram a PDF payload worthy of Elon's rockets).

+
+ PDF file with a thumbnail +
+ +

Telegram for iOS also catches up with the rest of our apps in terms of text links. You can now make any text a link to a website, keeping all the cords under the carpet.

+
+ Creating a text link on iOS +
+ +

Mind that people will get a warning about where exactly the link leads when they open it. (Hint: use URL shorteners if you want to rick-roll people).

+

Android Delights

+

As for Android, we've redesigned the majority of confirmation dialogs in the app, and improved the design for message search and adding people to groups. Additionally, the app got a new theme switcher in Chat Settings.

+
+ +
+ +

Have fun with all that and stay tuned for our next updates.

+

+ +

May 31, 2019
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/privacy-revolution.html b/data/telegram.org/blog/privacy-revolution.html new file mode 100644 index 0000000000..87b257a04c --- /dev/null +++ b/data/telegram.org/blog/privacy-revolution.html @@ -0,0 +1,226 @@ + + + + + Hiding Last Seen Time - Done Right + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Hiding Last Seen Time - Done Right

+ +
+ +
+ +

Each day our volunteer-driven support team gets several thousand requests from our users to help them hide their Last Seen time. We knew it's important, and have been working hard to get this feature right. We wanted to make sure that Telegram users would have unprecedented precision and flexibility, without the usual tradeoffs.

+

Starting today, you can specify exactly who will see your Last Seen time in both our iOS and Android apps. You can choose between the three basic options (“Everybody”, “My Contacts” and “Nobody”) and add any number of exceptions into the “Always Share With…” and “Never Share With…” sections.

+
+

For example, this way you can make your Last Seen time available to everybody but your boss, or to nobody with the exception of your marriage partner (or vice versa, it's up to you). If you’d like to share your Last seen time only with your contacts plus the members of some work-related group you have, you can do it in just a few taps. This makes countless combinations possible.

+
+

Why Is This Important?

+

To make things fair, you won’t see Last Seen timestamps for people with whom you don‘t share your own. That’s why it‘s important to have granular controls — Telegram’s precision helps you avoid difficult choices. For example, you don't need to choose between hiding your Last Seen from your boss and being able to know when your best friend was online. You can have both.

+
+ + +
+
+ +

Last Seen Recently

+

Of course, the absence of a Last Seen timestamp makes it difficult to know whether the person you're about to contact is a regular user of Telegram and will be able to read your message. That is why even if the exact Last Seen time is hidden, you will still see an approximate value, like “last seen recently” (i.e. from one minute ago to about 3 days) or “last seen within a month”. This keeps stalkers away, but makes it possible to understand whether a person is reachable over Telegram.

+

Speaking of inactive users, we're not going to have too many of them soon. Starting today, Telegram accounts will self-destruct after 6 months of inactivity by default.

+

Self-Destructing Accounts

+

Big companies like to accumulate data about their users and keep it for an indefinite time. Telegram is not a commercial organization and we value our disk space greatly. Last year we introduced self-destructing messages, today we are adding self-destructing accounts.

+

From now on, if you stop using Telegram and do not login for at least 6 months, your account will be deleted along with all messages, media, contacts and every other piece of data you store in the Telegram cloud. You can change the exact period after which your inactive account will self-destruct – with options ranging from 1 month to 1 year.

+


+ +

These new features are already available in our iOS and Android apps. Stay tuned for more privacy-related updates.

+
+ +

The Telegram Team,
November 19, 2014

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/replies-mentions-hashtags.html b/data/telegram.org/blog/replies-mentions-hashtags.html new file mode 100644 index 0000000000..ec05acc24d --- /dev/null +++ b/data/telegram.org/blog/replies-mentions-hashtags.html @@ -0,0 +1,238 @@ + + + + + Reinventing Group Chats: Replies, Mentions, Hashtags and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Reinventing Group Chats: Replies, Mentions, Hashtags and More

+ +
+ +
+ +

Group chats have not evolved much since they first appeared in messaging apps many years ago. Today's new features bring group chat communication much closer to what it should look like in 2015. iOS, Android, OSX and Telegram Web get them first.

+

Replies

+

To reply to a specific message in a group chat, simply tap on it (double-tap on iOS) and choose Reply. Easy as that!

+
+ + + + + +

+ +

The person you replied to will be notified about your message even if s/he muted the group chat — their notification settings for you personally apply in this case.

+

Replies also make group chats much easier to navigate. If you tap on the quote, the app scrolls up to the original message.

+

Mentions

+

If you want several people within a group chat to get instantly involved in the conversation, you may now also mention them in a message, provided they have a username:

+
+ + +

+
+ +

They will be notified about this message, even if they muted the group chat — unless they've muted you personally, of course!

+

Hashtags

+

Another new way of bringing structure to group chats is by using hashtags. Any word starting with a “#” will be clickable. Tap on a hashtag to get instant search results from your Telegram messages.

+
+ + +
+
+ +

Forwarding with comments

+

On top of this, you can now add a comment to the stuff you forward. This comment will be shown before the forwarded messages.

+
+

Group chats are becoming larger and livelier — a Telegram group may include up to 200 members that share thousands of messages daily. We hope that these new tools will help you bring order and clarity to the chaos of a thriving group chat.

+

+ +

March 19, 2015
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/replies-mentions-stickers.html b/data/telegram.org/blog/replies-mentions-stickers.html new file mode 100644 index 0000000000..3a367739ca --- /dev/null +++ b/data/telegram.org/blog/replies-mentions-stickers.html @@ -0,0 +1,257 @@ + + + + + Better Replies, Stickers & Invitations + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Better Replies, Stickers & Invitations

+ +
+ +
+ +
+ +
+ + +

Since 2015 when we first introduced replies, the maximum group size on Telegram has increased by 100 times – from 200 max members to 20,000. These days you can get new mentions or replies in group chats many times during a day – and it’s important not to miss those messages.

+

Starting with Telegram 4.3, whenever somebody replies to you or mentions you in a group, you’ll notice this straight away by the ‘@’ badge in the chats list:

+
+
+ +
+
+ + +

If you have new replies/mentions in a group, you can now instantly reach them by tapping the new ‘@’ button when inside the chat. This button will disappear once you’ve read all the relevant messages.

+

Favorite Stickers

+

Anyone can create and upload stickers on Telegram. As a result, thousands of new stickers are added to the platform each day, and some of us have dozens of sticker sets installed.

+

Starting today, anyone with five or more sticker sets installed can mark individual stickers as ‘favorites’, and have them always accessible at the top of the sticker panel in the ‘star’ section.

+
+
+ +
+
+ +

Stickers of the Group

+

Speaking of stickers, large groups with 100 members and more can now choose an official sticker set for all the members of the group to see and use while they're chatting in the group — without the need of adding it to their panels.

+
+ +

Group Stickers

+
+ +

Invite Friends

+

The ‘Invite Friends’ section (accessible from Contacts) has been completely redesigned. Your contacts that are not on Telegram yet but have many of their friends already using it are now listed at the top. If you invite any of them to join, they’ll be welcomed by tens of Telegram veterans among their contacts:

+
+ +

Invite Friends to Telegram

+
+ +

…And More

+

As always with new releases, we've included several small goodies you may also like:

+
    +
  • Twitch videos are now supported in the Telegram in-app player, so you can watch Twitch streams in Picture-in-Picture mode while chatting with your friends.
  • +
  • When on a Telegram voice call, you can now check the signal strength thanks to the new indicator.
  • +
  • On iOS, you can edit any photo you pasted directly to a chat from clipboard before sending.
  • +
  • On Android, when forwarding a message, you can long tap to select multiple recipients.
  • +
  • On Android, when viewing photos in Shared Media, you can go to the place in chat where the photo was posted.
  • +
  • On Android, if you have many new messages in many active chats, synchronization will happen much, much faster.
  • +
+

+ +

Summer is over. Stay tuned, another update is already brewing in our dungeons!

+

September 3, 2017
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/search-and-media.html b/data/telegram.org/blog/search-and-media.html new file mode 100644 index 0000000000..e6762f37db --- /dev/null +++ b/data/telegram.org/blog/search-and-media.html @@ -0,0 +1,232 @@ + + + + + In-App Media Playback and Search in Chats + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

In-App Media Playback and Search in Chats

+ +
+ +
+ +

The new version of Telegram allows you to play media from services like YouTube, Vimeo or SoundCloud directly from Telegram – without having to leave the app. Just tap on the preview of a link to an external media to view the video or listen to the audio file (speaking of audio files, they are now beautifully rendered and played in chats).

+
+ + + + + +

+ +
+ +

The new attachment menu in Android is not only gorgeous and beautifully animated; it also allows you to share contacts, audios and recent photos way easier:

+
+ +
+
+ +

All of your communications in Telegram are already instantly searchable with the multi-purpose search field, but now you can also search for messages in specific chats. Just tap on the name of the chat in iOS or toggle the Actions menu in Android:

+
+ + + + + +

+
+ +

You will see the number of occurrences of the keyword in the chat and will be able to navigate through them with the up/down arrows. Enjoy!

+

+ +

The Telegram Team,
July 17, 2015

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/sessions-and-2-step-verification.html b/data/telegram.org/blog/sessions-and-2-step-verification.html new file mode 100644 index 0000000000..f4d2fb2f14 --- /dev/null +++ b/data/telegram.org/blog/sessions-and-2-step-verification.html @@ -0,0 +1,220 @@ + + + + + Active Sessions and Two-Step Verification + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Active Sessions and Two-Step Verification

+ +
+ +
+ +

We know you love Telegram for its seamless multi-device sync. And since there are native Telegram apps for all major mobile, tablet and desktop OSs, a lot of you folks must be logged into your Telegram accounts from several devices at once.

+

Today's Telegram update, in addition to rich link summaries, adds Active Sessions to your Privacy and Security settings. This screen shows all your logged in devices with IP info. You can also close any sessions that are outdated or (God forbid!) suspicious.

+
+ +
+
+ +

Two-Step Verification

+

Another addition to the Privacy and Security section is Two Step Verification. It allows you to set up a password that will be required every time you log into your account from a new device – in addition to the code you get in the SMS.

+

Be careful though: if you forget this password, you won't be able to access your messages from other devices. We recommend setting up a recovery e-mail or at least a hint for your password, if you decide to turn on Two Step Verification.

+
+ +

+
+ +

Stay safe!

+

+ +

April 8, 2015
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/share-preview.html b/data/telegram.org/blog/share-preview.html new file mode 100644 index 0000000000..92294dafe0 --- /dev/null +++ b/data/telegram.org/blog/share-preview.html @@ -0,0 +1,269 @@ + + + + + Sharing and Previews + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Sharing and Previews

+ +
+ +
+ +

In addition to a major update to our Bot Platform, we're making several design and interface improvements to our apps today. This post mostly shows iOS screenshots, but be sure to check out the massive Android redesign we did in this version.

+

A fresh new look at sharing

+

Starting today, our iOS users can easily share photos and videos to other Telegram chats with a comment, or send them to other apps.

+
+
+ +

New sharing menu

+
+
+ +

Open in other apps

+
+ +

New video player

+

We've also added a new slick in-app media player so that you can watch videos from YouTube and other services in style. It will also take you fewer taps to start watching.

+
+ +

New in-app video player

+
+ +

Preview sticker packs and stickers

+

Adding new sticker packs has become easier. Tapping on any sticker in a chat will now instantly open the relevant sticker pack. You can preview and send stickers right from this menu. Now you won't have to teach your grandparents how to add stickers.

+
+
+ +

View sticker pack

+
+
+ +

Preview sticker

+
+ + +

Preview GIFs and bot content

+

On iOS, ‘Tap and hold to preview’ also works with GIFs in the GIF panel. Pull up for additional actions.

+
+
+ +
+
+ +

The same is true for content from inline bots. Tap and hold to preview results suggested by inline bots before sending. Try it now with @gif, @sticker or @coub.

+

Don't worry, this is coming soon to Android too! Speaking of which…

+

New design

+

The Android app received a major tuneup in the design department. We've redesigned the chat screen, optimized the colors, reimagined buttons and message bubbles, created beautiful progress bars, fully revamped documents and other attachments.

+
+
+ +
+
+ +
+
+ +
+
+ +

We've also improved the design of our iOS app, adding juicy progress bars and a new look for documents. Telegram Desktop has also received multiple design improvements and now fully supports the new bots.

+

+ +
+

Yes, don‘t forget that in addition to the above we’re introducing the biggest update to our bot platform since June 2015 today. Read more about Bots 2.0 »

+
+

+ +

April 12, 2016
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/shared-files.html b/data/telegram.org/blog/shared-files.html new file mode 100644 index 0000000000..23776f10ff --- /dev/null +++ b/data/telegram.org/blog/shared-files.html @@ -0,0 +1,231 @@ + + + + + Shared Files and Fast Mute + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Shared Files and Fast Mute

+ +
+ +
+ +

A huge advantage of Telegram over any other tool is sharing large documents. Since Telegram's launch in 2013, you can send files up to 1.5 GB and access them from any of your devices, including computers. Perfect for everything from studying to sharing personal archives.

+

For this iOS and Android update, we have fully rewritten the Shared Media section. From now on, you can use the ‘Files’ overview to see all documents that were shared in a chat. It is also possible to search for specific files using the instant search.

+
+
+ + + +

+
+ +

Any document you receive in Telegram can be forwarded to email or other apps – just open the file and tap on the Share button. In addition, Android users will find a ‘Share’ option in the file‘s context menu (tap on ’…' next to the file inside a chat).

+

Bonus for iOS users: Telegram is now supported in the iOS8 sharing menu – you can open it while you're viewing any document on your iOS device.

+

Mute Notifications

+

You can now temporarily mute notifications from particular contacts and groups for 1 hour, 8 hours or 2 days. On Android, open the ‘…’ menu in a chat and choose ‘Mute notifications’. On iOS, go to group or contact info and tap on Notifications. iOS8 users can now also use interactive notifications to mute a contact or group for 8 hours.

+
+
+ + + +

+
+ +

Multisearch

+

Instead of looking for the right search box, just type your query in the new universal search field and get instant results — contacts, chats, groups, usernames or messages.

+
+
+

+
+ +

February 1, 2015
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/shared-links.html b/data/telegram.org/blog/shared-links.html new file mode 100644 index 0000000000..62757b16f7 --- /dev/null +++ b/data/telegram.org/blog/shared-links.html @@ -0,0 +1,221 @@ + + + + + Shared Links and Recent Searches + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Shared Links and Recent Searches

+ +
+ +
+ +

Have you ever tried to find a link somebody shared in a busy chat? It’s not always easy. Of course, you could use message search, but now it's even easier – simply go to the new Shared Links section in Shared Media. Voila!

+
+ + +

+
+ +

You will see the text of the message that accompanied the link, or the rich preview data in case the link was sent by itself. This feature is currently available for iOS and Android, but will make its way to our other apps soon.

+

Recent Search Results

+

By the way, as of the previous update on both iOS and Android, tapping the universal search field now gives you quick access to recent search results.

+
+ + +

+
+ +

We‘re ramping up for massive updates this Fall. Stay tuned!

+

+ +

The Telegram Team,
August 20, 2015

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/stickers-meet-art-and-history.html b/data/telegram.org/blog/stickers-meet-art-and-history.html new file mode 100644 index 0000000000..01b6263b23 --- /dev/null +++ b/data/telegram.org/blog/stickers-meet-art-and-history.html @@ -0,0 +1,338 @@ + + + + + When Stickers Meet Art And History + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

When Stickers Meet Art And History

+ +
+ +
+ +

Today Telegram launched a new kind of stickers – a free emotion-based platform for artists. We mentioned several technological and architectural points that make Telegram stickers a completely new experience – open, free and limitless. But there’s another way in which they are unique, and it also has a lot to do with our values.

+

When designing our first set of stickers, we didn’t want to use just any cartoon characters to express emotions. Instead we decided to portray people we respect most. These are great artists, poets, actors, scientists and leaders.

+

We'd like to give them credit for their contributions to human civilization, and we hope that millions of Telegram users share our respect for these outstanding individuals.
Don't forget to check out Part 2: MOAR stickers!

+
+
+ +
+
Abraham Lincoln approves
+
+ +
+
+ +
+ + +
+
Salvador Dali unlocks achievement
+
+ +
+
+ +
+ + +
+
Albert Einstein explains
+
+ +
+
+ +
+ + +
+
Mahatma Gandhi likes where this is going
+
+ +
+
+ +
+ + +
+
Charlie Chaplin had a bad day
+
+ +
+
+ +
+ + +
+
Steve Jobs laughs out loud
+
+ +
+
+ +
+ + +
+
Kafka is not happy. He never is...
+
+ +
+
+ +
+ + +
+
John Lennon, but...
+
+ +
+
+ +
+ + +
+
Richard Wagner's told you
+
+ +
+
+ +
+ + +
+
Nikola Tesla is unimpressed
+
+ +
+
+ +
+ + +
+
One doesn't simply send a Tolkien sticker
+
+ +
+
+ +
+ + +
+
Mark Twain, huh?
+
+ +
+
+ +
+ +
+
That Freudian scowl...
+
+ +
+
+ +
+ + +
+
And the famous Monroe kiss
+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/stickers-revolution.html b/data/telegram.org/blog/stickers-revolution.html new file mode 100644 index 0000000000..78df9f4e6f --- /dev/null +++ b/data/telegram.org/blog/stickers-revolution.html @@ -0,0 +1,231 @@ + + + + + Custom Sticker Sets + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Custom Sticker Sets

+ +
+ +
+ +
+

Check out Pavel's Channel for some cool sticker sets »

+
+

Starting today, artists can submit their custom sticker sets via the Telegram @stickers bot. Each sticker set gets a permanent link, so that users can easily add new stickers and share them with friends.

+

This enables artists of the world to unleash their creativity and help Telegram users customize their experience. Our in-house artist (responsible for the graphic art in this blog) created the Animals set as an example. If you have Telegram installed and updated, this link will open the set: https://telegram.me/addstickers/Animals.

+
+ +

+
+ +

Independent designers already began submitting their sticker sets, and we notice stickers like Flags of the World or Vicky uploaded to the @stickers bot.

+

Sharing Stickers

+

Sending a link isn‘t the only way to share a sticker set. When you receive a sticker from a set you do not currently have installed, simply tap on it and choose ’Add to Stickers‘ (’Info' on iOS) to preview and add the whole set.

+
+ + +

+
+ +

Once you've added a set, its stickers become available via emoji tooltips or the dedicated sticker panel. The iOS app now has one too — you can manually switch it on/off in Chat Settings — Stickers.

+

The new Stickers menu allows you to view, uninstall and share your sticker sets.

+
+ +

+
+ +

This update is available for Android and iOS and is coming to other apps soon. Sticker sets on Telegram are now fully equipped to spread virally and devour the world.

+

+ +

The Telegram Team,
May 19, 2015

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/stickers.html b/data/telegram.org/blog/stickers.html new file mode 100644 index 0000000000..cd5d517c2a --- /dev/null +++ b/data/telegram.org/blog/stickers.html @@ -0,0 +1,225 @@ + + + + + Stickers Done Right + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Stickers Done Right

+ +
+ +
+ +
+

This January 2015 post has some outdated info.
Check out our custom sticker sets announcement instead.

+
+

At Telegram, we try to reinvent the ordinary tools. The concept of stickers is not an exception. We've always felt that stickers in messaging apps sucked, because they typically provided a limited and paid experience in a walled-garden environment.

+

Today's update to Telegram for Android, iOS, Windows Phone and Desktops introduces a new kind of stickers – a free platform for artists and users willing to share emotions, built using an efficient and open technology.

+
+ + + + + +
+ +

Telegram stickers are grouped around emotions, not characters. They do not clutter the interface, but are shown only when they are relevant – you will see a list of emotionally corresponding stickers whenever you start a message with an emoji. All our stickers are and will be completely free, and you can always create and share your own stickers.

+

You can find the initial 14 stickers in this post.
And dozens more will soon follow.

+

Sharing your own stickers

+

To share stickers of your own, just save your sticker in WebP format with a transparency layer and send it to your friend as a document in Telegram (e.g. via Telegram Desktop). It will be shown as a sticker. Thanks to the WebP file format, Stickers on Telegram are displayed 5x faster compared to the other formats usually used in messaging apps.

+

Creating new stickers

+

Telegram is focused on people who like to create content. If you want your sticker to be seen by all Telegram users in the context menu corresponding to one of the emojis, you are welcome to submit it via a chat with our Stickers bot – telegram.me/stickers.

+

Freelancers can also sell us their work – we normally pay $100 for the exclusive use of a 512x512px sticker. Note that we accept only high-quality stickers that meet our criteria. Please study the stickers that we have designed in-house for the launch.

+
+
+ +

January 2, 2015
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/supergroups.html b/data/telegram.org/blog/supergroups.html new file mode 100644 index 0000000000..99d6f61137 --- /dev/null +++ b/data/telegram.org/blog/supergroups.html @@ -0,0 +1,251 @@ + + + + + Admins, Supergroups and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Admins, Supergroups and More

+ +
+ +
+ +

Telegram groups are democratic by design. Everyone can invite new members and change the group‘s name and photo, which is ideal for small bands of friends or coworkers. But Telegram can also support much larger communities that need more administration. To make life easier in big groups, we’re introducing admins today.

+

From now on, you can choose how your groups will operate. By default, all members are still in control. But if you want more order, you can throw the switch and appoint additional administrators to your group.

+
+ +

+
+ +

If you enable the new restricted mode, only administrators will be able to add new people and change the name and photo of the group. Admins also have the power to remove other members from the group.

+

Supergroups

+
+

UPD: Check out Supergroups 2.0: Pinned posts, Public groups, new moderation tools!

+
+

Telegram groups have always been several steps ahead of the competition. You could have groups of up to 200 people communicating efficiently using replies, mentions and hashtags. Now it's time to go further.

+

Ever since our launch in 2013, our users have been telling us they would like to migrate even larger communities to Telegram. As of today, once your group is full, you can upgrade it to a supergroup that supports up to 5000 members.

+
+ +

+
+ +

Supergroups are optimized to host large online communities and will load quickly, even if you‘ve missed many messages while away. Here’s what you need to know about how they work:

+
    +
  • New members can see the entire message history when they join.
  • +
  • Deleted messages will disappear for all members.
  • +
  • Ordinary members can only delete their own messages.
  • +
  • Supergroups are muted by default and send fewer joined/left notifications.
  • +
+

All official Telegram clients are getting this update today.

+
+

Please note that you need the latest version of Telegram to access a supergroup. You may want to wait a little bit before upgrading your groups so that the update rolls out to all Telegram users, and they can see their groups.

+
+

iOS Bonus: Best In-App Notifications Ever

+

iOS users will enjoy our new in-app notifications. Pull down on a notification to expand it, view the full text of the message or preview attached media.

+
+ +

+
+ +

You can immediately send a quick reply or a sticker — all without leaving that particular spot in some other conversation.

+

Android Bonus: Quick Share for Channels

+

Meanwhile, Android users can enjoy the new quick sharing menu in channels. Just tap on the forwarding buttons right next to channel messages.

+
+ +
+
+ +
+

We have a few more surprises up our sleeve for this year. Stay tuned for more updates!

+

+ +

The Telegram Team,
November 25, 2015

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/supergroups5k.html b/data/telegram.org/blog/supergroups5k.html new file mode 100644 index 0000000000..05b9c9b747 --- /dev/null +++ b/data/telegram.org/blog/supergroups5k.html @@ -0,0 +1,232 @@ + + + + + Supergroups 5000: Public Groups, Pinned Posts + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Supergroups 5000: Public Groups, Pinned Posts

+ +
+ +
+ +

Telegram is famous for its awesome group chats. Today’s update makes them even more awesome. To begin with, we’re increasing the number of people who can join a supergroup from 1000 to 5000 members. That's 5 times as good.

+

Supergroup admins can now inform all members about important news using pinned messages. Pinned messages are displayed at the top of the chat screen. All members will get a notification — even if they muted ordinary messages from the group.

+
+ +

A pinned message

+
+ +

Starting today, supergroups can become public and get a short link, like telegram.me/publictestgroup. This way, anybody can view the group's entire chat history and join to post messages.

+
+ +

A public group

+
+ +

We know what you’re thinking. What about spammers? To prevent potential spam issues, we're introducing powerful moderation tools for group admins. From now on, they can quickly delete all messages from a specific member, block and report them.

+
+ +

New tools for admins

+
+ +

These features work only in supergroups, but starting today, any group can be converted to a supergroup by its creator. Group admins are now shown in group members’ lists, so ping your group admin if you think this would be cool.

+
+

Good old groups still work great for smaller communities, so there's no need to convert your group right away.

+
+

And that's it for today, watch out for more updates coming soon!

+

+ +

March 13, 2016
The Telegram Team

+

+ +

P.S. Please note that we’ll be rolling out public groups gradually. They’re already live in Europe and America, but are currently not available in several countries in Asia, from which we detected significant spam activity in the past.

+

We’ll be making the feature available in more countries as we improve our anti-spam algorithms and scale our abuse team.

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/tdlib.html b/data/telegram.org/blog/tdlib.html new file mode 100644 index 0000000000..5f94d83590 --- /dev/null +++ b/data/telegram.org/blog/tdlib.html @@ -0,0 +1,228 @@ + + + + + TDLib – Build Your Own Telegram + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

TDLib – Build Your Own Telegram

+ +
+ +
+ +
+ +
+ +

Telegram offers developers more than just the Bot API. Since day one, we've also had a free and open Telegram API that allows anyone to create their own messaging apps operating in the Telegram cloud. These apps openly compete with the official ones and some of them have now reached more than 10 million downloads on Google Play.

+

Users of these alternative clients can communicate with anyone on Telegram, but the apps often offer experimental, highly specialized or locally flavored features. Today we are introducing a new tool for third-party developers that will make it even easier to build fast, secure and feature-rich Telegram apps on our platform.

+

Introducing TDLib

+

Meet TDLib – the Telegram Database Library. TDLib takes care of all network implementation details, encryption and local data storage, so that developers can dedicate more time to design, responsive interfaces and beautiful animations.

+
Universally useful
+

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 compatible with any programming language that can execute C functions; it also has native bindings to Java and C#.

+
Open and well-documented
+

All TDLib API methods and public interfaces are fully documented. The code is, of course, completely open and available on GitHub.

+
Secure and reliable
+

TDLib will remain stable on slow and unreliable Internet connections and guarantees that all updates will be delivered in the correct order. All local data is encrypted using a user-provided encryption key.

+
Optimized for performance
+

The library is fully asynchronous and optimized for high performance. We use TDLib in the Telegram Bot API, where each TDLib instance handles more than 18,000 active bots simultaneously.

+
Battle-tested
+

Our new Android X client is an example of what can be done with TDLib. Using TDLib, it took the developer of the app approximately one year to reproduce all the major features of Telegram for Android – and add plenty of his own.

+

+ +

Let's see what else TDLib will help bring to the Telegram ecosystem this year.

+

January 31, 2018,
The Telegram Team

+

+ +
+

P.S. Today, we're also introducing Telegram X for Android, a new official app.
Check out the announcement here »

+
+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/telegram-5-ios.html b/data/telegram.org/blog/telegram-5-ios.html new file mode 100644 index 0000000000..2e8cd008fa --- /dev/null +++ b/data/telegram.org/blog/telegram-5-ios.html @@ -0,0 +1,268 @@ + + + + + Introducing Telegram 5.0 for iOS + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Introducing Telegram 5.0 for iOS

+ +
+ +
+ +
+ +
+ +

For the last couple of years we've been quietly rebuilding Telegram for iOS from scratch with Swift – a programming language released by Apple as a faster alternative to Objective C.

+

Today Telegram 5.0 goes live for all our iOS users, becoming the most popular messaging app written fully in Swift. This new version of Telegram looks just like the old one, but is slicker, more battery-friendly and faster (which is surprising, given how fast the old one already was).

+
+ +
+ +

The new app is superior in many ways. We love the new smooth animations in chats. Messages will now sync quickly, even if you haven‘t opened Telegram for a long time and there’s a LOT to sync. We‘ve also improved the app’s activity in the background to ensure that all of your unmuted chats are always up to date.

+

Step aside — and back

+

The new expandable in-app notifications will help you focus on whatever you‘re doing in the app without having to ignore incoming messages. When a notification arrives, pull it down to open the relevant chat. When you’re done with the interruption, simply close it to get right back to what you were doing.

+
+ +

Expanded Notification

+
+ +

This works everywhere in the app, including when you are viewing media or reading Instant View articles.

+

Make every chat count

+

Previously, badge counters could become less useful after you've joined a group or two with 100,000 members. Today we're making private chats great again.

+

You can now switch the unread counter to display the number of unmuted chats with unread messages. So instead of 1001 for a thousand messages in a muted group and one very important message from your dog, your badge counter will look like this:

+
+ +

One Unread Chat

+
+ +

You can adjust this behavior in Settings > Notifications and Sounds.

+

When was that again?

+

We've improved navigation in busy chats (and elsewhere). Scroll up a little to see the date when the messages you are viewing were sent. Tap this date to go to the first message of the day in question.

+

The bugs are dead. Long live the bugs!

+

As much as we would‘ve liked to, we couldn’t port over any of the bugs from the Objective C version. All the old bugs are now gone forever — or, should we say, fixed. We might‘ve added some brand new bugs while coding the new version. But don’t worry, we'll fix those in no time. The same goes for any small features that may be missing.

+

Meanwhile on macOS…

+

You can now use swipe gestures to navigate the interfaces on Telegram for macOS. Most notably, you can swipe to reply and the chats list now works the same way it does on iOS: swipe right to Mark as Read/Unread, and left to Pin, Mute or Delete.

+
+ +

Swipe Left or Right for Options

+
+ +

Fancy MacBook Pro owners just got advanced Touch Bar support to help them send stickers and media, control buttons in alerts and pop-up windows and more.

+
+ +

Stickers and more on MacBook Pro

+
+ +

Other new features include auto-night mode settings and a photo editor to rotate and crop pictures before sending. You can also drag and drop photos, media, and documents to change the order in which they will be sent.

+

…And Telegram Desktop

+

As for our universal Telegram Desktop app, it just got a massive overhaul in the Settings department. The new layout is similar to what you're used to in our mobile apps:

+
+ +

Telegram Desktop Settings

+
+ +

The latest Telegram Desktop also features improved caching for images and GIFs, as well as new local storage settings. Go to Settings > Advanced > Local Storage to control how much disk space Telegram uses on your machine.

+

We've also redesigned the theme selector to make it easier to choose a day and night theme that suits you best. Remember, you can make your own themes – or check out some themes created by other users.

+
+ +

Pick Your Colors

+
+ + +

And that's it for today. Stay tuned for more updates on all our platforms.

+

+ +

October 1, 2018
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/telegram-me-change-number-and-pfs.html b/data/telegram.org/blog/telegram-me-change-number-and-pfs.html new file mode 100644 index 0000000000..51585d8483 --- /dev/null +++ b/data/telegram.org/blog/telegram-me-change-number-and-pfs.html @@ -0,0 +1,228 @@ + + + + + Telegram.me, Changing Numbers and PFS + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Telegram.me, Changing Numbers and PFS

+ +
+ +
+ +
+

Our iOS and Android apps got updated with three new features today.

+
+

Opening a telegram.me/YourUsernameHere link on your phone will now automatically fire up your Telegram app and open a chat with that user. You can share username links with friends, write them on business cards or put them up on your website.

+
+ +
+ +
Here's what people will see if they don't have Telegram yet
+ +

Changing Your Phone Number

+

It is easy to switch to Telegram and retain your social graph, since it is based on phone numbers. But what if you need to change the phone number itself? As of today, you can change your number in Telegram — and keep everything, including all your contacts, messages and media from the Telegram cloud, as well as all your secret chats.

+
+ + + +
+
+ +

Your mutual contacts (people in your contacts, who also have your number) will get your new number added to your contact in their address book unless you have blocked them in Telegram. This makes changing numbers even easier.

+

Perfect Forward Secrecy

+

Last but not least, Telegram's Secret Chats now support Perfect Forward Secrecy. What this means is that your Secret Chats will now automatically change encryption keys after a period of time, in order to keep past communications safe. This way you no longer need to manually re-create Secret Chats to achieve this level of security.

+

+ +

And that's it for today. Stay tuned for more updates coming your way on all platforms!

+
+

December 1, 2014
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/telegram-x.html b/data/telegram.org/blog/telegram-x.html new file mode 100644 index 0000000000..0030dd1950 --- /dev/null +++ b/data/telegram.org/blog/telegram-x.html @@ -0,0 +1,262 @@ + + + + + Telegram X: Progress through Competition + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Telegram X: Progress through Competition

+ +
+ +
+ +
+ +
+ +
+

UPD: As of October 2018, Telegram X for iOS has replaced the older Objective-C based client. If you're looking for the best iOS experience, switch to the main Telegram app.

+
+

Our mission is to make Telegram faster, slicker and easier to use with each passing month. Competition is the soul of progress, so at first we got plenty of inspiration from other messengers that spurred us on. But as years passed, we saw less and less innovation coming from competitors, who now seem content merely to adapt Telegram features to their platforms with an average lag of two years.

+

In this environment, we started relying on internal competition to feed our flames. This is why for the last two years we've been developing a new generation of Telegram clients in parallel with the main versions.

+

The Telegram X project features apps written from scratch, with an entirely new code base and without all the legacy components that our older apps have accumulated through the years.

+

Telegram X

+

The goal of Telegram X is to reinvent Telegram and explore new frontiers in speed, ease of use, quality of animations and all other aspects. Today we are glad to present two new official apps – Telegram X for Android and iOS.

+

Both these apps are experimental and may or may not eventually replace the existing official apps. But even if they don't, they will speed up the development of Telegram by allowing us to quickly test new approaches and technologies.

+

X for Android

+

Telegram X for Android was born in the furnaces of a contest for Android developers that our founder launched two years ago. The winner then used the power of TDLib to create a stunning app with a special focus on smooth animations.

+

X for Android is faster and more battery-efficient than the original app and features a sleek new design:

+
+ +
+ +

Telegram X also supports a clean bubble-free mode for chats, where messages and photos get more breathing space – and photos in channels assume the full width of the screen:

+
+ +

Bubble-free Photo in a Channel

+
+ +

In Telegram X, you can tap and hold on any chat to preview its content without opening. This works everywhere, including in the forwarding and sharing menus, as well as in the Calls tab and ‘Groups in Common’.

+

The app also offers an abundance of useful swiping actions. For example, you can switch between ‘Chats’ and ‘Calls’ by swiping left and right on the main screen. You can also swipe right on any message to instantly open the forwarding menu:

+
+ +

Swipe right to share

+
+ +

The app includes a reimagined music player and attachment menu, as well as optimized profile pages with quick access to shared media. You can easily switch between different types of shared media by swiping.

+
+ +

New profile page with shared media

+
+ +

This is by no means an exhaustive list of features, Telegram X for Android is full of little surprises in every corner.

+

The app is now ready to begin its experimental journey with new features scheduled to appear as early as next week.

+

X for iOS

+
+

UPD: As of October 2018, Telegram X for iOS has replaced the older Objective-C based client. If you're looking for the best iOS experience, switch to the main Telegram app.

+
+

Telegram X for iOS is written entirely in Swift and is significantly lighter, faster and more battery-efficient than the original app, built with Objective C.

+

The design and feature set are closer to what iOS users have learned to expect from Telegram, but you will definitely notice the smooth animations and faster speed and loading times on most iPhones.

+

The internal structure of Telegram X for iOS is also much better optimized for the things that are expected of a Telegram app in 2018 and beyond. Just as with X for Android, today's X release for iOS is the beginning of a long journey.

+

+ +

Look out for our next updates, both to the experimental versions and their classic counterparts.

+

+ +

January 31, 2018,
The Telegram Team

+

+ +
+

P.S. Today, we're also releasing TDLib – a tool for building custom Telegram apps. Check out the announcement here »

+
+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/telegraph.html b/data/telegram.org/blog/telegraph.html new file mode 100644 index 0000000000..cffa87ca70 --- /dev/null +++ b/data/telegram.org/blog/telegraph.html @@ -0,0 +1,238 @@ + + + + + Meet the Telegraph API for Logins and Stats + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Meet the Telegraph API for Logins and Stats

+ +
+ +
+ +
+ +
+ +

Last month, we launched Telegra.ph, a minimalist publishing tool that allows you to create richly formatted posts and push them to the Web in just a click.

+

We tried to keep Telegraph‘s interface as simple as possible: there’s no need to log in or navigate menus. You just open telegra.ph, write your post, hit publish, and it's live.

+
+ +

Yes, it's that simple

+
+ +

Better with Bots

+

This simplicity has its price of course. Sometimes you want to edit your articles on several devices or stay logged in to avoid having to write your name and profile link under each new title. If any of this sounds familiar, meet our new @Telegraph bot.

+

This simple bot will help you log in and manage your Telegraph posts across any number of devices. In addition, it can give you page view statistics for any post on Telegraph. Just send it a link and watch the numbers roll in.

+

A Time to Gather Stones

+

If you have created some Telegraph posts in the past using browsers on your different devices, the @Telegraph bot helps unite them all under your rule.

+
+
+ +

A time to log in

+
+
+ +

And a time to gather posts

+
+ +

Simply press the Log in on this device button, and all posts you‘ve previously written in that device’s browser will be added to your Telegraph account.

+

Telegraph API

+

Mind you, Telegraph is not intended just for Telegram users. Anyone can use this dead-simple publishing tool. For those who are suffering the constraints of other messengers and can't enjoy the comfort offered by the @Telegraph bot, we have created an open Telegraph API.

+

Using the Telegraph API, any developer can create bots like @Telegraph for any other platform, or even standalone interfaces.

+
+

Here's the full documentation, in case you're interested.

+
+

Meanwhile, allow us to return to our coding dungeons where we're brewing another update to our apps for you this year.

+

+ +

December 20, 2016
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/themes-accounts.html b/data/telegram.org/blog/themes-accounts.html new file mode 100644 index 0000000000..e15fa7f25c --- /dev/null +++ b/data/telegram.org/blog/themes-accounts.html @@ -0,0 +1,247 @@ + + + + + Themes, Multiple Accounts and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Themes, Multiple Accounts and More

+ +
+ +
+ +
+ +
+ +

Happy winter holidays, everyone! To reinforce the festive mood, we‘re updating Telegram for the second time this December, adding features you’ve been asking for.

+

With version 4.7 for iOS, you can change what your Telegram looks like in the new Appearance settings. Choose between four different themes, including a minimalistic one (“Day”) and two dark themes (“Night” and “Night Blue”). The “Day” theme also allows you to pick an accent color for the entire app, like pink or purple.

+
+ +
+ +

Multiple accounts

+

The Android app already supported multiple themes, so it had to go further with 4.7 by supporting multiple accounts. You can add up to three accounts with different phone numbers to your Telegram app, and then quickly switch between them from the side menu. Notifications will keep coming from all accounts, unless you change this in the Notification settings.

+
+ +
+ +

Quick replies

+

Telegram now supports quick replies on both mobile platforms. To use them, just swipe left on any message in a chat.

+
+
+ +
+
+ +

In case you missed it…

+

Telegram 4.6, released earlier this month, introduced new granular settings for auto-downloading media, better link previews, albums in Secret Chats, improved security, and embeds for messages from public groups and channels. Here’s what an embed of a Telegram message looks like when included on a web page:

+

+ +

+
+ +

To get the HTML-code for embedding a message, open its t.me link in a web browser:

+
+
+
+ +

Have a happy new year – and stay tuned for the product updates we are going to announce in January.

+

+ +

The Telegram Team,
December 30, 2017

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/translations-iv2.html b/data/telegram.org/blog/translations-iv2.html new file mode 100644 index 0000000000..f5e7b11d9f --- /dev/null +++ b/data/telegram.org/blog/translations-iv2.html @@ -0,0 +1,276 @@ + + + + + Custom Languages, Instant View 2.0 and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Custom Languages, Instant View 2.0 and More

+ +
+ +
+ +
+Introducing custom languages, IV 2.0, a new design for Android and more +
+ + + +

Telegram's Translations Platform allows you to suggest better wording for Telegram interfaces in any language. We've recently rolled out support for most mainstream languages, and translations are already underway.

+

Today's update brings equal treatment to the smaller linguistic communities around the world. Anyone can now use the translation platform to create their own custom language packs – and translate Telegram into any minority language or local dialect, be that Māori, Scottish Gaelic or Transliterated Klingon.

+

We've made it easy to spread your translations. To translate the interface of your app, simply follow the dedicated sharing link of the desired language. Sharing links can be obtained in the translation panel.

+
+ Applying a custom language +
+ +

Each language also gets its own public group for discussions. Here are the links for the Catalan language, for example:

+ +

Once a user switches to your translation, all changes you apply in the interface will be applied immediately. The days of waiting for the apps to update or passing around localization files are over.

+

Instant View 2.0

+

Another unique feature of Telegram is the Instant View technology that allows Telegram users to view web pages in a consistent way, with zero loading time.

+

Today we're expanding the platform with support for right-to-left languages, blocks of related articles, image links, tables, nested lists, horizontal scrolling, collapsible text blocks and much more.

+

Now you can get beautiful instant view pages for even very complex articles. If you're reading this from one of our newly updated mobile apps, try this Wikipedia page for an example.

+
+ +
+ + + +

Soon we will announce a new crowdsourcing contest to make Instant View pages available for an even larger part of the internet.

+

The Great iOS Bug Hunt

+

We've made close to a thousand fixes and improvements to the iOS app since the major release of version 5.0. The new Telegram for iOS 5.1 features some 400 minor improvements.

+

New Design for Android

+

Telegram for Android has now reached version 5.0 and received a major overhaul in the design department. It is now much easier to access shared media from the profiles of users, groups and channels:

+ + +
+ +
+ +

Shared media now offers high quality crisp previews, increased loading speed, more info in the links and files sections, and more efficient design.

+
+ Shared Files +
+ +

The Settings screens were redesigned for a more streamlined experience:

+
+ +
+ +

Following in the footsteps of the iOS app, Android users can take advantage of the new detailed settings for the badge counter in Settings > Notification and Sounds:

+
+ Badge Counter Settings +
+ +

We've upgraded the photo selector for profile pictures so that you can choose the correct head to be displayed on your profile:

+
+ Choose an area to use for the photo +
+ +

Last but not least, you can zoom videos during playback and browse full-resolution images sent as documents just like normal photos, by swiping left and right.

+

+ +

December 10, 2018
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/trending-stickers.html b/data/telegram.org/blog/trending-stickers.html new file mode 100644 index 0000000000..9da607eea8 --- /dev/null +++ b/data/telegram.org/blog/trending-stickers.html @@ -0,0 +1,262 @@ + + + + + Trending Stickers, Storage and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Trending Stickers, Storage and More

+ +
+ +
+ +

Telegram users share hundreds of millions of stickers every day. Many of these are custom-created on the spot using pictures of friends or local politicians. Others are made by professional artists from all over the world. Starting today, we will be showcasing popular sticker sets made exclusively for Telegram in the new Trending Stickers tab.

+
+
+ +

Sticker panel

+
+
+ +

Trending tab in settings

+
+ +

You can find the new Trending tab on the Stickers panel and in Telegram Settings. We've made adding new stickers easier for people who have many sets installed. When you go over the limit of 200 sets, older unused stickers are archived automatically. You can reactivate them from the Archived Stickers tab in Sticker Settings later.

+

Personal storage

+

Many people have been using a chat with themselves or a small group to store their favorite messages or personal media. Starting today, there's no need for such lifehacks anymore. Just head to the Contacts tab and open the storage chat with yourself by tapping on your number at the top.

+
+
+ +

New contacts screen

+
+
+ +

Your storage chat

+
+ +

Feel free to forward favorite messages to the storage chat or send photos you want to quickly pass between devices. The handy ‘Shared Media’ sections will make finding content a breeze and you can always use in-chat Search for specific queries.

+

You can also access everything you send to the storage chat on any number of devices you connect, so this can serve as a simple but effective way to replace services like Dropbox right inside your messenger.

+

Group previews

+

Invite links are a handy way to add people to groups, even when they‘re not on Telegram yet. Today we’re making it easier for you to understand just what you're joining when you open them.

+
+ +

New group previews

+
+ +

As of Telegram v.3.11., you will be able to see who else is in the group and how many members it has before joining it.

+

Android Camera and More

+

If you're running Android 4.1. or higher, Telegram just got a brand new camera interface so that you can take photos in fewer taps. It is also now possible to preview bot content before sending.

+
+
+ +

Bot content preview

+
+
+ +

Check out before sending

+
+
+ +

Another nice bonus in this Android update is that you can now download large media and files 2x to 4x faster.

+

New looks and new viewer for Telegram Desktop

+

Telegram Desktop users can now enjoy an in-app player for videos. We've also improved the design in chats, adding sleek new message bubbles.

+
+ +

New desktop video player

+
+ + + +

And that‘s about all we’ve got for you in version 3.11.
As usually, stay tuned for more updates – coming after our little summer break.

+

+ +

August 3, 2016
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/unread-replace-2x.html b/data/telegram.org/blog/unread-replace-2x.html new file mode 100644 index 0000000000..f31329b575 --- /dev/null +++ b/data/telegram.org/blog/unread-replace-2x.html @@ -0,0 +1,259 @@ + + + + + Replace Media, Share vCards, Mark as Unread, 2X Voice Messages, and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Replace Media, Share vCards, Mark as Unread, 2X Voice Messages, and More

+ +
+ +
+ +
+ +
+ +

Telegram 4.8.3 for iOS and 4.8.10 for Android are out today, bringing several nifty features and improvements.

+

Replace Media and Add Captions

+

Sending the wrong picture by accident is rarely fun. On Telegram, it was already possible to delete the message for everyone and send a new one instead. Now you can just replace photos or videos with the correct versions right away:

+
+ +
+ +

Start editing the message, then tap the paperclip button to replace the attached media. You can also add captions to photos or videos that didn't have one.

+

Double-Time Playback for Voice and Video Messages

+

You'll like this one if your friends enjoy sending long and thoughtful voice notes. From now on, you can switch to 2X playback and hear people get to the point faster.

+
+ +

Works with voice and video messages

+
+ +

We‘ve spent a few extra hours to ensure that your friends don’t sound like Helium-breathing chipmunks as a result. Well, most of the times.

+

Mark as Read or Unread

+
+ +
+ +

This offers a quick way to get less important messages out of the way and highlight the chats that require your future attention.

+

Share Detailed Contact Info

+

Sometimes you want to share more info about a contact than just one number. With this update, you can select what data you want to send when sharing a contact. For example, several phone numbers or other vCard fields.

+
+ +

Choose which fields to share

+
+ +

Try sharing a contact that has multiple fields with data to check this out.

+

One More Thing

+

When you open a chat from Global Search and then go back, you will return to the search results and keep your position in the list.

+

And Three More (on Android 💪)

+

Android users are getting a few extra goodies with version 4.8.10. Tap and hold on profile pictures in the chats list to preview chats:

+
+ +

Tap and hold on the profile picture

+
+ +

Use the “create link” option in the formatting menu to make text URLs:

+
+ +

Select some text, then tap '...'

+
+ +

Last but not least, it is now possible to cancel sending messages before they are sent.

+

And that's it for today, stay tuned for our next updates!

+

+ +

June 27, 2018
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/unsend-and-usage.html b/data/telegram.org/blog/unsend-and-usage.html new file mode 100644 index 0000000000..df6f3cb25e --- /dev/null +++ b/data/telegram.org/blog/unsend-and-usage.html @@ -0,0 +1,273 @@ + + + + + Unsend Messages, Network Usage, and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Unsend Messages, Network Usage, and More

+ +
+ +
+ +
+ +
+ + +

Happy new 2017! We hope everybody had a great celebration. We at Telegram certainly did. One of our engineers got so excited about the new year that he mistakenly shared these stickers with his Mom:

+
+ +

Ooops!

+
+ +

To fix this, he quickly added a way to unsend recently sent messages. This smart move saved his morning, and it can still save yours! If you use Telegram v.3.16, you can now unsend any weird messages you shared within the last 48 hours.

+
+ +

Works in groups and PM

+
+ +

Naturally, this isn‘t a one-time feature. After this update, you’ll be able to retract any messages within 48 hours of sending them. Take that, Friday nights!

+

Network usage

+

The holiday season is in high swing in many parts of the world, so we figured some of you folks are busy traveling. If that's the case, you may want to check out the new Network Usage section that shows exactly how much data you consumed while in roaming or wi-fi or whatever.

+
+
+ +

Data and Storage

+
+
+ +

Network Usage

+
+ +

Don't forget to hop on the hotel wifi before any serious Telegramming in foreign lands. And remember that you can toggle automatic media download in Telegram Settings.

+

T.me Links

+

This is the perfect season to meet new people. Want to give them some contact information, but a phone number seems like too much? That's exactly the reason we added usernames and Telegram.me links waaay back in 2014.

+

Starting today, you can use t.me instead of telegram.me. Take a napkin, write t.me/username in no time, and give it to someone before they can get away!

+

This also works with channels:
t.me/telegram
Public groups:
t.me/snowballfight
And stickers:
t.me/addstickers/NickSantini

+

Android Developers Never Sleep

+

85% of Telegram users are on Android. Our CEO is worried that, if ignored, this Android population can start a rebellion and dethrone him. To please the mob, he made us introduce the following features to the Android app:

+
    +
  • Messages from one sender are now neatly grouped together, and scrolling up shows the date right away, making the chats easier to navigate.
  • +
  • The app now restores your previous scroll position when you switch back to a chat. Very useful when somebody sends you a saga in 1,000 messages, and you want to patiently read them in the right order.
  • +
+
+ +

That's the date up there

+
+ +
    +
  • Sharing files (a feature we had since forever) has become easier because you see a list of recently downloaded files right on the sharing screen.
  • +
+
+ +

Recently downloaded files

+
+ +
    +
  • We now support GBoard, the Google keyboard that can apparently send cat GIFs.
  • +
  • And for those 2 users that already have Android 7.1 installed, we are happy to announce that we've added a fast action menu with frequent chats to your home screen. All hail the early adopters!
  • +
  • Back to the important stuff: the cowboy, the clown, and the sick face emoji (also known as the ‘exfoliating green tea mask face’ emoji) have found their way to Android. We support all of them now.
  • +
+
+ +

New emoji

+
+ +

What do these emoji mean? When are you supposed to use them? Is the singular form of ‘emoji’ in fact ‘emojus’? To answer all these questions with utmost accuracy, we've also added support for this one:

+
+ +
+ +

+ +

January 3, 2017
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/unsend-privacy-emoji.html b/data/telegram.org/blog/unsend-privacy-emoji.html new file mode 100644 index 0000000000..96c484a783 --- /dev/null +++ b/data/telegram.org/blog/unsend-privacy-emoji.html @@ -0,0 +1,257 @@ + + + + + Taking Back Our Right to Privacy + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Taking Back Our Right to Privacy

+ +
+ +
+ +
+ Unsending messages, anonymized forwarding, improved search and VoiceOver/TalkBack support +
+ + +

For us, your private data is sacred. We never use your data to target ads. We never disclose your data to third parties. We store only what is absolutely necessary for Telegram to work.

+

In 2013, we gave millions of people power over their data with end-to-end encryption.

+

Today, we are giving hundreds of millions of users complete control of any private conversation they have ever had. You can now choose to delete any message you have sent or received from both sides in any private chat. The messages will disappear for both you and the other person – without leaving a trace.

+

Unsend Anything

+

The “Unsend” feature we introduced 2 years ago worked only for messages sent by you and only for 48 hours. Now you can “unsend” messages you have received as well, and there is no time limit. You can also delete any private chat entirely from both your and the other person's device with just two taps.

+
+ +
+ +

Anonymous Forwarding

+

To make your privacy complete, we’ve also introduced a way to restrict who can forward your messages. When this setting is enabled, your forwarded messages will no longer lead back to your account — they'll just display an unclickable name in the “from” field. This way people you chat with will have no verifiable proof you ever sent them anything.

+
+ +
+ +

Look for “Forwarded messages” in Privacy and Security settings. By the way, you can now also restrict who can view your profile photos.

+

Settings Search

+

Since the Settings section keeps getting bigger, we’ve added a search tool that allows you to quickly find any settings you need.

+
+ +
+ +

This new search tool in Settings also shows answers to any Telegram-related questions based on the FAQ:

+
+ +
+ +

Emoji Search and GIFs

+

The GIF and stickers search has been upgraded on all mobile platforms – it now looks better and finds more cats. Any GIF you find can be previewed by tapping and holding. Sticker packs now have icons, which makes selecting the right pack easier. Large GIFs and video messages on Telegram are now streamed, so you can start watching them without waiting for the download to complete.

+

On Telegram for Android, you can now use keywords in many languages to find any emoji. If we are missing a keyword for an emoji, you’re welcome to suggest it here – emoji search will constantly be improving without the need to update Telegram.

+
+ +
+ +

You’ll also see a list of related emoji when typing a message. If you like an emoji enough to send it without any accompanying text, the emoji will appear larger in the chat on Android (iOS coming soon).

+

VoiceOver and TalkBack

+

We’ve added support for accessibility features – VoiceOver on iOS and TalkBack on Android. These gesture-based technologies give you spoken feedback so that you can use Telegram without seeing the screen.

+
+

Tell us what you think the next update should be.

+
+

March 24, 2019
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/usernames-and-secret-chats-v2.html b/data/telegram.org/blog/usernames-and-secret-chats-v2.html new file mode 100644 index 0000000000..bc053b69d2 --- /dev/null +++ b/data/telegram.org/blog/usernames-and-secret-chats-v2.html @@ -0,0 +1,222 @@ + + + + + Usernames and Secret Chats 2.0 + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Usernames and Secret Chats 2.0

+ +
+ +
+ +

Telegram apps for both Android and iOS have been updated today.

+

Usernames

+ +

From now on, you can choose a public username in the Settings section of Telegram. If you do, anyone will be able to find you by your username and contact you – without having to know your phone number.

+

To find people by username, just start typing any name in the search field of the Contacts section. Once entered at least 5 characters, you will see the Global Search section in your search results. This list contains people with corresponding usernames.

+

You can find out more details about usernames in our FAQ.

+ +

Secret Chats 2.0

+ +

Secret Chats got a major upgrade today.

+ +

The self-destruct timer in Secret Chats now includes more small values ranging from 1 to 60 seconds. In chats with these shorter self-destruct timers, the countdown for photos, videos and voice messages will begin only after they are first opened. So the content will never disappear before you have seen it or listened to it.

+ +

Photos with short self-destruct timers now work in 'Tap and Hold to View' mode, and you will receive a notification each time the recipient of a self-destructing photo makes a screenshot of it.

+ +
+ +
+
+ +

October 23, 2014
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/video-messages-and-telescope.html b/data/telegram.org/blog/video-messages-and-telescope.html new file mode 100644 index 0000000000..aa468b88be --- /dev/null +++ b/data/telegram.org/blog/video-messages-and-telescope.html @@ -0,0 +1,247 @@ + + + + + Video Messages and Telescope + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Video Messages and Telescope

+ +
+ +
+ +
+ +
+ +

We know you love the speed and simplicity of voice messages on Telegram. Starting today, you can also send video messages – just as swiftly:

+
+
+ +
+
+
+ +

To send a video message, go to any chat on Telegram and tap the mic icon to switch to camera mode. Now all you need to do is tap and hold the camera icon and record a video message. When you’re done, just release the recording button to dispatch your message — and it will arrive in the blink of an eye.

+

Video messages are so fast because Telegram compresses them and sends them even as you record them. By the way, if holding the button seems like too much work, you can lock the camera in recording mode by swiping up. This also works with voice messages now (here's one for you, cab drivers).

+

Video messages are automatically downloaded and autoplayed by default (you can change this in Settings if you’re on a data diet though) and generally feel and act like voice messages – on visual steroids.

+
+ +

Picture in Picture

+ +

While watching a video message, you can freely browse your other chats – the video will pop up in a corner and continue playing. You can move it around the screen and pause it from anywhere in Telegram. Cool, eh? Well, there's more:

+

Meet Telescope

+

Lots of popular folks address their fans via public channels on Telegram. Video messages will make their connection to fans more direct and intimate than ever. But we want to kick this up another notch.

+

Today we are launching Telescope, a dedicated video hosting platform for those who use videos to communicate with their audiences (here's one for you, blogger people!)

+

With Telescope, public video messages can go viral beyond the Telegram ecosystem. Telescope hosts autoplayed round videos of up to 1 minute in duration – the same format we use for Telegram video messages. And yes, you heard that right, you don't need a Telegram account to view them.

+

Every public channel on Telegram now has a telesco.pe URL, such as telesco.pe/channel_name, where all of its video messages are available to the world wide web and the wide, wide world.

+
+ +

A Telescope Channel

+ +

Whenever you post a video message to a public channel, it will also be uploaded to Telesco.pe and have a public URL there.

+
+ +

Share Telescope Videos

+ +

With Telescope, even those users who don’t have Telegram installed will be able to enjoy your public video messages and share them on Twitter or Facebook. As a result, this content will generate more views. And who would refuse more views these days, hmm?

+
+

This was just 1/3 of Telegram 4.0. Keep reading to learn more about Payments for Bots and the new Instant View Platform.

+
+

+ +

May 18, 2017,
The Telegram Team

+

+ +

P.S. Our founder has this weird urge to keep launching platforms that start with “Tele-”. Be sure to check out Telegraph, the publishing platform we launched last year.

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/voice-2-secret-3.html b/data/telegram.org/blog/voice-2-secret-3.html new file mode 100644 index 0000000000..02cbb51dad --- /dev/null +++ b/data/telegram.org/blog/voice-2-secret-3.html @@ -0,0 +1,245 @@ + + + + + Voice Messages 2.0, Secret Chats 3.0 and... + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Voice Messages 2.0, Secret Chats 3.0 and...

+ +
+ +
+ +

Voice messages on Telegram just got a completely new interface with waveform visualizations, a brand new player and raise-to-speak functionality.

+

You can now start listening to a long voice message and switch to other media or chats. The message will continue playing in the background. For who are we to defy the god of multi-tasking?

+
+ +

New looks for voice messages

+
+ +

Recording and listening to voice messages got easier with raise-to-speak and raise-to-listen. When a chat is open, bring your phone to your ear (as if taking a phone call) to listen to new voice messages or record a new one after the signal.

+
+ +

Raise to Speak: Preview before sending

+
+ +

This feature involves plenty of behind-the-scene magic with proximity sensors, gyroscopes and accelerometers. It works well with most modern devices, but is still experimental. Some phones may require arcane intervention from our devs.

+

Secret Chats 3.0

+

With their self-destruct timers and end-to-end encryption, secret chats are a great way to pass sensitive information. Today we’re bringing the best features from cloud chats over to secret chats: detailed link previews, replies, photo and video captions, sticker sharing, inline bots and GIFs. We’ve also improved key visualizations to make secret chats immune to potential alien invasions.

+
+ +

A Secret Chat full of new goodies

+
+ +

…and…

+

Privacy. When overly active friends start adding you to random groups or channels, it gets overwhelming quickly. Now you can decide who may add you to groups and channels with granular precision. E.g. “All my contacts. Except those two.”

+

Supergroups. Supergroup creators also get more control. They can now change who may add new members to their group: all existing members or only selected admins. Supergroups can have up to 1000 members, and finding a balance between order and chaos is important if you want them to grow.

+

Sharing extension. Sharing on iOS devices has become way smoother. You can now share any photo, video, audio, document or location to any Telegram chat or channel straight from default iOS apps like Contacts, Maps, Voice Memos and Photos. It is also possible to share stuff to several chats or channels at once.

+

Attachment Menu. Media files will zoom beautifully when you select them in the attachment menu. Note that we’ve moved ‘Image Search’ to the ’Photo or Video’ section (tap the magnifying glass icon in the top right corner).

+

Hotkeys. iPad users with external keyboards get hotkey support. Now you can navigate chats and send messages without ever touching your iPad’s screen. Saves a lot of time.

+

Photo Editor. In the Android corner, we’re introducing additional photo-editing tools – rotate, fade, tint and curves.

+
+
+ +

Photo editor

+
+
+ +

Curves tool

+
+
+ +

We’re not done with updates this month – more features and good news are coming very soon to a Telegram Messenger near you.

+

+ + +

February 12, 2016
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/winter-contest-ends.html b/data/telegram.org/blog/winter-contest-ends.html new file mode 100644 index 0000000000..9adb1891a2 --- /dev/null +++ b/data/telegram.org/blog/winter-contest-ends.html @@ -0,0 +1,224 @@ + + + + + Winter Contest Ends + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Winter Contest Ends

+ +
+ +
+ +

The contest to decrypt intercepted traffic of Telegram produced no winners as of March, 1. As promised, today we are publishing the encryption keys necessary to decrypt the traffic.

+
SECRET CHAT:
+2e 20 9f 9d 99 c9 fc 8a 3d dc d5 6d 21 26 46 c9 d8 1a 26 f8 ec f7 f2 7e c9 28 65 95 52 dc 1c 21 bb 95 60 b1 d8 5f 94 5f 43 8d 7e 8e 96 fa e6 89 91 a9 90 39 8b df ef 50 22 06 f8 52 80 e6 50 20 62 71 c4 b2 f5 f8 88 4d 83 ae 66 ec fe cd ec 92 26 69 72 5e 85 f9 ea 58 b0 d6 9f 5b 1e b7 68 15 76 5b 12 88 3d 17 f6 62 49 8b 1f 9d 7a 11 94 67 8d d1 ee d6 55 50 d4 51 c0 5e a5 9a 1a eb 8a 8c 7c 44 1b db 96 5a fd cd 85 47 5b f0 8a 1e b8 d6 74 a4 c7 e7 af 19 3f a6 0a ff e5 3b 9f c4 fc ea 59 af f6 72 60 16 6f 40 af 58 95 98 06 0c 22 00 d7 3d be 96 19 56 54 06 74 d2 6b 38 8d c2 a0 97 62 6d e4 10 99 b9 cf d5 0f 56 9d d3 bb 49 86 d5 15 23 86 03 c3 52 67 82 77 5e 53 e9 ba e8 63 58 ed 55 b0 ef ec 69 65 a0 e5 1d e4 b6 6e 5a 3d 5f 9b 9a 20 67 f5 d5 c4 d7 60 14 c6 56 2d 12 1b 0a
+
+DC 1:
+5e a6 0d a2 9c 90 8e f4 36 d5 48 fe 76 a3 11 f6 66 13 4e 94 bb 11 32 d6 cf fd b0 2f 7b 77 bb 01 d7 42 a4 22 d3 04 e7 d2 fc 5b 32 48 d6 71 eb 18 51 19 99 76 49 46 1a 43 d8 cf cd 8a e2 fe 42 2c 36 d7 05 8b 0c 5e 00 8a 5a bc 35 4f ec 75 b4 10 e1 84 bb cb af ec e3 d6 fd 59 fd 01 83 ef 8b dd 13 50 24 5b 80 09 75 7e c3 c3 08 ba 59 f4 ec c0 87 71 ba 9f 45 8c 15 df 2a cd a5 bc 81 a9 20 fe 42 e2 65 78 02 77 80 11 0e e4 67 f3 40 cf 72 be fc c2 8d 0b ad d9 9e 6e 1a c3 03 71 39 be b9 dd df 7c 63 a6 27 45 ee 8e 00 5e 12 51 51 6c 6a 10 a6 73 3a 10 5d d8 f3 b6 c5 70 fe 91 c2 64 4b d0 74 2d 47 e7 4e 00 cf d5 d3 65 15 2b 48 9c 75 eb a8 96 aa ce 09 49 9b 5e ea 76 06 19 f3 b3 e7 7b af df 5d 68 5e 80 10 48 ec 00 35 90 d3 e5 96 c6 59 a7 44 d8 20 a8 a2 b6 93 64 4f 98 44 23 8e fd
+
+DC 2:
+63 ab 0d b7 98 e1 78 ef 5f 05 9c e4 84 3b 53 b3 4f 6e d1 d3 8a 6d 59 19 32 26 73 60 c2 e2 fe ee d3 2d 74 35 18 08 ba 04 87 cf 7f d9 87 4b 64 d5 80 06 05 f5 01 56 6d c2 66 7e 2d ef f6 a3 82 3d 31 0e ed 6b 46 4c 11 d5 ec 0f 7b be 64 79 26 87 a9 d3 34 27 d8 8b aa b5 36 8b 95 2f a7 c7 2a a6 bf a9 44 51 c5 c8 06 04 78 d2 64 87 e8 13 f3 f0 9b c9 8c bc 29 01 55 a2 80 e1 e8 4e 74 53 7e 05 22 1b 51 3d 1a c5 61 b3 04 98 c2 2f 71 e3 76 2e 31 bd d8 55 15 4b 3e 34 ed 84 b2 56 d0 bd c6 9a 1a 2a 4b 2f fc 68 8e c4 e3 81 23 6f 07 3f 3a 6b 56 f6 ee 31 e6 aa 0d 49 36 6a 51 79 25 bf b6 40 64 8c e2 14 c8 70 37 cb 70 ad a1 83 ed 1f b9 78 b9 93 0c 7c 0c ed 6d c6 aa c2 d0 da 51 ce ae cf 99 8f 65 eb 5a 42 e6 ff 4a 51 a9 97 da 6e ac e5 63 c1 05 a9 fe d0 da da 43 e3 50 14 fc b1 46 ea
+
+DC 3:
+16 0c be 58 e1 74 74 f5 f9 8f f8 82 71 ed 57 84 20 49 bd da 17 0e 00 a8 a4 24 71 79 86 1f ef 3e 41 70 31 de c9 c2 19 23 37 fd ec 2f fa 9e 89 29 4f a2 af 69 cf 24 3a 6e 44 5d 89 d2 8b 50 45 26 3c ff e3 d4 4d 7d b4 88 54 8c 87 09 c5 ac 09 5c e6 62 43 73 b5 3e 96 ea f3 62 76 58 1b fd 8a 36 45 65 4a fc 7b ee 7b 13 06 e5 2f 9d 8f cb b9 a7 6f 76 00 f4 9a ab 50 fb 91 e0 2b ce 28 db 95 02 a0 62 33 bb e7 41 13 7b 2c 7e ba 7c d5 87 12 33 de 44 8d 4b 76 af 59 cc 80 42 02 69 56 90 8a 5d 95 0b 3e 8b ef 65 17 fc 79 62 b4 69 1b 21 aa 89 5b 22 f6 33 67 80 d0 22 f7 76 f2 6c 4b af 69 07 0f 2c 3a af 67 6b 74 c0 7f 8c 83 85 85 8e 47 b7 55 42 c1 3d 70 33 9d 87 60 7c f6 8b 99 96 1d af 82 b8 d2 37 c7 a3 fc ac 25 fe 77 f0 29 4d 82 a4 15 89 cb c2 27 ae 4f 16 d6 b8 4c cb de 2a 59 d7
+
+DC 4:
+b4 aa dc bc 8e e5 6a f4 9f 7b 65 de cd 1c 28 3d f1 58 f6 03 e1 34 9d 63 54 b0 15 a7 b8 a6 45 4e de dd cd e4 1a 54 d7 9b fe 46 05 c7 62 19 d9 7a c0 00 6b e6 72 83 3d 15 00 99 d9 9b 97 c0 4a a8 85 e7 85 3c 3f a4 2f 6a 57 0b 3c b0 2a 97 65 6f bf 4e 0d 93 f7 55 3b 3a 39 a1 1a 0f db 9d 7a df 5b c6 9b 45 9a ea e4 27 92 8c c3 d2 75 53 66 e4 1c 29 f1 14 fc fd e8 c0 c8 12 47 ee 5a 92 f1 bf 1f 6f 8e 95 a5 90 81 37 d6 5d bd 5c 4c 41 61 29 6e 4f 7e 83 e1 b9 ef 00 00 de 25 33 f4 df 1a 94 f0 e7 1c fd 35 c0 75 65 88 ef c5 aa b5 c9 7d 0e e4 6d b7 9f 10 ca 4b f0 c9 c7 2d 30 20 e9 e1 b8 03 de a2 60 4e 3f 59 dc 36 a2 50 f8 52 5e 32 c8 c1 84 87 84 d6 54 42 dd ab b4 1b d6 fe e4 29 d3 70 4e 3e 48 ba 86 80 39 b7 94 3c 31 18 f8 bd 7b d8 89 6b 32 77 5c 89 4a a1 ca 18 ba 1e 6a 87 6a
+
+DC 5:
+4c 76 1f 87 08 53 54 cb 12 fd 01 bd bd e6 42 d2 6b 47 4b d8 0b 6a eb 9f 24 8b ee 77 1f 8b a5 3f f5 f1 c7 80 05 80 2c 20 29 7c 3c 14 59 2b 5e 7f 69 58 3b 7e 07 37 25 67 3d 18 ac f2 28 43 63 8f a5 41 c1 ba 53 dd eb 3d 36 0d 7b d3 14 f7 f9 83 aa 0c 81 20 89 e0 c7 d7 e9 ef 11 aa 43 ca 54 2a 9f 69 0f 1d 99 ef f6 55 14 71 6d a3 1e c2 75 fb 1c 88 f7 c0 21 64 5d 34 db 3f a4 e7 a9 f0 af 9f 9d 14 a4 3a 49 7c 50 e6 45 24 3a cb a4 a6 2a 35 dd 6c 9c ce 87 24 d1 ff 13 19 15 43 89 a4 8c 39 66 a2 22 df 4e 94 76 e1 89 b5 03 7a 2b 34 e7 39 09 f9 22 5d cb 36 4e ce 37 e7 cf 7d ab b5 8b db 81 c6 c8 f4 c7 7c 3a 22 59 fc e6 32 19 aa 46 d2 95 96 61 61 e6 cc 57 f0 0e 87 5c 7d 5b 87 e7 64 28 c6 03 38 3c 0b a6 5e 4a 21 a3 67 af e5 b3 88 cc 9d 03 98 33 ac c6 87 b4 b6 82 42 c4 41 33 39
+


+ +

We would like to use this opportunity to thank the users ABC, @DefuseSec, @hackappcom, @Morj and x7mz who helped us further improve security of the client apps and expand guidelines for third-party developers.

+

Since we have no winner in the current challenge, we are going to launch a new competition, with an easier task, but a larger prize. The new competition will allow participants not only to intercept traffic, but to manipulate it as well. We are now building the tools that will enable the contestants to perform all kinds of active attacks. Once the platform is ready later this month, we will announce the new contest on Twitter. Please follow us at @telegram!

+

March 2, 2014
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/crypto_contest.html b/data/telegram.org/crypto_contest.html new file mode 100644 index 0000000000..41c2528522 --- /dev/null +++ b/data/telegram.org/crypto_contest.html @@ -0,0 +1,209 @@ + + + + + $200,000 to the hacker who can break Telegram + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ +
+ +
+
+

$200,000 to the hacker who can break Telegram

+ +
+

The 2013-2014 winter contest has ended. Check out our new contest »

+
+

Telegram backer, Pavel Durov, will give $200,000 in BTC to the first person to break Telegram' encrypted protocol. Starting today, each day Paul (+79112317383) will be sending a message containing a secret email address to Nick (+79218944725). In order to prove that Telegram crypto was indeed deciphered and claim your prize, send an email to the secret email address from Paul’s message.

+

Your email must contain:
- The entire text of the message that contained the secret email.
- Your Bitcoin address to receive the $200,000 in BTC.
- A detailed explanation of the attack.

+

Encrypted Telegram traffic from and to Paul’s account is publicly available for download from this page. You can send Telegram messages to Paul and view his traffic in real time.

+

To prove that the competition was fair, we will publish the participating keys necessary to decrypt the traffic as soon as a winner is announced. In case there is no winner by March 1, 2014, encryption keys will be published at that date.

+

Got questions about this contest? Check out the Contest FAQ!

+
+ +
+
+ +
+ +
+ +
+
+
+ +
+
+
+
+ +
+
+ +
+ +

Encrypted Telegram traffic

+ +

Download traffic slice

+
+ + + +
+ + Download the whole traffic log + +

Real time traffic updated every 5 seconds

+
+ +
+ +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/faq_channels.html b/data/telegram.org/faq_channels.html new file mode 100644 index 0000000000..a89305e6b7 --- /dev/null +++ b/data/telegram.org/faq_channels.html @@ -0,0 +1,165 @@ + + + + + Channels FAQ + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+

Channels FAQ

+ +
+

This FAQ is about Telegram channels.
Back to the main FAQ »

+
+

+
+

Q: What's a channel?

+

Channels are a tool for broadcasting public messages to large audiences. In fact, channels can have an unlimited number of subscribers. When you post in a channel, the message is signed with the channel's name and not yours. You can appoint additional administrators to help you manage the channel. New subscribers can see the entire message history in a channel once they join.

+

If you'd like an example, join our official Telegram channel to get notified about our updates.

+

To create a channel:
iPhone: Start a new message (tap the icon in the top-right corner in Chats). Then ‘New Channel’.
Android: Tap the circular pencil icon in the chat list. Then ‘New Channel’.
Windows Phone: Tap the ‘+’ button on the bottom bar. Then ‘New Channel’.

+

Q: How are public and private channels different?

+

Public channels have a username. Anyone can find them in Telegram search and join. Private channels are closed societies – you need to be added by the owner or get an invite link to join.

+

Please note that private channels with publicly available invite links will be treated in the same way as public channels, should it come to content disputes.

+

Q: What can administrators do?

+

The owner of a channel can broadcast messages, delete any messages, add subscribers (the first 200 only), remove subscribers, change the channel's name, profile image and link, as well as delete the channel completely. The owner can also add and remove administators to help manage the channel.

+

You can set up administrator rights for each individual administrator when you appoint them.

+

Q: What happens if I delete a message?

+

If a message is deleted in a channel, it will disappear for all subscribers.

+

Q: How do I add people to my channel?

+

As the channel's owner, you may invite the first 200 subscribers to your channel. Once the subscriber count reaches 200, the channel is on its own. If it's a public channel, it will have a username and a telegram.me/ link (e.g. t.me/telegram) – you can post this link on social networks, advertise it in magazines, or tattoo it on your back. If you have a private channel, you can send an invite link to your friends.

+

Please do not send channel links (or other unsolicited messages) to strangers. If they report spam from your account, you may be banned from contacting other people, however good your intentions.

+

Q: What does the eye icon mean?

+

Each post in a channel has a view counter. Views from forwarded copies of your messages are also included in the total count. This way you can see how far it has spread.

+

Please note that these numbers are approximate — we don't want to keep a record for everything you've ever viewed. After a short while (around 4 days), Telegram will forget that you've seen a post and will count you again if you navigate to it. For this reason you may see several views for posts in a private channel where you are alone.

+

Q: How do I know who posted a message?

+

As the owner of the channel, you can enable admin signatures that users will see next to the view counters. These signature only mention the name of the administrator and no link to their profile.

+

If the signatures are disabled, there is no way for users to know whether a message was posted by the owner or one of the administrators.

+

Q: Are there any feedback options?

+

You can add a discussion group chat to the channel, and your subscribers will see a comment button for each post in the channel. Comments show up in a thread of their own and also land in the discussion group to keep everyone in the loop and make it easier for admins to keep the conversation civil.

+

You can also use bots (e.g. the @like bot) to add buttons to your posts.

+
+ +
+ +
+
+
+ + + + + + + diff --git a/data/telegram.org/faq_spam.html b/data/telegram.org/faq_spam.html new file mode 100644 index 0000000000..df27b79c21 --- /dev/null +++ b/data/telegram.org/faq_spam.html @@ -0,0 +1,163 @@ + + + + + Spam FAQ + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+

Spam FAQ

+ +
+

This FAQ is for people whose accounts were limited after being reported for spam.
Back to the main FAQ »

+
+

+
+

Q: What happened to my account?

+

When users press the ‘Report spam’ button in a chat, they forward these messages to our team of moderators for review. If the moderators decide that the messages deserved this, the account becomes limited temporarily.

+

This means that if you have been sending unwanted messages to random strangers or posting spam in groups, you lose the ability to do so.

+

Q: So I can't send messages anymore?

+

No, it's not that bad. Limited accounts can send messages to people who have their number saved as a contact. You can also always reply to anyone who messages you first.

+

Q: Why was I reported?

+

Telegram‘s username search is not a tool for making new friends. People usually don’t like it when strangers contact them — so they will report you if they find your messages annoying. Please only contact people if you're sure that they are expecting messages from you. The same applies to adding people to unwanted groups and channels. In addition to this, group admins can also report users who post spam in their groups.

+

Naturally, all such reports are also checked by human moderators. If the messages contain spam, the account will be temporarily limited.

+

Q: What can people report me for?

+

For private messages, it really doesn‘t matter what you send, as long as the receivers find it unwelcome. It could have been a photo, an invite link or a simple ’hello‘. Please only send messages when you are sure people won’t mind getting them.

+

As a general rule, people do mind getting unsolicited advertisements, links, invite links to groups or channels, random photos and, above all, anything related to commerce or online popularity. If you send them something like this, you will be blocked — and everybody else will be happy.

+

Moderators are more lenient when it comes to messages in groups, but anyone who sends spam or unsolicited advertisments will be limited.

+

Q: What do I do now?

+

If this happened to you for the first time (and you are not an industrial scale spammer), most likely your account will be limited for a few days or so. Please wait and consider that people want a peaceful time using our messenger.

+

Repeated offences will result in longer periods of being blocked. If you keep writing unwanted messages to strangers, you may lose the ability to do so forever.

+

Q: I read all of the above, and I‘m certain that I didn’t break any rules!

+

If you are sure that the limit was wrongfully applied to your account, please contact our @SpamBot.

+

Please forgive us for the inconvenience — even the best systems, algorithms and well-trained people can make mistakes sometimes.

+

Q: I know I was wrong, please release me sooner!

+

We're sorry, but this is impossible. We value the inner peace of Telegram users too much.

+

Q: I‘ve just signed up and didn’t send any messages yet, but my account is limited.

+

Some numbers may trigger an overly harsh response from our system, either due to their previous owners‘ activities or due to them being certain virtual/VOIP numbers. We’re sorry if this resulted in your account being limited for no reason.

+

If you think this is your case, please contact @SpamBot and tell it your story.

+
+ +
+ +
+
+
+ + + + + + + diff --git a/data/telegram.org/js/games.js b/data/telegram.org/js/games.js new file mode 100644 index 0000000000..86d81d5052 --- /dev/null +++ b/data/telegram.org/js/games.js @@ -0,0 +1,206 @@ +(function () { + var eventHandlers = {}; + + // Parse init params from location hash: for Android < 5.0, TDesktop + var locationHash = ''; + try { + locationHash = location.hash.toString(); + } catch (e) {} + + var initParams = urlParseHashParams(locationHash); + + var isIframe = false; + try { + isIframe = (window.parent != null && window != window.parent); + } catch (e) {} + + + function urlSafeDecode(urlencoded) { + try { + return decodeURIComponent(urlencoded); + } catch (e) { + return urlencoded; + } + } + + function urlParseHashParams(locationHash) { + locationHash = locationHash.replace(/^#/, ''); + var params = {}; + if (!locationHash.length) { + return params; + } + if (locationHash.indexOf('=') < 0 && locationHash.indexOf('?') < 0) { + params._path = urlSafeDecode(locationHash); + return params; + } + var qIndex = locationHash.indexOf('?'); + if (qIndex >= 0) { + var pathParam = locationHash.substr(0, qIndex); + params._path = urlSafeDecode(pathParam); + locationHash = locationHash.substr(qIndex + 1); + } + var locationHashParams = locationHash.split('&'); + var i, param, paramName, paramValue; + for (i = 0; i < locationHashParams.length; i++) { + param = locationHashParams[i].split('='); + paramName = urlSafeDecode(param[0]); + paramValue = param[1] == null ? null : urlSafeDecode(param[1]); + params[paramName] = paramValue; + } + return params; + } + + // Telegram apps will implement this logic to add service params (e.g. tgShareScoreUrl) to game URL + function urlAppendHashParams(url, addHash) { + // url looks like 'https://game.com/path?query=1#hash' + // addHash looks like 'tgShareScoreUrl=' + encodeURIComponent('tgb://share_game_score?hash=telegram-crawler_long_hash123') + + var ind = url.indexOf('#'); + if (ind < 0) { + // https://game.com/path -> https://game.com/path#tgShareScoreUrl=etc + return url + '#' + addHash; + } + var curHash = url.substr(ind + 1); + if (curHash.indexOf('=') >= 0 || curHash.indexOf('?') >= 0) { + // https://game.com/#hash=1 -> https://game.com/#hash=1&tgShareScoreUrl=etc + // https://game.com/#path?query -> https://game.com/#path?query&tgShareScoreUrl=etc + return url + '&' + addHash; + } + // https://game.com/#hash -> https://game.com/#hash?tgShareScoreUrl=etc + if (curHash.length > 0) { + return url + '?' + addHash; + } + // https://game.com/# -> https://game.com/#tgShareScoreUrl=etc + return url + addHash; + } + + + function postEvent (eventType, callback, eventData) { + if (!callback) { + callback = function () {}; + } + if (eventData === undefined) { + eventData = ''; + } + + if (window.TelegramWebviewProxy !== undefined) { + TelegramWebviewProxy.postEvent(eventType, JSON.stringify(eventData)); + callback(); + } + else if (window.external && 'notify' in window.external) { + window.external.notify(JSON.stringify({eventType: eventType, eventData: eventData})); + callback(); + } + else if (isIframe) { + try { + var trustedTarget = 'https://web.telegram.org'; + // For now we don't restrict target, for testing purposes + trustedTarget = '*'; + window.parent.postMessage(JSON.stringify({eventType: eventType, eventData: eventData}), trustedTarget); + } catch (e) { + callback(e); + } + } + else { + callback({notAvailable: true}); + } + }; + + function receiveEvent(eventType, eventData) { + var curEventHandlers = eventHandlers[eventType]; + if (curEventHandlers === undefined || + !curEventHandlers.length) { + return; + } + for (var i = 0; i < curEventHandlers.length; i++) { + try { + curEventHandlers[i](eventType, eventData); + } catch (e) {} + } + } + + function onEvent (eventType, callback) { + if (eventHandlers[eventType] === undefined) { + eventHandlers[eventType] = []; + } + var index = eventHandlers[eventType].indexOf(callback); + if (index === -1) { + eventHandlers[eventType].push(callback); + } + }; + + function offEvent (eventType, callback) { + if (eventHandlers[eventType] === undefined) { + return; + } + var index = eventHandlers[eventType].indexOf(callback); + if (index === -1) { + return; + } + eventHandlers[eventType].splice(index, 1); + }; + + function openProtoUrl(url) { + if (!url.match(/^(web\+)?tgb?:\/\/./)) { + return false; + } + var useIframe = navigator.userAgent.match(/iOS|iPhone OS|iPhone|iPod|iPad/i) ? true : false; + if (useIframe) { + var iframeContEl = document.getElementById('tgme_frame_cont') || document.body; + var iframeEl = document.createElement('iframe'); + iframeContEl.appendChild(iframeEl); + var pageHidden = false; + var enableHidden = function () { + pageHidden = true; + }; + window.addEventListener('pagehide', enableHidden, false); + window.addEventListener('blur', enableHidden, false); + if (iframeEl !== null) { + iframeEl.src = url; + } + setTimeout(function() { + if (!pageHidden) { + window.location = url; + } + window.removeEventListener('pagehide', enableHidden, false); + window.removeEventListener('blur', enableHidden, false); + }, 2000); + } + else { + window.location = url; + } + return true; + } + + // For Windows Phone app + window.TelegramGameProxy_receiveEvent = receiveEvent; + + window.TelegramGameProxy = { + initParams: initParams, + receiveEvent: receiveEvent, + onEvent: onEvent, + shareScore: function () { + postEvent('share_score', function (error) { + if (error) { + var shareScoreUrl = initParams.tgShareScoreUrl; + if (shareScoreUrl) { + openProtoUrl(shareScoreUrl); + } + } + }); + }, + paymentFormSubmit: function (formData) { + if (!formData || + !formData.credentials || + formData.credentials.type !== 'card' || + !formData.credentials.token || + !formData.credentials.token.match(/^[A-Za-z0-9\/=_\-]{4,512}$/) || + !formData.title) { + console.error('[TgProxy] Invalid form data submitted', formData); + throw Error('PaymentFormDataInvalid'); + } + postEvent('payment_form_submit', false, formData); + } + }; + +})(); diff --git a/data/telegram.org/js/telegram-widget.js b/data/telegram.org/js/telegram-widget.js new file mode 100644 index 0000000000..a1e4e6e65d --- /dev/null +++ b/data/telegram.org/js/telegram-widget.js @@ -0,0 +1,515 @@ +(function(window) { + (function(window){ + window.__parseFunction = function(__func, __attrs) { + __attrs = __attrs || []; + __func = '(function(' + __attrs.join(',') + '){' + __func + '})'; + return window.execScript ? window.execScript(__func) : eval(__func); + } + }(window)); + (function(window){ + + function addEvent(el, event, handler) { + var events = event.split(/\s+/); + for (var i = 0; i < events.length; i++) { + if (el.addEventListener) { + el.addEventListener(events[i], handler); + } else { + el.attachEvent('on' + events[i], handler); + } + } + } + function removeEvent(el, event, handler) { + var events = event.split(/\s+/); + for (var i = 0; i < events.length; i++) { + if (el.removeEventListener) { + el.removeEventListener(events[i], handler); + } else { + el.detachEvent('on' + events[i], handler); + } + } + } + function getCssProperty(el, prop) { + if (window.getComputedStyle) { + return window.getComputedStyle(el, '').getPropertyValue(prop) || null; + } else if (el.currentStyle) { + return el.currentStyle[prop] || null; + } + return null; + } + function geById(el_or_id) { + if (typeof el_or_id == 'string' || el_or_id instanceof String) { + return document.getElementById(el_or_id); + } else if (el_or_id instanceof HTMLElement) { + return el_or_id; + } + return null; + } + + var getWidgetsOrigin = function(default_origin, dev_origin) { + var link = document.createElement('A'), origin; + link.href = document.currentScript && document.currentScript.src || default_origin; + origin = link.origin || link.protocol + '//' + link.hostname; + if (origin == 'https://telegram.org') { + origin = default_origin; + } else if (origin == 'https://telegram-js.azureedge.net' || origin == 'https://tg.dev') { + origin = dev_origin; + } + return origin; + }; + + var getPageCanonical = function() { + var a = document.createElement('A'), link, href; + if (document.querySelector) { + link = document.querySelector('link[rel="canonical"]'); + if (link && (href = link.getAttribute('href'))) { + a.href = href; + return a.href; + } + } else { + var links = document.getElementsByTagName('LINK'); + for (var i = 0; i < links.length; i++) { + if ((link = links[i]) && + (link.getAttribute('rel') == 'canonical') && + (href = link.getAttribute('href'))) { + a.href = href; + return a.href; + } + } + } + return false; + }; + + function getXHR() { + if (navigator.appName == "Microsoft Internet Explorer"){ + return new ActiveXObject("Microsoft.XMLHTTP"); + } else { + return new XMLHttpRequest(); + } + } + + if (!window.Telegram) { + window.Telegram = {}; + } + if (!window.Telegram.__WidgetUuid) { + window.Telegram.__WidgetUuid = 0; + } + if (!window.Telegram.__WidgetLastId) { + window.Telegram.__WidgetLastId = 0; + } + if (!window.Telegram.__WidgetCallbacks) { + window.Telegram.__WidgetCallbacks = {}; + } + + function postMessageToIframe(iframe, event, data, callback) { + try { + data = data || {}; + data.event = event; + if (callback) { + data._cb = ++window.Telegram.__WidgetLastId; + window.Telegram.__WidgetCallbacks[data._cb] = { + iframe: iframe, + callback: callback + }; + } + iframe.contentWindow.postMessage(JSON.stringify(data), '*'); + } catch(e) {} + } + + function initWidget(widgetEl) { + var widgetId, widgetElId, widgetsOrigin, existsEl, + src, styles = {}, allowedAttrs = [], + defWidth, defHeight, scrollable = false, onInitAuthUser, onAuthUser, onUnauth; + if (!widgetEl.tagName || + !(widgetEl.tagName.toUpperCase() == 'SCRIPT' || + widgetEl.tagName.toUpperCase() == 'BLOCKQUOTE' && + widgetEl.classList.contains('telegram-post'))) { + return null; + } + if (widgetEl._iframe) { + return widgetEl._iframe; + } + if (widgetId = widgetEl.getAttribute('data-telegram-post')) { + var comment = widgetEl.getAttribute('data-comment') || ''; + widgetsOrigin = getWidgetsOrigin('https://t.me', 'https://post.tg.dev'); + widgetElId = 'telegram-post-' + widgetId.replace(/[^a-z0-9_]/ig, '-') + (comment ? '-comment' + comment : ''); + src = widgetsOrigin + '/' + widgetId + '?embed=1'; + allowedAttrs = ['comment', 'userpic', 'single?', 'color', 'dark', 'dark_color']; + defWidth = widgetEl.getAttribute('data-width') || '100%'; + defHeight = ''; + styles.minWidth = '320px'; + } + else if (widgetId = widgetEl.getAttribute('data-telegram-discussion')) { + widgetsOrigin = getWidgetsOrigin('https://t.me', 'https://post.tg.dev'); + widgetElId = 'telegram-discussion-' + widgetId.replace(/[^a-z0-9_]/ig, '-') + '-' + (++window.Telegram.__WidgetUuid); + var websitePageUrl = widgetEl.getAttribute('data-page-url'); + if (!websitePageUrl) { + websitePageUrl = getPageCanonical(); + } + src = widgetsOrigin + '/' + widgetId + '?embed=1&discussion=1' + (websitePageUrl ? '&page_url=' + encodeURIComponent(websitePageUrl) : ''); + allowedAttrs = ['comments_limit', 'color', 'colorful', 'dark', 'dark_color', 'width', 'height']; + defWidth = widgetEl.getAttribute('data-width') || '100%'; + defHeight = widgetEl.getAttribute('data-height') || 0; + styles.minWidth = '320px'; + if (defHeight > 0) { + scrollable = true; + } + } + else if (widgetEl.hasAttribute('data-telegram-login')) { + widgetId = widgetEl.getAttribute('data-telegram-login'); + widgetsOrigin = getWidgetsOrigin('https://oauth.telegram.org', 'https://oauth.tg.dev'); + widgetElId = 'telegram-login-' + widgetId.replace(/[^a-z0-9_]/ig, '-'); + src = widgetsOrigin + '/embed/' + widgetId + '?origin=' + encodeURIComponent(location.origin || location.protocol + '//' + location.hostname); + allowedAttrs = ['size', 'userpic', 'init_auth', 'request_access', 'radius', 'min_width', 'max_width', 'lang']; + defWidth = 186; + defHeight = 28; + if (widgetEl.hasAttribute('data-size')) { + var size = widgetEl.getAttribute('data-size'); + if (size == 'small') defWidth = 148, defHeight = 20; + else if (size == 'large') defWidth = 238, defHeight = 40; + } + if (widgetEl.hasAttribute('data-onauth')) { + onInitAuthUser = onAuthUser = __parseFunction(widgetEl.getAttribute('data-onauth'), ['user']); + } + else if (widgetEl.hasAttribute('data-auth-url')) { + var a = document.createElement('A'); + a.href = widgetEl.getAttribute('data-auth-url'); + onAuthUser = function(user) { + var authUrl = a.href; + authUrl += (authUrl.indexOf('?') >= 0) ? '&' : '?'; + var params = []; + for (var key in user) { + params.push(key + '=' + encodeURIComponent(user[key])); + } + authUrl += params.join('&'); + location.href = authUrl; + }; + } + if (widgetEl.hasAttribute('data-onunauth')) { + onUnauth = __parseFunction(widgetEl.getAttribute('data-onunauth')); + } + } + else if (widgetId = widgetEl.getAttribute('data-telegram-share-url')) { + widgetsOrigin = getWidgetsOrigin('https://t.me', 'https://post.tg.dev'); + widgetElId = 'telegram-share-' + window.btoa(widgetId); + src = widgetsOrigin + '/share/embed?origin=' + encodeURIComponent(location.origin || location.protocol + '//' + location.hostname); + allowedAttrs = ['telegram-share-url', 'comment', 'size', 'text']; + defWidth = 60; + defHeight = 20; + if (widgetEl.getAttribute('data-size') == 'large') { + defWidth = 76; + defHeight = 28; + } + } + else { + return null; + } + existsEl = document.getElementById(widgetElId); + if (existsEl) { + return existsEl; + } + for (var i = 0; i < allowedAttrs.length; i++) { + var attr = allowedAttrs[i]; + var novalue = attr.substr(-1) == '?'; + if (novalue) { + attr = attr.slice(0, -1); + } + var data_attr = 'data-' + attr.replace(/_/g, '-'); + if (widgetEl.hasAttribute(data_attr)) { + var attr_value = novalue ? '1' : encodeURIComponent(widgetEl.getAttribute(data_attr)); + src += '&' + attr + '=' + attr_value; + } + } + function getCurCoords(iframe) { + var docEl = document.documentElement; + var frect = iframe.getBoundingClientRect(); + return { + frameTop: frect.top, + frameBottom: frect.bottom, + frameLeft: frect.left, + frameRight: frect.right, + frameWidth: frect.width, + frameHeight: frect.height, + scrollTop: window.pageYOffset, + scrollLeft: window.pageXOffset, + clientWidth: docEl.clientWidth, + clientHeight: docEl.clientHeight + }; + } + function visibilityHandler() { + if (isVisible(iframe, 50)) { + postMessageToIframe(iframe, 'visible', {frame: widgetElId}); + } + } + function focusHandler() { + postMessageToIframe(iframe, 'focus', {has_focus: document.hasFocus()}); + } + function postMessageHandler(event) { + if (event.source !== iframe.contentWindow || + event.origin != widgetsOrigin) { + return; + } + try { + var data = JSON.parse(event.data); + } catch(e) { + var data = {}; + } + if (data.event == 'resize') { + if (data.height) { + iframe.style.height = data.height + 'px'; + } + if (data.width) { + iframe.style.width = data.width + 'px'; + } + } + else if (data.event == 'ready') { + focusHandler(); + } + else if (data.event == 'visible_off') { + removeEvent(window, 'scroll', visibilityHandler); + removeEvent(window, 'resize', visibilityHandler); + } + else if (data.event == 'get_coords') { + postMessageToIframe(iframe, 'callback', { + _cb: data._cb, + value: getCurCoords(iframe) + }); + } + else if (data.event == 'scroll_to') { + try { + window.scrollTo(data.x || 0, data.y || 0); + } catch(e) {} + } + else if (data.event == 'auth_user') { + if (data.init) { + onInitAuthUser && onInitAuthUser(data.auth_data); + } else { + onAuthUser && onAuthUser(data.auth_data); + } + } + else if (data.event == 'unauthorized') { + onUnauth && onUnauth(); + } + else if (data.event == 'callback') { + var cb_data = null; + if (cb_data = window.Telegram.__WidgetCallbacks[data._cb]) { + if (cb_data.iframe === iframe) { + cb_data.callback(data.value); + delete window.Telegram.__WidgetCallbacks[data._cb]; + } + } else { + console.warn('Callback #' + data._cb + ' not found'); + } + } + } + var iframe = document.createElement('iframe'); + iframe.id = widgetElId; + iframe.src = src; + iframe.width = defWidth; + iframe.height = defHeight; + iframe.setAttribute('frameborder', '0'); + if (!scrollable) { + iframe.setAttribute('scrolling', 'no'); + iframe.style.overflow = 'hidden'; + } + iframe.style.border = 'none'; + for (var prop in styles) { + iframe.style[prop] = styles[prop]; + } + if (widgetEl.parentNode) { + widgetEl.parentNode.insertBefore(iframe, widgetEl); + if (widgetEl.tagName.toUpperCase() == 'BLOCKQUOTE') { + widgetEl.parentNode.removeChild(widgetEl); + } + } + widgetEl._iframe = iframe; + addEvent(iframe, 'load', function() { + removeEvent(iframe, 'load', visibilityHandler); + addEvent(window, 'scroll', visibilityHandler); + addEvent(window, 'resize', visibilityHandler); + visibilityHandler(); + }); + addEvent(window, 'focus blur', focusHandler); + addEvent(window, 'message', postMessageHandler); + return iframe; + } + function isVisible(el, padding) { + var node = el, val; + var visibility = getCssProperty(node, 'visibility'); + if (visibility == 'hidden') return false; + while (node) { + if (node === document.documentElement) break; + var display = getCssProperty(node, 'display'); + if (display == 'none') return false; + var opacity = getCssProperty(node, 'opacity'); + if (opacity !== null && opacity < 0.1) return false; + node = node.parentNode; + } + if (el.getBoundingClientRect) { + padding = +padding || 0; + var rect = el.getBoundingClientRect(); + var html = document.documentElement; + if (rect.bottom < padding || + rect.right < padding || + rect.top > (window.innerHeight || html.clientHeight) - padding || + rect.left > (window.innerWidth || html.clientWidth) - padding) { + return false; + } + } + return true; + } + + function getAllWidgets() { + var widgets = []; + if (document.querySelectorAll) { + widgets = document.querySelectorAll('script[data-telegram-post],blockquote.telegram-post,script[data-telegram-discussion],script[data-telegram-login],script[data-telegram-share-url]'); + } else { + widgets = Array.prototype.slice.apply(document.getElementsByTagName('SCRIPT')); + widgets = widgets.concat(Array.prototype.slice.apply(document.getElementsByTagName('BLOCKQUOTE'))); + } + return widgets; + } + + function getWidgetInfo(el_or_id, callback) { + var e = null, iframe = null; + if (el = geById(el_or_id)) { + if (el.tagName && + el.tagName.toUpperCase() == 'IFRAME') { + iframe = el; + } else if (el._iframe) { + iframe = el._iframe; + } + if (iframe && callback) { + postMessageToIframe(iframe, 'get_info', {}, callback); + } + } + } + + function setWidgetOptions(options, el_or_id) { + var e = null, iframe = null; + if (typeof el_or_id === 'undefined') { + var widgets = getAllWidgets(); + for (var i = 0; i < widgets.length; i++) { + if (iframe = widgets[i]._iframe) { + postMessageToIframe(iframe, 'set_options', {options: options}); + } + } + } else { + if (el = geById(el_or_id)) { + if (el.tagName && + el.tagName.toUpperCase() == 'IFRAME') { + iframe = el; + } else if (el._iframe) { + iframe = el._iframe; + } + if (iframe) { + postMessageToIframe(iframe, 'set_options', {options: options}); + } + } + } + } + + if (!document.currentScript || + !initWidget(document.currentScript)) { + var widgets = getAllWidgets(); + for (var i = 0; i < widgets.length; i++) { + initWidget(widgets[i]); + } + } + + var TelegramLogin = { + popups: {}, + auth: function(options, callback) { + var bot_id = parseInt(options.bot_id); + if (!bot_id) { + throw new Error('Bot id required'); + } + var width = 550; + var height = 470; + var left = Math.max(0, (screen.width - width) / 2) + (screen.availLeft | 0), + top = Math.max(0, (screen.height - height) / 2) + (screen.availTop | 0); + var onMessage = function (event) { + try { + var data = JSON.parse(event.data); + } catch(e) { + var data = {}; + } + if (!TelegramLogin.popups[bot_id]) return; + if (event.source !== TelegramLogin.popups[bot_id].window) return; + if (data.event == 'auth_result') { + onAuthDone(data.result); + } + }; + var onAuthDone = function (authData) { + if (!TelegramLogin.popups[bot_id]) return; + if (TelegramLogin.popups[bot_id].authFinished) return; + callback && callback(authData); + TelegramLogin.popups[bot_id].authFinished = true; + removeEvent(window, 'message', onMessage); + }; + var checkClose = function(bot_id) { + if (!TelegramLogin.popups[bot_id]) return; + if (!TelegramLogin.popups[bot_id].window || + TelegramLogin.popups[bot_id].window.closed) { + return TelegramLogin.getAuthData(options, function(origin, authData) { + onAuthDone(authData); + }); + } + setTimeout(checkClose, 100, bot_id); + } + var popup_url = Telegram.Login.widgetsOrigin + '/auth?bot_id=' + encodeURIComponent(options.bot_id) + '&origin=' + encodeURIComponent(location.origin || location.protocol + '//' + location.hostname) + (options.request_access ? '&request_access=' + encodeURIComponent(options.request_access) : '') + (options.lang ? '&lang=' + encodeURIComponent(options.lang) : ''); + var popup = window.open(popup_url, 'telegram_oauth_bot' + bot_id, 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',status=0,location=0,menubar=0,toolbar=0'); + TelegramLogin.popups[bot_id] = { + window: popup, + authFinished: false + }; + if (popup) { + addEvent(window, 'message', onMessage); + popup.focus(); + checkClose(bot_id); + } + }, + getAuthData: function(options, callback) { + var bot_id = parseInt(options.bot_id); + if (!bot_id) { + throw new Error('Bot id required'); + } + var xhr = getXHR(); + var url = Telegram.Login.widgetsOrigin + '/auth/get'; + xhr.open('POST', url); + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); + xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + xhr.onreadystatechange = function() { + if (xhr.readyState == 4) { + if (typeof xhr.responseBody == 'undefined' && xhr.responseText) { + try { + var result = JSON.parse(xhr.responseText); + } catch(e) { + var result = {}; + } + if (result.user) { + callback(result.origin, result.user); + } else { + callback(result.origin, false); + } + } else { + callback('*', false); + } + } + }; + xhr.onerror = function() { + callback('*', false); + }; + xhr.withCredentials = true; + xhr.send('bot_id=' + encodeURIComponent(options.bot_id) + (options.lang ? '&lang=' + encodeURIComponent(options.lang) : '')); + } + }; + + window.Telegram.getWidgetInfo = getWidgetInfo; + window.Telegram.setWidgetOptions = setWidgetOptions; + window.Telegram.Login = { + auth: TelegramLogin.auth, + widgetsOrigin: getWidgetsOrigin('https://oauth.telegram.org', 'https://oauth.tg.dev') + }; + + }(window)); +})(window); \ No newline at end of file diff --git a/data/telegram.org/press.html b/data/telegram.org/press.html new file mode 100644 index 0000000000..d54549ecad --- /dev/null +++ b/data/telegram.org/press.html @@ -0,0 +1,194 @@ + + + + + Articles about Telegram + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+ +
+ +
+

Articles about Telegram

+ +
+

These articles cover Telegram and its sponsor, global entrepreneur Pavel Durov.
For media requests, please contact @PressBot on Telegram.

+
+

English

+ +

Español

+ +

Italiano

+ +
+

Press contacts

+

If you would like to contact us, please contact @PressBot on Telegram.

+

Telegram logos

+

If you need Telegram logos, take these. Feel free to use them for article illustrations, graphs, “forward to Telegram” buttons, etc. Just make sure people understand you're not representing Telegram officially.

+

You can find some high-quality public-domain screenshots of Telegram on this page.

+

Telegram Widgets

+

If you would like to add Telegram share buttons, comments or other widgets to your website, please see this page.

+
+ +
+ +
+
+
+ + + + + + + diff --git a/data/telegram.org/privacy.html b/data/telegram.org/privacy.html new file mode 100644 index 0000000000..9ad0ae1d7c --- /dev/null +++ b/data/telegram.org/privacy.html @@ -0,0 +1,293 @@ + + + + + Telegram Privacy Policy + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+

Telegram Privacy Policy

+ +
+ + +

1. Introduction

+

This Privacy Policy sets out how we, Telegram Messenger Inc. (“Telegram”), use and protect your personal data that you provide to us, or that is otherwise obtained or generated by us, in connection with your use of our cloud-based messaging services (the “Services”). For the purposes of this Privacy Policy, ‘we’, ‘us’ and ‘our’ refers to Telegram, and ‘you’ refers to you, the user of the Services.

+

1.1 Privacy Principles

+

Telegram has two fundamental principles when it comes to collecting and processing private data:

+
    +
  • We don't use your data to show you ads.
  • +
  • We only store the data that Telegram needs to function as a secure and feature-rich messaging service.
  • +
+

1.2. Terms of Service

+

This Privacy Policy forms part of our Terms of Service, which describes the terms under which you use our Services and which are available at https://telegram.org/tos. This Privacy Policy should therefore be read in conjunction with those terms.

+

1.3. Table of Contents

+

This Privacy Policy explains the following:

+ +

1.4. EEA Representative

+

If you live in a country in the European Economic Area (EEA), the Services are provided by Telegram, which for the purposes of applicable data protection legislation is the data controller responsible for your personal data when you use our Services. However, as Telegram is located outside the EEA, we have designated one of our EEA-based group companies, Telegram UK Holdings Ltd (71-75 Shelton Street, Covent Garden, London, England, WC2H 9JQ), as a representative to whom you may direct any issues you have relating to our processing of your personal data.

+

2. Legal Ground for Processing Your Personal Data

+

We process your personal data on the ground that such processing is necessary to further our legitimate interests (including: (1) providing effective and innovative Services to our users; and (2) to detect, prevent or otherwise address fraud or security issues in respect of our provision of Services), unless those interests are overridden by your interest or fundamental rights and freedoms that require protections of personal data.

+

3. What Personal Data We Use

+

3.1. Basic Account Data

+

Telegram is a communication service. You provide your mobile number and basic account data (which may include profile name, profile picture and about information) to create a Telegram account.

+

To make it easier for your contacts and other people to reach you and recognize who you are, the screen name you choose, your profile pictures, and your username (should you choose to set one) on Telegram are always public. We don't want to know your real name, gender, age or what you like.

+

We do not require your screen name to be your real name. Note that users who have you in their contacts will see you by the name they saved and not by your screen name. This way your mother can have the public name 'Johnny Depp' while appearing as 'Mom' to you and as 'Boss' to her underlings at work (or the other way around, depending on how these relationships are structured).

+

3.2. Your E-mail Address

+

When you enable 2-step-verification for your account or store documents using the Telegram Passport feature, you can opt to set up a password recovery email. This address will only be used to send you a password recovery code if you forget it. That's right: no marketing or “we miss you” bullshit.

+

3.3. Your Messages

+
3.3.1. Cloud Chats
+

Telegram is a cloud service. We store messages, photos, videos and documents from your cloud chats on our servers so that you can access your data from any of your devices anytime without having to rely on third-party backups. All data is stored heavily encrypted and the encryption keys in each case are stored in several other data centers in different jurisdictions. This way local engineers or physical intruders cannot get access to user data.

+
3.3.2. Secret Chats
+

Secret chats use end-to-end encryption. This means that all data is encrypted with a key that only you and the recipient know. There is no way for us or anybody else without direct access to your device to learn what content is being sent in those messages. We do not store your secret chats on our servers. We also do not keep any logs for messages in secret chats, so after a short period of time we no longer know who or when you messaged via secret chats. For the same reasons secret chats are not available in the cloud — you can only access those messages from the device they were sent to or from.

+
3.3.3. Media in Secret Chats
+

When you send photos, videos or files via secret chats, before being uploaded, each item is encrypted with a separate key, not known to the server. This key and the file’s location are then encrypted again, this time with the secret chat’s key — and sent to your recipient. They can then download and decipher the file. This means that the file is technically on one of Telegram’s servers, but it looks like a piece of random indecipherable garbage to everyone except for you and the recipient. We don’t know what this random data stands for and we have no idea which particular chat it belongs to. We periodically purge this random data from our servers to save disk space.

+
3.3.4. Public Chats
+

In addition to private messages, Telegram also supports public channels and public groups. All public chats are cloud chats (see section 3.3.1 above). Like everything on Telegram, the data you post in public communities is encrypted, both in storage and in transit — but everything you post in public will be accessible to everyone.

+
3.4. Phone Number and Contacts
+

Telegram uses phone numbers as unique identifiers so that it is easy for you to switch from SMS and other messaging apps and retain your social graph. We ask your permission before syncing your contacts.

+

We store your up-to-date contacts in order to notify you as soon as one of your contacts signs up for Telegram and to properly display names in notifications. We only need the number and name (first and last) for this to work and store no other data about your contacts.

+

Our automatic algorithms can also use anonymized sets of phone numbers to calculate the average number of potential contacts an unregistered phone number may have on Telegram. When you open the 'Invite friends' interface, we display the resulting statistics next to your contacts to give you an idea of who could benefit most from joining Telegram.

+

You can always stop syncing contacts or delete them from our servers in Settings > Privacy & Security > Data Settings.

+
+

If you are using Android, Telegram will ask you for permission to access your phone call logs (READ_CALL_LOG). If you grant this permission, Telegram will be able verify your account by transmitting a phone call instead of asking you to enter a code. Telegram uses this permission only to confirm receipt of the confirmation call by verifying the number in the call log.

+
+

3.5. Location Data

+

If you share a location in a chat, this location data is treated like other messages in cloud or secret chats respectively.

+

If you share your Live Location in any chat or turn on ’Make Myself Visible’ in People Nearby, Telegram will use your data to display your location to those users with whom you are sharing it, even when the app is closed – for as long as you keep these optional features activated.

+
3.6. Cookies
+

The only cookies we use are those to operate and provide our Services on the web. We do not use cookies for profiling or advertising. The cookies we use are small text files that allow us to provide and customize our Services, and in doing so provide you with an enhanced user experience. Your browser should allow you to control these cookies, including whether or not to accept them and how to remove them. You may choose to block cookies with your web browser, however, if you do disable these cookies you will not be able to log in to Telegram Web.

+

4. Keeping Your Personal Data Safe

+

4.1. Storing Data

+

If you signed up for Telegram from the UK or the EEA, your data is stored in data centers in the Netherlands. These are third-party provided data centers in which Telegram rents a designated space. However, the servers and networks that sit inside these data centers and on which your personal data is stored are owned by Telegram. As such, we do not share your personal data with such data centers. All data is stored heavily encrypted so that local Telegram engineers or physical intruders cannot get access.

+

4.2. End-to-End Encrypted Data

+

Your messages, media and files from secret chats (see section 3.3.2 above), as well as the contents of your calls and the data you store in your Telegram Passport are processed only on your device and on the device of your recipient. Before this data reaches our servers, it is encrypted with a key known only to you and the recipient. While Telegram servers will handle this end-to-end encrypted data to deliver it to the recipient – or store it in the case of Telegram Passport data, we have no ways of deciphering the actual information. In this case, we neither store nor process your personal data, rather we store and process random sequences of symbols that have no meaning without the keys which we don’t have.

+

4.3. Retention

+

Unless stated otherwise in this Privacy Policy, the personal data that you provide us will only be stored for as long as it is necessary for us to fulfill our obligations in respect of the provision of the Services.

+

5. Processing Your Personal Data

+

5.1. Our Services

+

Telegram is a cloud service. We will process your data to deliver your cloud chat history, including messages, media and files, to any devices of your choosing without a need for you to use third-party backups or cloud storage.

+

5.2. Safety and Security

+

Telegram supports massive communities which we have to police against abuse and Terms of Service violations. Telegram also has more than 400 million users which makes it a lucrative target for spammers. To improve the security of your account, as well as to prevent spam, abuse, and other violations of our Terms of Service, we may collect metadata such as your IP address, devices and Telegram apps you've used, history of username changes, etc. If collected, this metadata can be kept for 12 months maximum.

+

5.3. Spam and Abuse

+

To prevent phishing, spam and other kinds of abuse and violations of Telegram’s Terms of Service, our moderators may check messages that were reported to them by their recipients. If a spam report on a message you sent is confirmed by our moderators, your account may be limited from contacting strangers – temporarily or permanently. You can send an appeal using @Spambot. In case of more serious violations, your account may be banned. We may also use automated algorithms to analyze messages in cloud chats to stop spam and phishing.

+

5.4. Cross-Device Functionality

+

We may also store some aggregated metadata to create Telegram features (see section 5.5 below) that work across all your devices.

+

5.5. Advanced features

+

We may use some aggregated data about how you use Telegram to build useful features. For example, when you open the Search menu, Telegram displays the people you are more likely to message in a box at the top of the screen. To do this, we calculate a rating that shows which people you message frequently. A similar rating is calculated for inline bots so that the app can suggest the bots you are most likely to use in the attachment menu (or when you start a new message with “@”). To turn this feature off and delete the relevant data, go to Settings > Privacy & Security > Data Settings and disable “Suggest Frequent Contacts”.

+

5.6. No Ads

+

Unlike other services, we don't use your data for ad targeting or other commercial purposes. Telegram only stores the information it needs to function as a secure and feature-rich cloud service.

+

6. Bot Messages

+

6.1. Ecosystem

+

Telegram has an API that allows third-party developers to create bots. Bots are apps that look like special Telegram users: you can talk to them from your chat list, add them to groups or use a special “inline” interface to access their features. By performing any of these actions, you will be sending some of your data to the respective third-party bot developers.

+

6.2. How Bots Can Receive Data

+

You can send data to bot developers when you interact with their bots in one of these ways:

+
    +
  • By sending messages to a bot.
  • +
  • By using an inline bot.
  • +
  • By participating in a group with a bot.
  • +
  • By pressing buttons in messages sent by a bot.
  • +
  • By paying for goods and services via bots (see section 7 below).
  • +
+

6.3. What Data Bots Receive

+

In any of the above cases, the developers of an automated user (bot) can get your public account data (see section 3.1 above): your screen name, username and profile picture(s).

+

Bots can also receive the following data when you interact with them.

+
    +
  • Bots will obviously get your messages when you send them something.
  • +
  • If you click on links or buttons provided by the bot, the bot can potentially get your IP address (provided that it controls the website to which the link leads).
  • +
  • If the bot is a member of the same group with you, it may know you are a member.
  • +
  • When you start your message with the username of an inline bot (e.g. @gif) the interface transforms so that everything you type becomes a query to that bot. This query is sent to the bot so that it can provide its service. We will warn you about this the first time you use an inline bot.
  • +
  • Bots added to groups can operate in two modes: with access to messages in the group or without access. If the bot has access to messages, it can see everything that happens in the group. The interface clearly shows whether or not a bot has access to messages in groups.
  • +
+

6.4. Bots Are Not Maintained by Telegram

+

Other than our own bots, no other bots or third-party bot developers are affiliated with Telegram. They are completely independent from us. They should ask you for your permission before they access your data or you make it available to them.

+ + +

7. Third Party Payment Services

+

7.1. Payment Information

+

The Payment Platform for Bots is available to users as of Telegram 4.0. Telegram does not process payments from users and instead relies on different payment providers around the world. It is the payment providers that handle and store your credit card details. Neither Telegram nor the merchants on the platform (bot developers) have access to this information. Although we work with payment providers they are completely independent from Telegram. Please study their relevant privacy policies before making your data available to them.

+

7.2. Credit Card Information

+

When making a purchase, you enter your credit card details into a form supplied by the payment provider that will be processing the payment, and this information goes directly to the payment provider's server. Your credit card information never reaches Telegram's servers. We do not access and do not store your credit card information. When you save your credit card info, it is saved on the respective payment provider's servers and the payment provider gives Telegram a token that you can reuse for future payments. It is not possible to reconstruct your credit card info from the token.

+

7.3 Shipping Information

+

When you enter shipping information in the process of placing an order, we send it directly to the merchant bot developer. We can store your shipping information for you if you choose to save it for future purchases. We will delete this information immediately if you ask us to.

+

7.4. Clearing Payment Information

+

You can clear all payment information associated with your account at any time by going to Telegram Settings > Privacy & Security > Data Settings and selecting ‘Clear Payment & Shipping Info’. If you choose to remove your payment information, we will delete your stored shipping info and payment tokens from all providers and ask the payment providers to remove your credit card information that they store.

+

7.5. Payment Disputes

+

Due to the fact that Telegram doesn't store any credit card details or transaction information, it is impossible for us to handle complaints or cashbacks – any disputed payments are the responsibility of the bot developers, payment providers, and banks that participated in the exchange.

+

8. Who Your Personal Data May Be Shared With

+

8.1. Other Telegram Users

+

Other users of our Services with whom you choose to communicate with and share certain information, who may be located outside the EEA. Note that by entering into the Terms of Service and choosing to communicate with such other users of Telegram, you are instructing us to transfer your personal data, on your behalf, to those users in accordance with this Privacy Policy. We employ all appropriate technical and organizational measures (including encryption of your personal data) to ensure a level of security for your personal data that is appropriate to the risk.

+

8.2. Telegram’s Group Companies

+

We may share your personal data with: (1) our parent company, Telegram Group Inc, located in the British Virgin Islands; and (2) Telegram FZ-LLC, a group member located in Dubai, to help provide, improve and support our Services. We will implement appropriate safeguards to protect the security and integrity of that personal data. This will take the form of standard contract clauses approved by the European Commission in an agreement between us and our relevant group companies. If you would like more information regarding these clauses, please contact us using the details in section 12 below.

+

8.3. Law Enforcement Authorities

+

If Telegram receives a court order that confirms you're a terror suspect, we may disclose your IP address and phone number to the relevant authorities. So far, this has never happened. When it does, we will include it in a semiannual transparency report published at: https://t.me/transparency.

+

9. Your Rights Regarding the Personal Data You Provide to Us

+

9.1. Your Rights

+

Under applicable data protection legislation, in certain circumstances, you have rights concerning your personal data. You have a right to: (1) request a copy of all your personal data that we store and to transmit that copy to another data controller; (2) delete (see section 10 below) or amend your personal data; (3) restrict, or object to, the processing of your personal data; (4) correct any inaccurate or incomplete personal data we hold on you; and (5) lodge a complaint with national data protection authorities regarding our processing of your personal data.

+

9.2. Exercising Your Rights

+

If you wish to exercise any of these rights, kindly contact us using the details in section 12 below.

+

9.3. Data Settings

+

You can control how your data is used (e.g., delete synced contacts) in Settings > Privacy & Security > Data Settings (using one of our mobile apps).

+

Sadly, if you're generally not OK with Telegram's modest requirements, it won't be possible for us to provide you with our Services. You can delete your Telegram account by proceeding to the deactivation page.

+

10. Deleting data

+

10.1. Accounts

+

If you would like to delete your account, you can do this on the deactivation page. Deleting your account removes all messages, media, contacts and every other piece of data you store in the Telegram cloud. This action must be confirmed via your Telegram account and cannot be undone.

+

10.2. Messages

+
    +
  • In secret chats, deleting a message always instructs the app on the other end to delete it too.
  • +
  • In cloud chats, you can choose to delete a message for all participants within at least 48 hours after sending. Otherwise, deleting a message will delete it from your message history. This means that a copy will stay on the server as part of your partner's message history. As soon as your partner deletes it too, it's gone forever.
  • +
  • As of version 5.5, any party can choose to delete any messages in one-on-one chats, both sent and received, for both sides. There is no time limit. Any party can also opt to clear the entire chat history for both parties, in which case the apps will be instructed to remove all messages in that chat, however many of them are still retained by either of the participants.
  • +
  • In supergroups and channels, deleting a message removes it for all participants. Note that deleted messages and original versions of edited messages from supergroups are stored for 48 hours after deletion in order to be shown in the admins log.
  • +
+

10.3. Self-Destructing Messages

+

Messages in Secret Chats can be ordered to self-destruct. As soon as such a message is read (2 checks appear), the countdown starts. When the timer expires, both devices participating in a secret chat are instructed to delete the message (photo, video, etc.). Media with short timers (less than a minute) are shown with blurred previews. The timer is triggered when they are viewed.

+

10.4. Account Self-Destruction

+

By default, if you stop using Telegram and do not come online for at least 6 months, your account will be deleted along with all messages, media, contacts and every other piece of data you store in the Telegram cloud. You can go to Settings to change the exact period after which your inactive account will self-destruct.

+

11. Changes to this Privacy Policy

+

We will review and may update this Privacy Policy from time to time. Any changes to this Privacy Policy will become effective when we post the revised Privacy Policy on this page www.telegram.org/privacy. Please check our website frequently to see any updates or changes to our Privacy Policy, a summary of which we will set out below.

+

March 25, 2019

+
    +
  • Expanded [10.2. Deleting Messages] with data on the new features in version 5.5, which allow both participants to remove any messages from one-on-one chats for both sides without a time limit.
  • +
+

March 24, 2021

+ +

Important changes made to this Privacy Policy will be notified to you via Telegram.

+

12. Questions and concerns

+

If you have any questions about privacy and our data policies, please contact our @GDPRbot. Use the /access command to learn how to get a copy of your Telegram data and use the /contact command to leave a request, which we will answer at the earliest opportunity.

+

Telegram is an open source project. You can examine more information on our:

+ +
+

This policy has been expanded on August 14, 2018 to add information required by the EU data protection law.

+
+ +
+ +
+
+
+ + + + + + + + + diff --git a/data/telegram.org/support.html b/data/telegram.org/support.html new file mode 100644 index 0000000000..6c75908ef0 --- /dev/null +++ b/data/telegram.org/support.html @@ -0,0 +1,138 @@ + + + + + Telegram support + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+

Support

+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+ +
+
+
+ + + + + + + diff --git a/data/telegram.org/teststore.html b/data/telegram.org/teststore.html new file mode 100644 index 0000000000..627632aa1c --- /dev/null +++ b/data/telegram.org/teststore.html @@ -0,0 +1,284 @@ + + + + + Telegram Messenger + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ + + + + + +
+ +

Why Telegram?

+ +
+
+
+
+

Simple

+
Telegram is so simple you already know how to use it.
+
+
+ +
+
+
+

Private

+
Telegram messages are heavily encrypted and can self-destruct.
+
+
+ +
+
+
+

Synced

+
Telegram lets you access your chats from multiple devices.
+
+
+ +
+
+
+

Fast

+
Telegram delivers messages faster than any other application.
+
+
+ +
+
+
+

Powerful

+
Telegram has no limits on the size of your media and chats.
+
+
+ +
+
+
+

Open

+
Telegram has an open API and source code free for everyone.
+
+
+ +
+
+
+

Secure

+
Telegram keeps your messages safe from hacker attacks.
+
+
+ +
+
+
+

Social

+
Telegram groups can hold up to 200,000 members.
+
+
+ +
+
+
+

Expressive

+
Telegram lets you completely customize your messenger.
+
+
+
+ +
+ +
+ +
+
+
+ + + + + + + + diff --git a/data/telegram.org/tour/screenshots.html b/data/telegram.org/tour/screenshots.html new file mode 100644 index 0000000000..0953632283 --- /dev/null +++ b/data/telegram.org/tour/screenshots.html @@ -0,0 +1,217 @@ + + + + + Telegram Logos and App Screenshots + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Telegram Logos and App Screenshots

+ +
+ +
+ +

Logos

+

Please feel free to use these Telegram logos for article illustrations, graphs, “forward to Telegram” buttons, etc. Just make sure people understand you're not representing Telegram officially.

+
+

Download Telegram Logos

+
+

Screenshots

+

All Telegram screenshots on this page are dedicated to the public domain, see CC0 1.0 Universal. Click on images to download hi-res versions.

+
+
+ List of chats, main screen of the Telegram app +

List of chats

+
+
+ A group chat with 2,500 members and a poll +

Group chat with poll

+
+ +
+
+ A secret chat with disappearing media as viewed on a device with dark mode enabled +

Secret chat using a dark theme

+
+
+ A private chat with a user, open sticker panel +

Private chat with stickers

+
+ +
+
+ Shared media section, accessible from a contact's profile page +

Shared media section from a chat

+
+
+ Group chat, dowloading a large file in progress +

Group chat with a downloading file

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/verify.html b/data/telegram.org/verify.html new file mode 100644 index 0000000000..8d6f6587ca --- /dev/null +++ b/data/telegram.org/verify.html @@ -0,0 +1,151 @@ + + + + + Page Verification Guidelines + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+

Page Verification Guidelines

+ +
+ Verification +
+ +

The Telegram team generally verifies active official channels, bots or public groups that have verified accounts on at least two of these services:

+
    +
  1. TikTok
  2. +
  3. Instagram
  4. +
  5. Facebook
  6. +
  7. YouTube
  8. +
  9. Twitter
  10. +
  11. VK
  12. +
  13. Snapchat
  14. +
+

Please add a link to your Telegram channel to your profiles on these services — so that we can confirm that they indeed belong to you. Once this is done, please contact our @VerifyBot for verification.

+

What if I don't have a verified account on two of these services?

+

If you have an undisputed page on Wikipedia, that satisfies Wikipedia's Notability Guidelines – and that page lists a link to your channel, bot or public group on Telegram – it can be counted as one of the missing verified accounts.

+

In the case of organizations, a link to the Telegram channel from the official website of the organization may also be taken into account. The bot will offer to submit additional data and comments after checking the social media links.

+
+

If you're using a Wikipedia or Official Website link instead of one of the social media accounts, please make sure that they include a link to the channel, group or bot you want to verify on Telegram.

+
+

Can my user account be verified?

+

Sorry, Telegram doesn’t verify user accounts at the moment. Verification is only available for big and active official channels, groups and bots.

+

Do I need verification?

+

Note that verification doesn't give any additional abilities in Telegram - it is simply one of the ways to demonstrate that your channel, group or bot is official. A link to Telegram on your official site or other official accounts elsewhere can achieve a similar result.

+

How do I change the name or short link after verification?

+

A verified channel, group or bot can't change its name or short link (t.me/…). If changes are necessary, you can remove verification status first. Contact @VerifyBot and send /unverify. You can then reobtain verification using the bot.

+
+ +
+
+ +
+
+
+ + + + + + + diff --git a/data/telegram.org/what-can-you-do-with-Telegram.html b/data/telegram.org/what-can-you-do-with-Telegram.html new file mode 100644 index 0000000000..627632aa1c --- /dev/null +++ b/data/telegram.org/what-can-you-do-with-Telegram.html @@ -0,0 +1,284 @@ + + + + + Telegram Messenger + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ + + + + + +
+ +

Why Telegram?

+ +
+
+
+
+

Simple

+
Telegram is so simple you already know how to use it.
+
+
+ +
+
+
+

Private

+
Telegram messages are heavily encrypted and can self-destruct.
+
+
+ +
+
+
+

Synced

+
Telegram lets you access your chats from multiple devices.
+
+
+ +
+
+
+

Fast

+
Telegram delivers messages faster than any other application.
+
+
+ +
+
+
+

Powerful

+
Telegram has no limits on the size of your media and chats.
+
+
+ +
+
+
+

Open

+
Telegram has an open API and source code free for everyone.
+
+
+ +
+
+
+

Secure

+
Telegram keeps your messages safe from hacker attacks.
+
+
+ +
+
+
+

Social

+
Telegram groups can hold up to 200,000 members.
+
+
+ +
+
+
+

Expressive

+
Telegram lets you completely customize your messenger.
+
+
+
+ +
+ +
+ +
+
+
+ + + + + + + + diff --git a/data/themes.telegram.org.html b/data/themes.telegram.org.html new file mode 100644 index 0000000000..bc682d4a3d --- /dev/null +++ b/data/themes.telegram.org.html @@ -0,0 +1,162 @@ + + + + + Telegram Themes + + + + + + + + + + + + + + + + + + + +
+ +
+ Don't have Telegram yet? Try it now + +
+
+
+

Telegram Theme Editor

+

The online theme editor allows you to create and modify your existing cloud themes for every platform. Any changes will appear in the apps immediately after you save them.

+ +
+
+ + + + + + + + + + + + + diff --git a/data/themes.telegram.org/auth.html b/data/themes.telegram.org/auth.html new file mode 100644 index 0000000000..f37b428a19 --- /dev/null +++ b/data/themes.telegram.org/auth.html @@ -0,0 +1,163 @@ + + + + + Telegram Themes + + + + + + + + + + + + + + + + + + + +
+ +
+ Don't have Telegram yet? Try it now + +
+
+
+

Telegram Theme Editor

+

The online theme editor allows you to create and modify your existing cloud themes for every platform. Any changes will appear in the apps immediately after you save them.

+ +
+
+ + + + + + + + + + + + + diff --git a/data/themes.telegram.org/css/bootstrap-extra.css b/data/themes.telegram.org/css/bootstrap-extra.css new file mode 100644 index 0000000000..8a35b6069b --- /dev/null +++ b/data/themes.telegram.org/css/bootstrap-extra.css @@ -0,0 +1,3274 @@ +/* glyph */ +@font-face { + font-family: 'Glyphicons Halflings'; + src: url('../fonts/glyphicons-halflings-regular.eot'); + src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); +} +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.glyphicon-asterisk:before { + content: "\2a"; +} +.glyphicon-plus:before { + content: "\2b"; +} +.glyphicon-euro:before { + content: "\20ac"; +} +.glyphicon-minus:before { + content: "\2212"; +} +.glyphicon-cloud:before { + content: "\2601"; +} +.glyphicon-envelope:before { + content: "\2709"; +} +.glyphicon-pencil:before { + content: "\270f"; +} +.glyphicon-glass:before { + content: "\e001"; +} +.glyphicon-music:before { + content: "\e002"; +} +.glyphicon-search:before { + content: "\e003"; +} +.glyphicon-heart:before { + content: "\e005"; +} +.glyphicon-star:before { + content: "\e006"; +} +.glyphicon-star-empty:before { + content: "\e007"; +} +.glyphicon-user:before { + content: "\e008"; +} +.glyphicon-film:before { + content: "\e009"; +} +.glyphicon-th-large:before { + content: "\e010"; +} +.glyphicon-th:before { + content: "\e011"; +} +.glyphicon-th-list:before { + content: "\e012"; +} +.glyphicon-ok:before { + content: "\e013"; +} +.glyphicon-remove:before { + content: "\e014"; +} +.glyphicon-zoom-in:before { + content: "\e015"; +} +.glyphicon-zoom-out:before { + content: "\e016"; +} +.glyphicon-off:before { + content: "\e017"; +} +.glyphicon-signal:before { + content: "\e018"; +} +.glyphicon-cog:before { + content: "\e019"; +} +.glyphicon-trash:before { + content: "\e020"; +} +.glyphicon-home:before { + content: "\e021"; +} +.glyphicon-file:before { + content: "\e022"; +} +.glyphicon-time:before { + content: "\e023"; +} +.glyphicon-road:before { + content: "\e024"; +} +.glyphicon-download-alt:before { + content: "\e025"; +} +.glyphicon-download:before { + content: "\e026"; +} +.glyphicon-upload:before { + content: "\e027"; +} +.glyphicon-inbox:before { + content: "\e028"; +} +.glyphicon-play-circle:before { + content: "\e029"; +} +.glyphicon-repeat:before { + content: "\e030"; +} +.glyphicon-refresh:before { + content: "\e031"; +} +.glyphicon-list-alt:before { + content: "\e032"; +} +.glyphicon-lock:before { + content: "\e033"; +} +.glyphicon-flag:before { + content: "\e034"; +} +.glyphicon-headphones:before { + content: "\e035"; +} +.glyphicon-volume-off:before { + content: "\e036"; +} +.glyphicon-volume-down:before { + content: "\e037"; +} +.glyphicon-volume-up:before { + content: "\e038"; +} +.glyphicon-qrcode:before { + content: "\e039"; +} +.glyphicon-barcode:before { + content: "\e040"; +} +.glyphicon-tag:before { + content: "\e041"; +} +.glyphicon-tags:before { + content: "\e042"; +} +.glyphicon-book:before { + content: "\e043"; +} +.glyphicon-bookmark:before { + content: "\e044"; +} +.glyphicon-print:before { + content: "\e045"; +} +.glyphicon-camera:before { + content: "\e046"; +} +.glyphicon-font:before { + content: "\e047"; +} +.glyphicon-bold:before { + content: "\e048"; +} +.glyphicon-italic:before { + content: "\e049"; +} +.glyphicon-text-height:before { + content: "\e050"; +} +.glyphicon-text-width:before { + content: "\e051"; +} +.glyphicon-align-left:before { + content: "\e052"; +} +.glyphicon-align-center:before { + content: "\e053"; +} +.glyphicon-align-right:before { + content: "\e054"; +} +.glyphicon-align-justify:before { + content: "\e055"; +} +.glyphicon-list:before { + content: "\e056"; +} +.glyphicon-indent-left:before { + content: "\e057"; +} +.glyphicon-indent-right:before { + content: "\e058"; +} +.glyphicon-facetime-video:before { + content: "\e059"; +} +.glyphicon-picture:before { + content: "\e060"; +} +.glyphicon-map-marker:before { + content: "\e062"; +} +.glyphicon-adjust:before { + content: "\e063"; +} +.glyphicon-tint:before { + content: "\e064"; +} +.glyphicon-edit:before { + content: "\e065"; +} +.glyphicon-share:before { + content: "\e066"; +} +.glyphicon-check:before { + content: "\e067"; +} +.glyphicon-move:before { + content: "\e068"; +} +.glyphicon-step-backward:before { + content: "\e069"; +} +.glyphicon-fast-backward:before { + content: "\e070"; +} +.glyphicon-backward:before { + content: "\e071"; +} +.glyphicon-play:before { + content: "\e072"; +} +.glyphicon-pause:before { + content: "\e073"; +} +.glyphicon-stop:before { + content: "\e074"; +} +.glyphicon-forward:before { + content: "\e075"; +} +.glyphicon-fast-forward:before { + content: "\e076"; +} +.glyphicon-step-forward:before { + content: "\e077"; +} +.glyphicon-eject:before { + content: "\e078"; +} +.glyphicon-chevron-left:before { + content: "\e079"; +} +.glyphicon-chevron-right:before { + content: "\e080"; +} +.glyphicon-plus-sign:before { + content: "\e081"; +} +.glyphicon-minus-sign:before { + content: "\e082"; +} +.glyphicon-remove-sign:before { + content: "\e083"; +} +.glyphicon-ok-sign:before { + content: "\e084"; +} +.glyphicon-question-sign:before { + content: "\e085"; +} +.glyphicon-info-sign:before { + content: "\e086"; +} +.glyphicon-screenshot:before { + content: "\e087"; +} +.glyphicon-remove-circle:before { + content: "\e088"; +} +.glyphicon-ok-circle:before { + content: "\e089"; +} +.glyphicon-ban-circle:before { + content: "\e090"; +} +.glyphicon-arrow-left:before { + content: "\e091"; +} +.glyphicon-arrow-right:before { + content: "\e092"; +} +.glyphicon-arrow-up:before { + content: "\e093"; +} +.glyphicon-arrow-down:before { + content: "\e094"; +} +.glyphicon-share-alt:before { + content: "\e095"; +} +.glyphicon-resize-full:before { + content: "\e096"; +} +.glyphicon-resize-small:before { + content: "\e097"; +} +.glyphicon-exclamation-sign:before { + content: "\e101"; +} +.glyphicon-gift:before { + content: "\e102"; +} +.glyphicon-leaf:before { + content: "\e103"; +} +.glyphicon-fire:before { + content: "\e104"; +} +.glyphicon-eye-open:before { + content: "\e105"; +} +.glyphicon-eye-close:before { + content: "\e106"; +} +.glyphicon-warning-sign:before { + content: "\e107"; +} +.glyphicon-plane:before { + content: "\e108"; +} +.glyphicon-calendar:before { + content: "\e109"; +} +.glyphicon-random:before { + content: "\e110"; +} +.glyphicon-comment:before { + content: "\e111"; +} +.glyphicon-magnet:before { + content: "\e112"; +} +.glyphicon-chevron-up:before { + content: "\e113"; +} +.glyphicon-chevron-down:before { + content: "\e114"; +} +.glyphicon-retweet:before { + content: "\e115"; +} +.glyphicon-shopping-cart:before { + content: "\e116"; +} +.glyphicon-folder-close:before { + content: "\e117"; +} +.glyphicon-folder-open:before { + content: "\e118"; +} +.glyphicon-resize-vertical:before { + content: "\e119"; +} +.glyphicon-resize-horizontal:before { + content: "\e120"; +} +.glyphicon-hdd:before { + content: "\e121"; +} +.glyphicon-bullhorn:before { + content: "\e122"; +} +.glyphicon-bell:before { + content: "\e123"; +} +.glyphicon-certificate:before { + content: "\e124"; +} +.glyphicon-thumbs-up:before { + content: "\e125"; +} +.glyphicon-thumbs-down:before { + content: "\e126"; +} +.glyphicon-hand-right:before { + content: "\e127"; +} +.glyphicon-hand-left:before { + content: "\e128"; +} +.glyphicon-hand-up:before { + content: "\e129"; +} +.glyphicon-hand-down:before { + content: "\e130"; +} +.glyphicon-circle-arrow-right:before { + content: "\e131"; +} +.glyphicon-circle-arrow-left:before { + content: "\e132"; +} +.glyphicon-circle-arrow-up:before { + content: "\e133"; +} +.glyphicon-circle-arrow-down:before { + content: "\e134"; +} +.glyphicon-globe:before { + content: "\e135"; +} +.glyphicon-wrench:before { + content: "\e136"; +} +.glyphicon-tasks:before { + content: "\e137"; +} +.glyphicon-filter:before { + content: "\e138"; +} +.glyphicon-briefcase:before { + content: "\e139"; +} +.glyphicon-fullscreen:before { + content: "\e140"; +} +.glyphicon-dashboard:before { + content: "\e141"; +} +.glyphicon-paperclip:before { + content: "\e142"; +} +.glyphicon-heart-empty:before { + content: "\e143"; +} +.glyphicon-link:before { + content: "\e144"; +} +.glyphicon-phone:before { + content: "\e145"; +} +.glyphicon-pushpin:before { + content: "\e146"; +} +.glyphicon-usd:before { + content: "\e148"; +} +.glyphicon-gbp:before { + content: "\e149"; +} +.glyphicon-sort:before { + content: "\e150"; +} +.glyphicon-sort-by-alphabet:before { + content: "\e151"; +} +.glyphicon-sort-by-alphabet-alt:before { + content: "\e152"; +} +.glyphicon-sort-by-order:before { + content: "\e153"; +} +.glyphicon-sort-by-order-alt:before { + content: "\e154"; +} +.glyphicon-sort-by-attributes:before { + content: "\e155"; +} +.glyphicon-sort-by-attributes-alt:before { + content: "\e156"; +} +.glyphicon-unchecked:before { + content: "\e157"; +} +.glyphicon-expand:before { + content: "\e158"; +} +.glyphicon-collapse-down:before { + content: "\e159"; +} +.glyphicon-collapse-up:before { + content: "\e160"; +} +.glyphicon-log-in:before { + content: "\e161"; +} +.glyphicon-flash:before { + content: "\e162"; +} +.glyphicon-log-out:before { + content: "\e163"; +} +.glyphicon-new-window:before { + content: "\e164"; +} +.glyphicon-record:before { + content: "\e165"; +} +.glyphicon-save:before { + content: "\e166"; +} +.glyphicon-open:before { + content: "\e167"; +} +.glyphicon-saved:before { + content: "\e168"; +} +.glyphicon-import:before { + content: "\e169"; +} +.glyphicon-export:before { + content: "\e170"; +} +.glyphicon-send:before { + content: "\e171"; +} +.glyphicon-floppy-disk:before { + content: "\e172"; +} +.glyphicon-floppy-saved:before { + content: "\e173"; +} +.glyphicon-floppy-remove:before { + content: "\e174"; +} +.glyphicon-floppy-save:before { + content: "\e175"; +} +.glyphicon-floppy-open:before { + content: "\e176"; +} +.glyphicon-credit-card:before { + content: "\e177"; +} +.glyphicon-transfer:before { + content: "\e178"; +} +.glyphicon-cutlery:before { + content: "\e179"; +} +.glyphicon-header:before { + content: "\e180"; +} +.glyphicon-compressed:before { + content: "\e181"; +} +.glyphicon-earphone:before { + content: "\e182"; +} +.glyphicon-phone-alt:before { + content: "\e183"; +} +.glyphicon-tower:before { + content: "\e184"; +} +.glyphicon-stats:before { + content: "\e185"; +} +.glyphicon-sd-video:before { + content: "\e186"; +} +.glyphicon-hd-video:before { + content: "\e187"; +} +.glyphicon-subtitles:before { + content: "\e188"; +} +.glyphicon-sound-stereo:before { + content: "\e189"; +} +.glyphicon-sound-dolby:before { + content: "\e190"; +} +.glyphicon-sound-5-1:before { + content: "\e191"; +} +.glyphicon-sound-6-1:before { + content: "\e192"; +} +.glyphicon-sound-7-1:before { + content: "\e193"; +} +.glyphicon-copyright-mark:before { + content: "\e194"; +} +.glyphicon-registration-mark:before { + content: "\e195"; +} +.glyphicon-cloud-download:before { + content: "\e197"; +} +.glyphicon-cloud-upload:before { + content: "\e198"; +} +.glyphicon-tree-conifer:before { + content: "\e199"; +} +.glyphicon-tree-deciduous:before { + content: "\e200"; +} + + +/*btn*/ +.btn { + display: inline-block; + margin-bottom: 0; + font-weight: normal; + text-align: center; + vertical-align: middle; + cursor: pointer; + background-image: none; + border: 1px solid transparent; + white-space: nowrap; + padding: 6px 12px; + font-size: 12px; + line-height: 1.42857143; + border-radius: 4px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.btn:focus, +.btn:active:focus, +.btn.active:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn:hover, +.btn:focus { + color: #333333; + text-decoration: none; +} +.btn:active, +.btn.active { + outline: 0; + background-image: none; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn.disabled, +.btn[disabled], +fieldset[disabled] .btn { + cursor: not-allowed; + pointer-events: none; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-default { + color: #333333; + background-color: #ffffff; + border-color: #cccccc; +} +.btn-default:hover, +.btn-default:focus, +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + color: #333333; + background-color: #e6e6e6; + border-color: #adadad; +} +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + background-image: none; +} +.btn-default.disabled, +.btn-default[disabled], +fieldset[disabled] .btn-default, +.btn-default.disabled:hover, +.btn-default[disabled]:hover, +fieldset[disabled] .btn-default:hover, +.btn-default.disabled:focus, +.btn-default[disabled]:focus, +fieldset[disabled] .btn-default:focus, +.btn-default.disabled:active, +.btn-default[disabled]:active, +fieldset[disabled] .btn-default:active, +.btn-default.disabled.active, +.btn-default[disabled].active, +fieldset[disabled] .btn-default.active { + background-color: #ffffff; + border-color: #cccccc; +} +.btn-default .badge { + color: #ffffff; + background-color: #333333; +} +.btn-primary { + color: #ffffff; + background-color: #428bca; + border-color: #357ebd; +} +.btn-primary:hover, +.btn-primary:focus, +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + color: #ffffff; + background-color: #3071a9; + border-color: #285e8e; +} +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + background-image: none; +} +.btn-primary.disabled, +.btn-primary[disabled], +fieldset[disabled] .btn-primary, +.btn-primary.disabled:hover, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary:hover, +.btn-primary.disabled:focus, +.btn-primary[disabled]:focus, +fieldset[disabled] .btn-primary:focus, +.btn-primary.disabled:active, +.btn-primary[disabled]:active, +fieldset[disabled] .btn-primary:active, +.btn-primary.disabled.active, +.btn-primary[disabled].active, +fieldset[disabled] .btn-primary.active { + background-color: #428bca; + border-color: #357ebd; +} +.btn-primary .badge { + color: #428bca; + background-color: #ffffff; +} +.btn-success { + color: #ffffff; + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success:hover, +.btn-success:focus, +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + color: #ffffff; + background-color: #449d44; + border-color: #398439; +} +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + background-image: none; +} +.btn-success.disabled, +.btn-success[disabled], +fieldset[disabled] .btn-success, +.btn-success.disabled:hover, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success:hover, +.btn-success.disabled:focus, +.btn-success[disabled]:focus, +fieldset[disabled] .btn-success:focus, +.btn-success.disabled:active, +.btn-success[disabled]:active, +fieldset[disabled] .btn-success:active, +.btn-success.disabled.active, +.btn-success[disabled].active, +fieldset[disabled] .btn-success.active { + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success .badge { + color: #5cb85c; + background-color: #ffffff; +} +.btn-info { + color: #ffffff; + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info:hover, +.btn-info:focus, +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + color: #ffffff; + background-color: #31b0d5; + border-color: #269abc; +} +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + background-image: none; +} +.btn-info.disabled, +.btn-info[disabled], +fieldset[disabled] .btn-info, +.btn-info.disabled:hover, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info:hover, +.btn-info.disabled:focus, +.btn-info[disabled]:focus, +fieldset[disabled] .btn-info:focus, +.btn-info.disabled:active, +.btn-info[disabled]:active, +fieldset[disabled] .btn-info:active, +.btn-info.disabled.active, +.btn-info[disabled].active, +fieldset[disabled] .btn-info.active { + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info .badge { + color: #5bc0de; + background-color: #ffffff; +} +.btn-warning { + color: #ffffff; + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning:hover, +.btn-warning:focus, +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + color: #ffffff; + background-color: #ec971f; + border-color: #d58512; +} +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + background-image: none; +} +.btn-warning.disabled, +.btn-warning[disabled], +fieldset[disabled] .btn-warning, +.btn-warning.disabled:hover, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning:hover, +.btn-warning.disabled:focus, +.btn-warning[disabled]:focus, +fieldset[disabled] .btn-warning:focus, +.btn-warning.disabled:active, +.btn-warning[disabled]:active, +fieldset[disabled] .btn-warning:active, +.btn-warning.disabled.active, +.btn-warning[disabled].active, +fieldset[disabled] .btn-warning.active { + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning .badge { + color: #f0ad4e; + background-color: #ffffff; +} +.btn-danger { + color: #ffffff; + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger:hover, +.btn-danger:focus, +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + color: #ffffff; + background-color: #c9302c; + border-color: #ac2925; +} +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + background-image: none; +} +.btn-danger.disabled, +.btn-danger[disabled], +fieldset[disabled] .btn-danger, +.btn-danger.disabled:hover, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger:hover, +.btn-danger.disabled:focus, +.btn-danger[disabled]:focus, +fieldset[disabled] .btn-danger:focus, +.btn-danger.disabled:active, +.btn-danger[disabled]:active, +fieldset[disabled] .btn-danger:active, +.btn-danger.disabled.active, +.btn-danger[disabled].active, +fieldset[disabled] .btn-danger.active { + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger .badge { + color: #d9534f; + background-color: #ffffff; +} +.btn-link { + color: #0088cc; + font-weight: normal; + cursor: pointer; + border-radius: 0; +} +.btn-link, +.btn-link:active, +.btn-link[disabled], +fieldset[disabled] .btn-link { + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-link, +.btn-link:hover, +.btn-link:focus, +.btn-link:active { + border-color: transparent; +} +.btn-link:hover, +.btn-link:focus { + color: #0088cc; + text-decoration: underline; + background-color: transparent; +} +.btn-link[disabled]:hover, +fieldset[disabled] .btn-link:hover, +.btn-link[disabled]:focus, +fieldset[disabled] .btn-link:focus { + color: #777777; + text-decoration: none; +} +.btn-lg { + padding: 10px 16px; + font-size: 15px; + line-height: 1.33; + border-radius: 6px; +} +.btn-sm { + padding: 5px 10px; + font-size: 11px; + line-height: 1.5; + border-radius: 3px; +} +.btn-xs { + padding: 1px 5px; + font-size: 11px; + line-height: 1.5; + border-radius: 3px; +} +.btn-block { + display: block; + width: 100%; +} +.btn-block + .btn-block { + margin-top: 5px; +} +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} + +.img-responsive { + display: block; + width: 100% \9; + max-width: 100%; + height: auto; +} +.img-rounded { + border-radius: 6px; +} +.img-thumbnail { + padding: 4px; + line-height: 1.42857143; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 0; + -webkit-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + display: inline-block; + width: 100% \9; + max-width: 100%; + height: auto; +} +.img-circle { + border-radius: 50%; +} + + + +.row { + margin-left: -15px; + margin-right: -15px; +} +.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { + position: relative; + min-height: 1px; + padding-left: 15px; + padding-right: 15px; +} +.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { + float: left; +} +.col-xs-12 { + width: 100%; +} +.col-xs-11 { + width: 91.66666667%; +} +.col-xs-10 { + width: 83.33333333%; +} +.col-xs-9 { + width: 75%; +} +.col-xs-8 { + width: 66.66666667%; +} +.col-xs-7 { + width: 58.33333333%; +} +.col-xs-6 { + width: 50%; +} +.col-xs-5 { + width: 41.66666667%; +} +.col-xs-4 { + width: 33.33333333%; +} +.col-xs-3 { + width: 25%; +} +.col-xs-2 { + width: 16.66666667%; +} +.col-xs-1 { + width: 8.33333333%; +} +.col-xs-pull-12 { + right: 100%; +} +.col-xs-pull-11 { + right: 91.66666667%; +} +.col-xs-pull-10 { + right: 83.33333333%; +} +.col-xs-pull-9 { + right: 75%; +} +.col-xs-pull-8 { + right: 66.66666667%; +} +.col-xs-pull-7 { + right: 58.33333333%; +} +.col-xs-pull-6 { + right: 50%; +} +.col-xs-pull-5 { + right: 41.66666667%; +} +.col-xs-pull-4 { + right: 33.33333333%; +} +.col-xs-pull-3 { + right: 25%; +} +.col-xs-pull-2 { + right: 16.66666667%; +} +.col-xs-pull-1 { + right: 8.33333333%; +} +.col-xs-pull-0 { + right: auto; +} +.col-xs-push-12 { + left: 100%; +} +.col-xs-push-11 { + left: 91.66666667%; +} +.col-xs-push-10 { + left: 83.33333333%; +} +.col-xs-push-9 { + left: 75%; +} +.col-xs-push-8 { + left: 66.66666667%; +} +.col-xs-push-7 { + left: 58.33333333%; +} +.col-xs-push-6 { + left: 50%; +} +.col-xs-push-5 { + left: 41.66666667%; +} +.col-xs-push-4 { + left: 33.33333333%; +} +.col-xs-push-3 { + left: 25%; +} +.col-xs-push-2 { + left: 16.66666667%; +} +.col-xs-push-1 { + left: 8.33333333%; +} +.col-xs-push-0 { + left: auto; +} +.col-xs-offset-12 { + margin-left: 100%; +} +.col-xs-offset-11 { + margin-left: 91.66666667%; +} +.col-xs-offset-10 { + margin-left: 83.33333333%; +} +.col-xs-offset-9 { + margin-left: 75%; +} +.col-xs-offset-8 { + margin-left: 66.66666667%; +} +.col-xs-offset-7 { + margin-left: 58.33333333%; +} +.col-xs-offset-6 { + margin-left: 50%; +} +.col-xs-offset-5 { + margin-left: 41.66666667%; +} +.col-xs-offset-4 { + margin-left: 33.33333333%; +} +.col-xs-offset-3 { + margin-left: 25%; +} +.col-xs-offset-2 { + margin-left: 16.66666667%; +} +.col-xs-offset-1 { + margin-left: 8.33333333%; +} +.col-xs-offset-0 { + margin-left: 0%; +} +@media (min-width: 768px) { + .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { + float: left; + } + .col-sm-12 { + width: 100%; + } + .col-sm-11 { + width: 91.66666667%; + } + .col-sm-10 { + width: 83.33333333%; + } + .col-sm-9 { + width: 75%; + } + .col-sm-8 { + width: 66.66666667%; + } + .col-sm-7 { + width: 58.33333333%; + } + .col-sm-6 { + width: 50%; + } + .col-sm-5 { + width: 41.66666667%; + } + .col-sm-4 { + width: 33.33333333%; + } + .col-sm-3 { + width: 25%; + } + .col-sm-2 { + width: 16.66666667%; + } + .col-sm-1 { + width: 8.33333333%; + } + .col-sm-pull-12 { + right: 100%; + } + .col-sm-pull-11 { + right: 91.66666667%; + } + .col-sm-pull-10 { + right: 83.33333333%; + } + .col-sm-pull-9 { + right: 75%; + } + .col-sm-pull-8 { + right: 66.66666667%; + } + .col-sm-pull-7 { + right: 58.33333333%; + } + .col-sm-pull-6 { + right: 50%; + } + .col-sm-pull-5 { + right: 41.66666667%; + } + .col-sm-pull-4 { + right: 33.33333333%; + } + .col-sm-pull-3 { + right: 25%; + } + .col-sm-pull-2 { + right: 16.66666667%; + } + .col-sm-pull-1 { + right: 8.33333333%; + } + .col-sm-pull-0 { + right: auto; + } + .col-sm-push-12 { + left: 100%; + } + .col-sm-push-11 { + left: 91.66666667%; + } + .col-sm-push-10 { + left: 83.33333333%; + } + .col-sm-push-9 { + left: 75%; + } + .col-sm-push-8 { + left: 66.66666667%; + } + .col-sm-push-7 { + left: 58.33333333%; + } + .col-sm-push-6 { + left: 50%; + } + .col-sm-push-5 { + left: 41.66666667%; + } + .col-sm-push-4 { + left: 33.33333333%; + } + .col-sm-push-3 { + left: 25%; + } + .col-sm-push-2 { + left: 16.66666667%; + } + .col-sm-push-1 { + left: 8.33333333%; + } + .col-sm-push-0 { + left: auto; + } + .col-sm-offset-12 { + margin-left: 100%; + } + .col-sm-offset-11 { + margin-left: 91.66666667%; + } + .col-sm-offset-10 { + margin-left: 83.33333333%; + } + .col-sm-offset-9 { + margin-left: 75%; + } + .col-sm-offset-8 { + margin-left: 66.66666667%; + } + .col-sm-offset-7 { + margin-left: 58.33333333%; + } + .col-sm-offset-6 { + margin-left: 50%; + } + .col-sm-offset-5 { + margin-left: 41.66666667%; + } + .col-sm-offset-4 { + margin-left: 33.33333333%; + } + .col-sm-offset-3 { + margin-left: 25%; + } + .col-sm-offset-2 { + margin-left: 16.66666667%; + } + .col-sm-offset-1 { + margin-left: 8.33333333%; + } + .col-sm-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 992px) { + .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { + float: left; + } + .col-md-12 { + width: 100%; + } + .col-md-11 { + width: 91.66666667%; + } + .col-md-10 { + width: 83.33333333%; + } + .col-md-9 { + width: 75%; + } + .col-md-8 { + width: 66.66666667%; + } + .col-md-7 { + width: 58.33333333%; + } + .col-md-6 { + width: 50%; + } + .col-md-5 { + width: 41.66666667%; + } + .col-md-4 { + width: 33.33333333%; + } + .col-md-3 { + width: 25%; + } + .col-md-2 { + width: 16.66666667%; + } + .col-md-1 { + width: 8.33333333%; + } + .col-md-pull-12 { + right: 100%; + } + .col-md-pull-11 { + right: 91.66666667%; + } + .col-md-pull-10 { + right: 83.33333333%; + } + .col-md-pull-9 { + right: 75%; + } + .col-md-pull-8 { + right: 66.66666667%; + } + .col-md-pull-7 { + right: 58.33333333%; + } + .col-md-pull-6 { + right: 50%; + } + .col-md-pull-5 { + right: 41.66666667%; + } + .col-md-pull-4 { + right: 33.33333333%; + } + .col-md-pull-3 { + right: 25%; + } + .col-md-pull-2 { + right: 16.66666667%; + } + .col-md-pull-1 { + right: 8.33333333%; + } + .col-md-pull-0 { + right: auto; + } + .col-md-push-12 { + left: 100%; + } + .col-md-push-11 { + left: 91.66666667%; + } + .col-md-push-10 { + left: 83.33333333%; + } + .col-md-push-9 { + left: 75%; + } + .col-md-push-8 { + left: 66.66666667%; + } + .col-md-push-7 { + left: 58.33333333%; + } + .col-md-push-6 { + left: 50%; + } + .col-md-push-5 { + left: 41.66666667%; + } + .col-md-push-4 { + left: 33.33333333%; + } + .col-md-push-3 { + left: 25%; + } + .col-md-push-2 { + left: 16.66666667%; + } + .col-md-push-1 { + left: 8.33333333%; + } + .col-md-push-0 { + left: auto; + } + .col-md-offset-12 { + margin-left: 100%; + } + .col-md-offset-11 { + margin-left: 91.66666667%; + } + .col-md-offset-10 { + margin-left: 83.33333333%; + } + .col-md-offset-9 { + margin-left: 75%; + } + .col-md-offset-8 { + margin-left: 66.66666667%; + } + .col-md-offset-7 { + margin-left: 58.33333333%; + } + .col-md-offset-6 { + margin-left: 50%; + } + .col-md-offset-5 { + margin-left: 41.66666667%; + } + .col-md-offset-4 { + margin-left: 33.33333333%; + } + .col-md-offset-3 { + margin-left: 25%; + } + .col-md-offset-2 { + margin-left: 16.66666667%; + } + .col-md-offset-1 { + margin-left: 8.33333333%; + } + .col-md-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 1200px) { + .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { + float: left; + } + .col-lg-12 { + width: 100%; + } + .col-lg-11 { + width: 91.66666667%; + } + .col-lg-10 { + width: 83.33333333%; + } + .col-lg-9 { + width: 75%; + } + .col-lg-8 { + width: 66.66666667%; + } + .col-lg-7 { + width: 58.33333333%; + } + .col-lg-6 { + width: 50%; + } + .col-lg-5 { + width: 41.66666667%; + } + .col-lg-4 { + width: 33.33333333%; + } + .col-lg-3 { + width: 25%; + } + .col-lg-2 { + width: 16.66666667%; + } + .col-lg-1 { + width: 8.33333333%; + } + .col-lg-pull-12 { + right: 100%; + } + .col-lg-pull-11 { + right: 91.66666667%; + } + .col-lg-pull-10 { + right: 83.33333333%; + } + .col-lg-pull-9 { + right: 75%; + } + .col-lg-pull-8 { + right: 66.66666667%; + } + .col-lg-pull-7 { + right: 58.33333333%; + } + .col-lg-pull-6 { + right: 50%; + } + .col-lg-pull-5 { + right: 41.66666667%; + } + .col-lg-pull-4 { + right: 33.33333333%; + } + .col-lg-pull-3 { + right: 25%; + } + .col-lg-pull-2 { + right: 16.66666667%; + } + .col-lg-pull-1 { + right: 8.33333333%; + } + .col-lg-pull-0 { + right: auto; + } + .col-lg-push-12 { + left: 100%; + } + .col-lg-push-11 { + left: 91.66666667%; + } + .col-lg-push-10 { + left: 83.33333333%; + } + .col-lg-push-9 { + left: 75%; + } + .col-lg-push-8 { + left: 66.66666667%; + } + .col-lg-push-7 { + left: 58.33333333%; + } + .col-lg-push-6 { + left: 50%; + } + .col-lg-push-5 { + left: 41.66666667%; + } + .col-lg-push-4 { + left: 33.33333333%; + } + .col-lg-push-3 { + left: 25%; + } + .col-lg-push-2 { + left: 16.66666667%; + } + .col-lg-push-1 { + left: 8.33333333%; + } + .col-lg-push-0 { + left: auto; + } + .col-lg-offset-12 { + margin-left: 100%; + } + .col-lg-offset-11 { + margin-left: 91.66666667%; + } + .col-lg-offset-10 { + margin-left: 83.33333333%; + } + .col-lg-offset-9 { + margin-left: 75%; + } + .col-lg-offset-8 { + margin-left: 66.66666667%; + } + .col-lg-offset-7 { + margin-left: 58.33333333%; + } + .col-lg-offset-6 { + margin-left: 50%; + } + .col-lg-offset-5 { + margin-left: 41.66666667%; + } + .col-lg-offset-4 { + margin-left: 33.33333333%; + } + .col-lg-offset-3 { + margin-left: 25%; + } + .col-lg-offset-2 { + margin-left: 16.66666667%; + } + .col-lg-offset-1 { + margin-left: 8.33333333%; + } + .col-lg-offset-0 { + margin-left: 0%; + } +} + + + + +.form-control { + display: block; + width: 100%; + height: 31px; + padding: 6px 12px; + font-size: 12px; + line-height: 1.42857143; + color: #555555; + background-color: #ffffff; + background-image: none; + border: 1px solid #cccccc; + border-radius: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.form-control:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); +} +.form-control::-moz-placeholder { + color: #777777; + opacity: 1; +} +.form-control:-ms-input-placeholder { + color: #777777; +} +.form-control::-webkit-input-placeholder { + color: #777777; +} +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + cursor: not-allowed; + background-color: #eeeeee; + opacity: 1; +} +textarea.form-control { + height: auto; +} +input[type="search"] { + -webkit-appearance: none; +} +input[type="date"], +input[type="time"], +input[type="datetime-local"], +input[type="month"] { + line-height: 31px; + line-height: 1.42857143 \0; +} +input[type="date"].input-sm, +input[type="time"].input-sm, +input[type="datetime-local"].input-sm, +input[type="month"].input-sm { + line-height: 28px; +} +input[type="date"].input-lg, +input[type="time"].input-lg, +input[type="datetime-local"].input-lg, +input[type="month"].input-lg { + line-height: 42px; +} +.form-group { + margin-bottom: 15px; +} +.radio, +.checkbox { + position: relative; + display: block; + min-height: 17px; + margin-top: 10px; + margin-bottom: 10px; +} +.radio label, +.checkbox label { + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + cursor: pointer; +} +.radio input[type="radio"], +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { + position: absolute; + margin-left: -20px; + margin-top: 4px \9; +} +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; +} +.radio-inline, +.checkbox-inline { + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + vertical-align: middle; + font-weight: normal; + cursor: pointer; +} +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { + margin-top: 0; + margin-left: 10px; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"].disabled, +input[type="checkbox"].disabled, +fieldset[disabled] input[type="radio"], +fieldset[disabled] input[type="checkbox"] { + cursor: not-allowed; +} +.radio-inline.disabled, +.checkbox-inline.disabled, +fieldset[disabled] .radio-inline, +fieldset[disabled] .checkbox-inline { + cursor: not-allowed; +} +.radio.disabled label, +.checkbox.disabled label, +fieldset[disabled] .radio label, +fieldset[disabled] .checkbox label { + cursor: not-allowed; +} +.form-control-static { + padding-top: 7px; + padding-bottom: 7px; + margin-bottom: 0; +} +.form-control-static.input-lg, +.form-control-static.input-sm { + padding-left: 0; + padding-right: 0; +} +.input-sm, +.form-horizontal .form-group-sm .form-control { + height: 28px; + padding: 5px 10px; + font-size: 11px; + line-height: 1.5; + border-radius: 3px; +} +select.input-sm { + height: 28px; + line-height: 28px; +} +textarea.input-sm, +select[multiple].input-sm { + height: auto; +} +.input-lg, +.form-horizontal .form-group-lg .form-control { + height: 42px; + padding: 10px 16px; + font-size: 15px; + line-height: 1.33; + border-radius: 6px; +} +select.input-lg { + height: 42px; + line-height: 42px; +} +textarea.input-lg, +select[multiple].input-lg { + height: auto; +} +.has-feedback { + position: relative; +} +.has-feedback .form-control { + padding-right: 38.75px; +} +.form-control-feedback { + position: absolute; + top: 22px; + right: 0; + z-index: 2; + display: block; + width: 31px; + height: 31px; + line-height: 31px; + text-align: center; +} +.input-lg + .form-control-feedback { + width: 42px; + height: 42px; + line-height: 42px; +} +.input-sm + .form-control-feedback { + width: 28px; + height: 28px; + line-height: 28px; +} +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline { + color: #3c763d; +} +.has-success .form-control { + border-color: #3c763d; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-success .form-control:focus { + border-color: #2b542c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; +} +.has-success .input-group-addon { + color: #3c763d; + border-color: #3c763d; + background-color: #dff0d8; +} +.has-success .form-control-feedback { + color: #3c763d; +} +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline { + color: #8a6d3b; +} +.has-warning .form-control { + border-color: #8a6d3b; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-warning .form-control:focus { + border-color: #66512c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; +} +.has-warning .input-group-addon { + color: #8a6d3b; + border-color: #8a6d3b; + background-color: #fcf8e3; +} +.has-warning .form-control-feedback { + color: #8a6d3b; +} +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline { + color: #a94442; +} +.has-error .form-control { + border-color: #a94442; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-error .form-control:focus { + border-color: #843534; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; +} +.has-error .input-group-addon { + color: #a94442; + border-color: #a94442; + background-color: #f2dede; +} +.has-error .form-control-feedback { + color: #a94442; +} +.has-feedback label.sr-only ~ .form-control-feedback { + top: 0; +} +.help-block { + display: block; + margin-top: 5px; + margin-bottom: 10px; + color: #737373; +} +@media (min-width: 768px) { + .form-inline .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .form-inline .input-group { + display: inline-table; + vertical-align: middle; + } + .form-inline .input-group .input-group-addon, + .form-inline .input-group .input-group-btn, + .form-inline .input-group .form-control { + width: auto; + } + .form-inline .input-group > .form-control { + width: 100%; + } + .form-inline .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio, + .form-inline .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio label, + .form-inline .checkbox label { + padding-left: 0; + } + .form-inline .radio input[type="radio"], + .form-inline .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .form-inline .has-feedback .form-control-feedback { + top: 0; + } +} +.form-horizontal .radio, +.form-horizontal .checkbox, +.form-horizontal .radio-inline, +.form-horizontal .checkbox-inline { + margin-top: 0; + margin-bottom: 0; + padding-top: 7px; +} +.form-horizontal .radio, +.form-horizontal .checkbox { + min-height: 24px; +} +.form-horizontal .form-group { + margin-left: -15px; + margin-right: -15px; +} +@media (min-width: 768px) { + .form-horizontal .control-label { + text-align: right; + margin-bottom: 0; + padding-top: 7px; + } +} +.form-horizontal .has-feedback .form-control-feedback { + top: 0; + right: 15px; +} +@media (min-width: 768px) { + .form-horizontal .form-group-lg .control-label { + padding-top: 14.3px; + } +} +@media (min-width: 768px) { + .form-horizontal .form-group-sm .control-label { + padding-top: 6px; + } +} + +.tooltip { + position: absolute; + z-index: 1070; + display: block; + visibility: visible; + font-size: 11px; + line-height: 1.4; + opacity: 0; + filter: alpha(opacity=0); +} +.tooltip.in { + opacity: 0.9; + filter: alpha(opacity=90); +} +.tooltip.top { + margin-top: -3px; + padding: 5px 0; +} +.tooltip.right { + margin-left: 3px; + padding: 0 5px; +} +.tooltip.bottom { + margin-top: 3px; + padding: 5px 0; +} +.tooltip.left { + margin-left: -3px; + padding: 0 5px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.top-left .tooltip-arrow { + bottom: 0; + left: 5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.top-right .tooltip-arrow { + bottom: 0; + right: 5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.tooltip.bottom-left .tooltip-arrow { + top: 0; + left: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.tooltip.bottom-right .tooltip-arrow { + top: 0; + right: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} + +.modal-open { + overflow: hidden; +} +.modal { + display: none; + overflow: hidden; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1050; + -webkit-overflow-scrolling: touch; + outline: 0; +} +.modal.fade .modal-dialog { + -webkit-transform: translate3d(0, -25%, 0); + transform: translate3d(0, -25%, 0); + -webkit-transition: -webkit-transform 0.3s ease-out; + -moz-transition: -moz-transform 0.3s ease-out; + -o-transition: -o-transform 0.3s ease-out; + transition: transform 0.3s ease-out; +} +.modal.in .modal-dialog { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; +} +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} +.modal-content { + position: relative; + background-color: #ffffff; + border: 1px solid #999999; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + background-clip: padding-box; + outline: 0; +} +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000000; +} +.modal-backdrop.fade { + opacity: 0; + filter: alpha(opacity=0); +} +.modal-backdrop.in { + opacity: 0.5; + filter: alpha(opacity=50); +} +.modal-header { + padding: 15px; + border-bottom: 1px solid #e5e5e5; + min-height: 16.42857143px; +} +.modal-header .close { + margin-top: -2px; +} +.modal-title { + margin: 0; + line-height: 1.42857143; +} +.modal-body { + position: relative; + padding: 15px; +} +.modal-footer { + padding: 15px; + text-align: right; + border-top: 1px solid #e5e5e5; +} +.modal-footer .btn + .btn { + margin-left: 5px; + margin-bottom: 0; +} +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + .modal-content { + -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + } + .modal-sm { + width: 300px; + } +} +@media (min-width: 992px) { + .modal-lg { + width: 900px; + } +} + +.modal-footer:before, +.modal-footer:after { + content: " "; + display: table; +} +.navbar-collapse:after, +.modal-footer:after { + clear: both; +} + + +.alert { + padding: 15px; + margin-bottom: 17px; + border: 1px solid transparent; + border-radius: 0; +} +.alert h4 { + margin-top: 0; + color: inherit; +} +.alert .alert-link { + font-weight: bold; +} +.alert > p, +.alert > ul { + margin-bottom: 0; +} +.alert > p + p { + margin-top: 5px; +} +.alert-dismissable, +.alert-dismissible { + padding-right: 35px; +} +.alert-dismissable .close, +.alert-dismissible .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; +} +.alert-success { + background-color: #dff0d8; + border-color: #d6e9c6; + color: #3c763d; +} +.alert-success hr { + border-top-color: #c9e2b3; +} +.alert-success .alert-link { + color: #2b542c; +} +.alert-info { + background-color: #d9edf7; + border-color: #bce8f1; + color: #31708f; +} +.alert-info hr { + border-top-color: #a6e1ec; +} +.alert-info .alert-link { + color: #245269; +} +.alert-warning { + background-color: #fcf8e3; + border-color: #faebcc; + color: #8a6d3b; +} +.alert-warning hr { + border-top-color: #f7e1b5; +} +.alert-warning .alert-link { + color: #66512c; +} +.alert-danger { + background-color: #f2dede; + border-color: #ebccd1; + color: #a94442; +} +.alert-danger hr { + border-top-color: #e4b9c0; +} + +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} +.well-lg { + padding: 24px; + border-radius: 6px; +} +.well-sm { + padding: 9px; + border-radius: 3px; +} +.close { + float: right; + font-size: 18px; + font-weight: bold; + line-height: 1; + color: #000000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} +.close:hover, +.close:focus { + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.5; + filter: alpha(opacity=50); +} +button.close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} + + +/* Manually added pager */ +.pagination { + display: inline-block; + padding-left: 0; + margin: 20px 0; + border-radius: 4px; +} +.pagination > li { + display: inline; +} +.pagination > li > a, +.pagination > li > span { + position: relative; + float: left; + padding: 6px 12px; + line-height: 1.42857143; + text-decoration: none; + color: #337ab7; + background-color: #ffffff; + border: 1px solid #dddddd; + margin-left: -1px; +} +.pagination > li:first-child > a, +.pagination > li:first-child > span { + margin-left: 0; + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} +.pagination > li:last-child > a, +.pagination > li:last-child > span { + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; +} +.pagination > li > a:hover, +.pagination > li > span:hover, +.pagination > li > a:focus, +.pagination > li > span:focus { + z-index: 2; + color: #23527c; + background-color: #eeeeee; + border-color: #dddddd; +} +.pagination > .active > a, +.pagination > .active > span, +.pagination > .active > a:hover, +.pagination > .active > span:hover, +.pagination > .active > a:focus, +.pagination > .active > span:focus { + z-index: 3; + color: #ffffff; + background-color: #337ab7; + border-color: #337ab7; + cursor: default; +} +.pagination > .disabled > span, +.pagination > .disabled > span:hover, +.pagination > .disabled > span:focus, +.pagination > .disabled > a, +.pagination > .disabled > a:hover, +.pagination > .disabled > a:focus { + color: #777777; + background-color: #ffffff; + border-color: #dddddd; + cursor: not-allowed; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; +} +.pagination-lg > li:first-child > a, +.pagination-lg > li:first-child > span { + border-bottom-left-radius: 6px; + border-top-left-radius: 6px; +} +.pagination-lg > li:last-child > a, +.pagination-lg > li:last-child > span { + border-bottom-right-radius: 6px; + border-top-right-radius: 6px; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; +} +.pagination-sm > li:first-child > a, +.pagination-sm > li:first-child > span { + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; +} +.pagination-sm > li:last-child > a, +.pagination-sm > li:last-child > span { + border-bottom-right-radius: 3px; + border-top-right-radius: 3px; +} +.pager { + padding-left: 0; + margin: 20px 0; + list-style: none; + text-align: center; +} +.pager li { + display: inline; +} +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 15px; +} +.pager li > a:hover, +.pager li > a:focus { + text-decoration: none; + background-color: #eeeeee; +} +.pager .next > a, +.pager .next > span { + float: right; +} +.pager .previous > a, +.pager .previous > span { + float: left; +} +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > a:focus, +.pager .disabled > span { + color: #777777; + background-color: #ffffff; + cursor: not-allowed; +} +.pager:before, +.pager:after { + content: " "; + display: table; +} +.pager:after { + clear: both; +} + +/* List and panel */ +.list-group { + margin-bottom: 20px; + padding-left: 0; +} +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #ffffff; + border: 1px solid #dddddd; +} +.list-group-item:first-child { + border-top-right-radius: 4px; + border-top-left-radius: 4px; +} +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +a.list-group-item, +button.list-group-item { + color: #555555; +} +a.list-group-item .list-group-item-heading, +button.list-group-item .list-group-item-heading { + color: #333333; +} +a.list-group-item:hover, +button.list-group-item:hover, +a.list-group-item:focus, +button.list-group-item:focus { + text-decoration: none; + color: #555555; + background-color: #f5f5f5; +} +button.list-group-item { + width: 100%; + text-align: left; +} +.list-group-item.disabled, +.list-group-item.disabled:hover, +.list-group-item.disabled:focus { + background-color: #eeeeee; + color: #777777; + cursor: not-allowed; +} +.list-group-item.disabled .list-group-item-heading, +.list-group-item.disabled:hover .list-group-item-heading, +.list-group-item.disabled:focus .list-group-item-heading { + color: inherit; +} +.list-group-item.disabled .list-group-item-text, +.list-group-item.disabled:hover .list-group-item-text, +.list-group-item.disabled:focus .list-group-item-text { + color: #777777; +} +.list-group-item.active, +.list-group-item.active:hover, +.list-group-item.active:focus { + z-index: 2; + color: #ffffff; + background-color: #337ab7; + border-color: #337ab7; +} +.list-group-item.active .list-group-item-heading, +.list-group-item.active:hover .list-group-item-heading, +.list-group-item.active:focus .list-group-item-heading, +.list-group-item.active .list-group-item-heading > small, +.list-group-item.active:hover .list-group-item-heading > small, +.list-group-item.active:focus .list-group-item-heading > small, +.list-group-item.active .list-group-item-heading > .small, +.list-group-item.active:hover .list-group-item-heading > .small, +.list-group-item.active:focus .list-group-item-heading > .small { + color: inherit; +} +.list-group-item.active .list-group-item-text, +.list-group-item.active:hover .list-group-item-text, +.list-group-item.active:focus .list-group-item-text { + color: #c7ddef; +} +.list-group-item-success { + color: #3c763d; + background-color: #dff0d8; +} +a.list-group-item-success, +button.list-group-item-success { + color: #3c763d; +} +a.list-group-item-success .list-group-item-heading, +button.list-group-item-success .list-group-item-heading { + color: inherit; +} +a.list-group-item-success:hover, +button.list-group-item-success:hover, +a.list-group-item-success:focus, +button.list-group-item-success:focus { + color: #3c763d; + background-color: #d0e9c6; +} +a.list-group-item-success.active, +button.list-group-item-success.active, +a.list-group-item-success.active:hover, +button.list-group-item-success.active:hover, +a.list-group-item-success.active:focus, +button.list-group-item-success.active:focus { + color: #fff; + background-color: #3c763d; + border-color: #3c763d; +} +.list-group-item-info { + color: #31708f; + background-color: #d9edf7; +} +a.list-group-item-info, +button.list-group-item-info { + color: #31708f; +} +a.list-group-item-info .list-group-item-heading, +button.list-group-item-info .list-group-item-heading { + color: inherit; +} +a.list-group-item-info:hover, +button.list-group-item-info:hover, +a.list-group-item-info:focus, +button.list-group-item-info:focus { + color: #31708f; + background-color: #c4e3f3; +} +a.list-group-item-info.active, +button.list-group-item-info.active, +a.list-group-item-info.active:hover, +button.list-group-item-info.active:hover, +a.list-group-item-info.active:focus, +button.list-group-item-info.active:focus { + color: #fff; + background-color: #31708f; + border-color: #31708f; +} +.list-group-item-warning { + color: #8a6d3b; + background-color: #fcf8e3; +} +a.list-group-item-warning, +button.list-group-item-warning { + color: #8a6d3b; +} +a.list-group-item-warning .list-group-item-heading, +button.list-group-item-warning .list-group-item-heading { + color: inherit; +} +a.list-group-item-warning:hover, +button.list-group-item-warning:hover, +a.list-group-item-warning:focus, +button.list-group-item-warning:focus { + color: #8a6d3b; + background-color: #faf2cc; +} +a.list-group-item-warning.active, +button.list-group-item-warning.active, +a.list-group-item-warning.active:hover, +button.list-group-item-warning.active:hover, +a.list-group-item-warning.active:focus, +button.list-group-item-warning.active:focus { + color: #fff; + background-color: #8a6d3b; + border-color: #8a6d3b; +} +.list-group-item-danger { + color: #a94442; + background-color: #f2dede; +} +a.list-group-item-danger, +button.list-group-item-danger { + color: #a94442; +} +a.list-group-item-danger .list-group-item-heading, +button.list-group-item-danger .list-group-item-heading { + color: inherit; +} +a.list-group-item-danger:hover, +button.list-group-item-danger:hover, +a.list-group-item-danger:focus, +button.list-group-item-danger:focus { + color: #a94442; + background-color: #ebcccc; +} +a.list-group-item-danger.active, +button.list-group-item-danger.active, +a.list-group-item-danger.active:hover, +button.list-group-item-danger.active:hover, +a.list-group-item-danger.active:focus, +button.list-group-item-danger.active:focus { + color: #fff; + background-color: #a94442; + border-color: #a94442; +} +.list-group-item-muted { + color: #777777; + background-color: #f7f7f7; +} +a.list-group-item-muted, +button.list-group-item-muted { + color: #777777; +} +a.list-group-item-muted .list-group-item-heading, +button.list-group-item-muted .list-group-item-heading { + color: inherit; +} +a.list-group-item-muted:hover, +button.list-group-item-muted:hover, +a.list-group-item-muted:focus, +button.list-group-item-muted:focus { + color: #777777; + background-color: #f1f1f1; +} +a.list-group-item-muted.active, +button.list-group-item-muted.active, +a.list-group-item-muted.active:hover, +button.list-group-item-muted.active:hover, +a.list-group-item-muted.active:focus, +button.list-group-item-muted.active:focus { + color: #fff; + background-color: #777777; + border-color: #777777; +} +.list-group-item-heading { + margin-top: 0; + margin-bottom: 0; +} +.list-group-item-text { + margin-top: 5px; + margin-bottom: 0; + line-height: 1.3; +} +.list-group-item-text:empty { + margin-top: 0; +} +.panel { + margin-bottom: 20px; + background-color: #ffffff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); +} +.panel-body { + padding: 15px; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; +} +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 16px; + color: inherit; +} +.panel-title > a, +.panel-title > small, +.panel-title > .small, +.panel-title > small > a, +.panel-title > .small > a { + color: inherit; +} +.panel-footer { + padding: 10px 15px; + background-color: #f5f5f5; + border-top: 1px solid #dddddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .list-group, +.panel > .panel-collapse > .list-group { + margin-bottom: 0; +} +.panel > .list-group .list-group-item, +.panel > .panel-collapse > .list-group .list-group-item { + border-width: 1px 0; + border-radius: 0; +} +.panel > .list-group:first-child .list-group-item:first-child, +.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { + border-top: 0; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel > .list-group:last-child .list-group-item:last-child, +.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { + border-bottom: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child { + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.panel-heading + .list-group .list-group-item:first-child { + border-top-width: 0; +} +.list-group + .panel-footer { + border-top-width: 0; +} +.panel > .table, +.panel > .table-responsive > .table, +.panel > .panel-collapse > .table { + margin-bottom: 0; +} +.panel > .table caption, +.panel > .table-responsive > .table caption, +.panel > .panel-collapse > .table caption { + padding-left: 15px; + padding-right: 15px; +} +.panel > .table:first-child, +.panel > .table-responsive:first-child > .table:first-child { + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { + border-top-right-radius: 3px; +} +.panel > .table:last-child, +.panel > .table-responsive:last-child > .table:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { + border-bottom-right-radius: 3px; +} +.panel > .panel-body + .table, +.panel > .panel-body + .table-responsive, +.panel > .table + .panel-body, +.panel > .table-responsive + .panel-body { + border-top: 1px solid #dddddd; +} +.panel > .table > tbody:first-child > tr:first-child th, +.panel > .table > tbody:first-child > tr:first-child td { + border-top: 0; +} +.panel > .table-bordered, +.panel > .table-responsive > .table-bordered { + border: 0; +} +.panel > .table-bordered > thead > tr > th:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:first-child, +.panel > .table-bordered > tbody > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, +.panel > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-bordered > thead > tr > td:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:first-child, +.panel > .table-bordered > tbody > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, +.panel > .table-bordered > tfoot > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; +} +.panel > .table-bordered > thead > tr > th:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:last-child, +.panel > .table-bordered > tbody > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, +.panel > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-bordered > thead > tr > td:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:last-child, +.panel > .table-bordered > tbody > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, +.panel > .table-bordered > tfoot > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; +} +.panel > .table-bordered > thead > tr:first-child > td, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > td, +.panel > .table-bordered > tbody > tr:first-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, +.panel > .table-bordered > thead > tr:first-child > th, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > th, +.panel > .table-bordered > tbody > tr:first-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { + border-bottom: 0; +} +.panel > .table-bordered > tbody > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, +.panel > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-bordered > tbody > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, +.panel > .table-bordered > tfoot > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; +} +.panel > .table-responsive { + border: 0; + margin-bottom: 0; +} +.panel-group { + margin-bottom: 20px; +} +.panel-group .panel { + margin-bottom: 0; + border-radius: 4px; +} +.panel-group .panel + .panel { + margin-top: 5px; +} +.panel-group .panel-heading { + border-bottom: 0; +} +.panel-group .panel-heading + .panel-collapse > .panel-body, +.panel-group .panel-heading + .panel-collapse > .list-group { + border-top: 1px solid #dddddd; +} +.panel-group .panel-footer { + border-top: 0; +} +.panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom: 1px solid #dddddd; +} +.panel-default { + border-color: #dddddd; +} +.panel-default > .panel-heading { + color: #333333; + background-color: #f5f5f5; + border-color: #dddddd; +} +.panel-default > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #dddddd; +} +.panel-default > .panel-heading .badge { + color: #f5f5f5; + background-color: #333333; +} +.panel-default > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #dddddd; +} +.panel-primary { + border-color: #337ab7; +} +.panel-primary > .panel-heading { + color: #ffffff; + background-color: #337ab7; + border-color: #337ab7; +} +.panel-primary > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #337ab7; +} +.panel-primary > .panel-heading .badge { + color: #337ab7; + background-color: #ffffff; +} +.panel-primary > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #337ab7; +} +.panel-success { + border-color: #d6e9c6; +} +.panel-success > .panel-heading { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.panel-success > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #d6e9c6; +} +.panel-success > .panel-heading .badge { + color: #dff0d8; + background-color: #3c763d; +} +.panel-success > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #d6e9c6; +} +.panel-info { + border-color: #bce8f1; +} +.panel-info > .panel-heading { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.panel-info > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #bce8f1; +} +.panel-info > .panel-heading .badge { + color: #d9edf7; + background-color: #31708f; +} +.panel-info > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #bce8f1; +} +.panel-warning { + border-color: #faebcc; +} +.panel-warning > .panel-heading { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.panel-warning > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #faebcc; +} +.panel-warning > .panel-heading .badge { + color: #fcf8e3; + background-color: #8a6d3b; +} +.panel-warning > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #faebcc; +} +.panel-danger { + border-color: #ebccd1; +} +.panel-danger > .panel-heading { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.panel-danger > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #ebccd1; +} +.panel-danger > .panel-heading .badge { + color: #f2dede; + background-color: #a94442; +} +.panel-danger > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #ebccd1; +} + +/* Inline Group */ + +.input-group { + position: relative; + display: table; + border-collapse: separate; +} +.input-group[class*="col-"] { + float: none; + padding-left: 0; + padding-right: 0; +} +.input-group .form-control { + position: relative; + z-index: 2; + float: left; + width: 100%; + margin-bottom: 0; +} +.input-group .form-control:focus { + z-index: 3; +} +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + height: 41px; + padding: 10px 16px; + font-size: 15px; + line-height: 1.3333333; + border-radius: 6px; +} +select.input-group-lg > .form-control, +select.input-group-lg > .input-group-addon, +select.input-group-lg > .input-group-btn > .btn { + height: 41px; + line-height: 41px; +} +textarea.input-group-lg > .form-control, +textarea.input-group-lg > .input-group-addon, +textarea.input-group-lg > .input-group-btn > .btn, +select[multiple].input-group-lg > .form-control, +select[multiple].input-group-lg > .input-group-addon, +select[multiple].input-group-lg > .input-group-btn > .btn { + height: auto; +} +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-group-sm > .form-control, +select.input-group-sm > .input-group-addon, +select.input-group-sm > .input-group-btn > .btn { + height: 30px; + line-height: 30px; +} +textarea.input-group-sm > .form-control, +textarea.input-group-sm > .input-group-addon, +textarea.input-group-sm > .input-group-btn > .btn, +select[multiple].input-group-sm > .form-control, +select[multiple].input-group-sm > .input-group-addon, +select[multiple].input-group-sm > .input-group-btn > .btn { + height: auto; +} +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; +} +.input-group-addon:not(:first-child):not(:last-child), +.input-group-btn:not(:first-child):not(:last-child), +.input-group .form-control:not(:first-child):not(:last-child) { + border-radius: 0; +} +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; +} +.input-group-addon { + padding: 6px 12px; + font-size: 14px; + font-weight: normal; + line-height: 1; + color: #555555; + text-align: center; + background-color: #eeeeee; + border: 1px solid #cccccc; + border-radius: 4px; +} +.input-group-addon.input-sm { + padding: 5px 10px; + font-size: 12px; + border-radius: 3px; +} +.input-group-addon.input-lg { + padding: 10px 16px; + font-size: 15px; + border-radius: 6px; +} +.input-group-addon input[type="radio"], +.input-group-addon input[type="checkbox"] { + margin-top: 0; +} +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child), +.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.input-group-addon:last-child { + border-left: 0; +} +.input-group-btn { + position: relative; + font-size: 0; + white-space: nowrap; +} +.input-group-btn > .btn { + position: relative; +} +.input-group-btn > .btn + .btn { + margin-left: -1px; +} +.input-group-btn > .btn:hover, +.input-group-btn > .btn:focus, +.input-group-btn > .btn:active { + z-index: 2; +} +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group { + margin-right: -1px; +} +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group { + z-index: 2; + margin-left: -1px; +} +.clearfix:before, +.clearfix:after, +.form-horizontal .form-group:before, +.form-horizontal .form-group:after { + content: " "; + display: table; +} +.clearfix:after, +.form-horizontal .form-group:after { + clear: both; +} diff --git a/data/themes.telegram.org/css/bootstrap.min.css b/data/themes.telegram.org/css/bootstrap.min.css new file mode 100644 index 0000000000..b59e0626ca --- /dev/null +++ b/data/themes.telegram.org/css/bootstrap.min.css @@ -0,0 +1,10 @@ +/*! + * Bootstrap v3.2.0 (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +/*! + * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=92d2ac1b31978642b6b6) + * Config saved to config.json and https://gist.github.com/92d2ac1b31978642b6b6 + *//*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Lucida Grande","Lucida Sans Unicode",Arial,Helvetica,Verdana,sans-serif;font-size:12px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#2e87ca;text-decoration:none}a:hover,a:focus{color:#2e87ca;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive{display:block;width:100% \9;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;width:100% \9;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:17px;margin-bottom:17px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#777}h1,.h1,h2,.h2,h3,.h3{margin-top:17px;margin-bottom:8.5px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:8.5px;margin-bottom:8.5px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:31px}h2,.h2{font-size:25px}h3,.h3{font-size:21px}h4,.h4{font-size:15px}h5,.h5{font-size:12px}h6,.h6{font-size:11px}p{margin:0 0 8.5px}.lead{margin-bottom:17px;font-size:13px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:18px}}small,.small{font-size:91%}cite{font-style:normal}mark,.mark{background-color:#fcf8e3;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#428bca}a.text-primary:hover{color:#3071a9}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#428bca}a.bg-primary:hover{background-color:#3071a9}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:7.5px;margin:34px 0 17px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:8.5px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:17px}dt,dd{line-height:1.42857143}dt{font-weight:bold}dd{margin-left:0}@media (min-width:1px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:8.5px 17px;margin:0 0 17px;font-size:15px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}blockquote:before,blockquote:after{content:""}address{margin-bottom:17px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c61717;background-color:#feeae4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25)}kbd kbd{padding:0;font-size:100%;box-shadow:none}pre{display:block;padding:8px;margin:0 0 8.5px;font-size:11px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#546172;background-color:#ecf3f8;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}table{background-color:transparent}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:17px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #eee}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #eee}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #eee}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #eee}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #eee}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:12.75px;overflow-y:hidden;overflow-x:auto;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #eee;-webkit-overflow-scrolling:touch}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:17px;font-size:18px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}input[type="range"]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:12px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:31px;padding:6px 12px;font-size:12px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6)}.form-control::-moz-placeholder{color:#777;opacity:1}.form-control:-ms-input-placeholder{color:#777}.form-control::-webkit-input-placeholder{color:#777}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}textarea.form-control{height:auto}input[type="search"]{-webkit-appearance:none}input[type="date"],input[type="time"],input[type="datetime-local"],input[type="month"]{line-height:31px;line-height:1.42857143 \0}input[type="date"].input-sm,input[type="time"].input-sm,input[type="datetime-local"].input-sm,input[type="month"].input-sm{line-height:28px}input[type="date"].input-lg,input[type="time"].input-lg,input[type="datetime-local"].input-lg,input[type="month"].input-lg{line-height:42px}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;min-height:17px;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{padding-left:20px;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{position:absolute;margin-left:-20px;margin-top:4px \9}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"].disabled,input[type="checkbox"].disabled,fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-left:0;padding-right:0}.input-sm,.form-horizontal .form-group-sm .form-control{height:28px;padding:5px 10px;font-size:11px;line-height:1.5;border-radius:3px}select.input-sm{height:28px;line-height:28px}textarea.input-sm,select[multiple].input-sm{height:auto}.input-lg,.form-horizontal .form-group-lg .form-control{height:42px;padding:10px 16px;font-size:15px;line-height:1.33;border-radius:6px}select.input-lg{height:42px;line-height:42px}textarea.input-lg,select[multiple].input-lg{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:38.75px}.form-control-feedback{position:absolute;top:22px;right:0;z-index:2;display:block;width:31px;height:31px;line-height:31px;text-align:center}.input-lg+.form-control-feedback{width:42px;height:42px;line-height:42px}.input-sm+.form-control-feedback{width:28px;height:28px;line-height:28px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;border-color:#3c763d;background-color:#dff0d8}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;border-color:#8a6d3b;background-color:#fcf8e3}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;border-color:#a94442;background-color:#f2dede}.has-error .form-control-feedback{color:#a94442}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:24px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}@media (min-width:768px){.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:7px}}.form-horizontal .has-feedback .form-control-feedback{top:0;right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.3px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px}}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:12px;text-align:left;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:7.5px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#428bca}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:11px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:1px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#777;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#2e87ca}.nav .nav-divider{height:1px;margin:7.5px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:48px;margin-bottom:17px;border:1px solid transparent}@media (min-width:1px){.navbar{border-radius:4px}}@media (min-width:1px){.navbar-header{float:left}}.navbar-collapse{overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:1px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:1px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:1px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}@media (min-width:1px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:15.5px 15px;font-size:15px;line-height:17px;height:48px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media (min-width:1px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:7px;margin-bottom:7px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:1px){.navbar-toggle{display:none}}.navbar-nav{margin:7.75px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:17px}@media (max-width:0){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:17px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:1px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15.5px;padding-bottom:15.5px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media (min-width:1px){.navbar-left{float:left !important}.navbar-right{float:right !important}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:8.5px;margin-bottom:8.5px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:0){.navbar-form .form-group{margin-bottom:5px}}@media (min-width:1px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8.5px;margin-bottom:8.5px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:13px;margin-bottom:13px}.navbar-text{margin-top:15.5px;margin-bottom:15.5px}@media (min-width:1px){.navbar-text{float:left;margin-left:15px;margin-right:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.navbar-default{background-color:#fcfcfc;border-color:#e8e8e8}.navbar-default .navbar-brand{color:#0a76ba}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#0a76ba;background-color:transparent}.navbar-default .navbar-text{color:#666}.navbar-default .navbar-nav>li>a{color:#666}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#0a76ba;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#0a76ba;background-color:#fcfcfc}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e8e8e8}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#fcfcfc;color:#0a76ba}@media (max-width:0){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#666}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#0a76ba;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#0a76ba;background-color:#fcfcfc}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#666}.navbar-default .navbar-link:hover{color:#0a76ba}.navbar-default .btn-link{color:#666}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#0a76ba}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#777}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#777}.navbar-inverse .navbar-nav>li>a{color:#777}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#080808;color:#fff}@media (max-width:0){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#777}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#777}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#fff}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:17px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#ccc}.breadcrumb>.active{color:#777}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after{content:" ";display:table}.clearfix:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important;visibility:hidden !important}.affix{position:fixed;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none !important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none !important}@media (max-width:767px){.visible-xs{display:block !important}table.visible-xs{display:table}tr.visible-xs{display:table-row !important}th.visible-xs,td.visible-xs{display:table-cell !important}}@media (max-width:767px){.visible-xs-block{display:block !important}}@media (max-width:767px){.visible-xs-inline{display:inline !important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block !important}table.visible-sm{display:table}tr.visible-sm{display:table-row !important}th.visible-sm,td.visible-sm{display:table-cell !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block !important}table.visible-md{display:table}tr.visible-md{display:table-row !important}th.visible-md,td.visible-md{display:table-cell !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block !important}}@media (min-width:1200px){.visible-lg{display:block !important}table.visible-lg{display:table}tr.visible-lg{display:table-row !important}th.visible-lg,td.visible-lg{display:table-cell !important}}@media (min-width:1200px){.visible-lg-block{display:block !important}}@media (min-width:1200px){.visible-lg-inline{display:inline !important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block !important}}@media (max-width:767px){.hidden-xs{display:none !important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none !important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none !important}}@media (min-width:1200px){.hidden-lg{display:none !important}}.visible-print{display:none !important}@media print{.visible-print{display:block !important}table.visible-print{display:table}tr.visible-print{display:table-row !important}th.visible-print,td.visible-print{display:table-cell !important}}.visible-print-block{display:none !important}@media print{.visible-print-block{display:block !important}}.visible-print-inline{display:none !important}@media print{.visible-print-inline{display:inline !important}}.visible-print-inline-block{display:none !important}@media print{.visible-print-inline-block{display:inline-block !important}}@media print{.hidden-print{display:none !important}} \ No newline at end of file diff --git a/data/themes.telegram.org/css/jquery-ui.min.css b/data/themes.telegram.org/css/jquery-ui.min.css new file mode 100644 index 0000000000..4e14d72f69 --- /dev/null +++ b/data/themes.telegram.org/css/jquery-ui.min.css @@ -0,0 +1,6 @@ +/*! jQuery UI - v1.12.0 - 2016-09-10 +* http://jqueryui.com +* Includes: draggable.css, core.css, resizable.css +* Copyright jQuery Foundation and other contributors; Licensed MIT */ + +.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px} \ No newline at end of file diff --git a/data/themes.telegram.org/css/telegram.css b/data/themes.telegram.org/css/telegram.css new file mode 100644 index 0000000000..607f550a96 --- /dev/null +++ b/data/themes.telegram.org/css/telegram.css @@ -0,0 +1,4866 @@ +body { + font: 12px/18px "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, Verdana, sans-serif; + /*-webkit-font-smoothing: antialiased;*/ +} +html.lang_rtl { + direction: rtl; +} + +a, +a:hover { + color: #0088cc; +} +a:focus { + text-decoration: none; +} +a:hover { + text-decoration: underline; +} + +.container { + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; +} +@media (min-width: 768px) { + .container { + width: 750px; + } +} +@media (min-width: 992px) { + .container { + width: 970px; + } +} +@media (min-width: 1200px) { + .container { + width: 1170px; + } +} +.container-fluid { + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; +} +.row { + margin-left: -15px; + margin-right: -15px; +} + +.container:before { + content: " "; + display: table; +} +.container:after { + content: " "; + display: table; + clear: both; +} + +@media (min-width: 1px) { + .lang_rtl .navbar-nav, + .lang_rtl .navbar-nav > li { + float: right; + } + .lang_rtl .navbar-right { + float: left !important; + } +} + +.tl_page_head { + margin-bottom: 0; +} +.navbar-tg .navbar-inner { + box-shadow: none; + -webkit-box-shadow: none; + border-bottom: 1px solid #e8e8e8; +} +.navbar-tg .nav a { + color: #0088cc; +} +.navbar-tg .nav a:hover, +.navbar-tg .nav .active a { + color: #0088cc; +} +.navbar-tg .nav > .active > a, +.navbar-tg .nav > .open > a, +.navbar-tg .nav > li > a:hover { + position: relative; +} +.navbar-tg .nav > li > a:after { + display: block; + height: 3px; + background: #179cde; + position: absolute; + border-radius: 2px 2px 0 0; + content: ""; + left: 4px; + right: 4px; + opacity: 0; + bottom: -1px; + -webkit-transition: opacity .2s ease-in-out, transform .2s ease-in-out; + -moz-transition: opacity .2s ease-in-out, transform .2s ease-in-out; + -ms-transition: opacity .2s ease-in-out, transform .2s ease-in-out; + + transform-origin: bottom;; + transform: scaleX(0.3) scaleY(0); + +} +.navbar-tg .nav > .active > a:after, +.navbar-tg .nav > .open > a:after, +.navbar-tg .nav > li > a:hover:after { + opacity: 1; + transform: scaleX(1.0) scaleY(1.0); +} +.navbar-tg .nav > li > a, +.navbar-tg .nav > li > a:hover, +.navbar-tg .nav > li > a:focus { + background-color: transparent; +} + +.nav { + color: #a2a2a2; + font-size: 15px; + padding-left: 0; + padding-right: 0; +} + + +.caret { + display: inline-block; + background: url(../img/dropdown_1x.png) -2px -5px no-repeat; + border: 0; + width: 14px; + height: 6px; + margin-left: 2px; + vertical-align: middle; +} + + +.nav-pills > li > a { + font-size: 15px; + padding: 8px 17px; + border-radius: 0; +} + +.nav > li > a:hover, +.nav > li > a:focus { + background-color: #f0f6fa; + text-decoration: none; +} + +.nav .open > a, +.nav .open > a:hover, +.nav .open > a:focus, +.nav-pills > li.active > a, +.nav-pills > li.active > a:hover, +.nav-pills > li.active > a:focus { + box-shadow: none; + background-color: #1e98d4; + color: #FFF; + border: 0; +} + +.nav .open > a .caret, +.nav .open > a:hover .caret, +.nav .open > a:focus .caret { + background-position: -2px -15px; +} + +.dropdown-menu { + min-width: 177px; + padding: 0; + margin: 7px 0 0 0; + list-style: none; + font-size: 13px; + text-align: left; + background-color: #fff; + border-radius: 0; + border: 1px solid rgba(29,92,123,0.3); + box-shadow: 0 1px 1px rgba(20,60,83,0.1); + -webkit-box-shadow: 0 1px 1px rgba(20,60,83,0.1); +} +.dropdown-menu > li > a { + padding: 8px 18px; + margin: 0 -1px; + color: #08c; +} +.dropdown-menu > li > a:first-child { + margin-top: -1px; + padding-top: 9px; +} +.dropdown-menu > li > a:last-child { + margin-bottom: -1px; + padding-bottom: 9px; +} +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus, +.dropdown-menu > li.active > a { + text-decoration: none; + color: #FFF; + background-color: #1e98d4; +} + +#dev_page_content > ul:not(.nav), +#dev_page_content ul.bulleted, +#dev_page_content > ul:not(.nav) ul:not(.nav), +#dev_page_content > ol:not(.nav) ul:not(.nav), +#dev_page_content ul.bulleted ul.bulleted { + list-style-type: none; + padding-left: 10px; +} +.is_rtl #dev_page_content > ul:not(.nav), +.is_rtl #dev_page_content ul.bulleted, +.is_rtl #dev_page_content > ul:not(.nav) ul:not(.nav), +.is_rtl #dev_page_content > ol:not(.nav) ul:not(.nav), +.is_rtl #dev_page_content ul.bulleted ul.bulleted { + padding-right: 10px; + padding-left: 0; +} +#dev_page_content > ol { + padding-left: 25px; +} +#dev_page_content > ol > li { + padding-left: 5px; +} + + +#dev_page_content > ul:not(.nav) li, +#dev_page_content > ol:not(.nav) ul:not(.nav) li, +#dev_page_content ul.bulleted li { + background-image: url(../img/bullet.png?3); + background-repeat: no-repeat; + background-position: 0px 8px; + padding-left: 20px; +} + +.is_rtl #dev_page_content > ul:not(.nav) li, +.is_rtl #dev_page_content > ol:not(.nav) ul:not(.nav) li, +.is_rtl #dev_page_content ul.bulleted li { + background-position: 100% 8px; + padding-left: 0; + padding-right: 20px; +} + + + +.breadcrumb > li { + text-shadow: none; +} +.breadcrumb > li > .divider { + color: #c1d3e4; +} + +pre, code { + border: 0; +} +pre { + font-size: 13px; + color: #546172; + background: #ecf3f8; + border-radius: 0; +} +code { + background: #feeae4; + color: #c61717; + padding: 3px 5px; + border-radius: 0; +} +blockquote { + border-left-color: #179cde; +} +blockquote p { + font-size: 14px; + font-weight: normal; + line-height: 20px; + margin-bottom: 10px; +} +ul ul, ol ul, ul ol, ol ol { + margin-bottom: 8.5px; +} +.table td, .table th { + border-top-color: #eee; +} +h1, h2, h3, h4, h5, h6 { + font-weight: bold; + margin: 20px 0 10px 0; + position: relative; +} +h1 { + font-size: 20px; + margin-top: 32px; + margin-bottom: 12px; +} +h2 { + font-size: 20px; + margin-top: 32px; + margin-bottom: 12px; +} +h3 { + font-size: 20px; + margin-top: 32px; + margin-bottom: 10px; +} +h4 { + font-size: 16px; + margin-top: 29px; + margin-bottom: 7px; +} +h5 { + font-size: 16px; + margin-top: 29px; + margin-bottom: 7px; +} + +mark { + padding: .2em .4em; +} + +a.btn, +button.btn { + border-radius: 0; +} + +.form-control { + border-radius: 0; + box-shadow: none; +} + + +a.anchor { + text-decoration: none; + line-height: 1; + margin-left: -22px; + + cursor: default; + display: block; + position: absolute; + top: 0; + left: 0; + bottom: 0; + + border-top: 10px solid transparent; + margin-top: -10px; + -webkit-background-clip:padding-box; + -moz-background-clip:padding; + background-clip:padding-box; + outline: 0; +} +.is_rtl a.anchor { + margin-right: -22px; + margin-left: 0; +} + +a.anchor i.anchor-icon { + display: inline-block; + width: 18px; + height: 20px; + margin-top: 2px; + line-height: 14px; + vertical-align: text-top; + background: url(../img/link-icon.png) 0 0 no-repeat; + background-size: 17px 18px; + opacity: 0; + + cursor: pointer; + padding: 0; + position: relative; + z-index: 10; + + -webkit-transition: opacity .15s ease-in-out; + -moz-transition: opacity .15s ease-in-out; + -ms-transition: opacity .15s ease-in-out; + -o-transition: opacity .15s ease-in-out; + transition: opacity .15s ease-in-out; +} + +h1 a.anchor i.anchor-icon {margin-top: 2px;} +h2 a.anchor i.anchor-icon {margin-top: 2px;} +h3 a.anchor i.anchor-icon {margin-top: 2px;} +h4 a.anchor i.anchor-icon {margin-top: 0px;} + + +h1:hover a.anchor i.anchor-icon, +h2:hover a.anchor i.anchor-icon, +h3:hover a.anchor i.anchor-icon, +h4:hover a.anchor i.anchor-icon, +h5:hover a.anchor i.anchor-icon, +h6:hover a.anchor i.anchor-icon { + opacity: 0.6; +} +i.anchor-icon:hover { + opacity: 1 !important; +} + +.breadcrumb { + background-color: #ecf3fa; +} +.breadcrumb { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.breadcrumb li { + display: inline-block; + float: none; + white-space: nowrap; + text-overflow: ellipsis; +} +.breadcrumb > li + li:before { + padding: 0; + content: ""; +} +.icon-breadcrumb-divider { + display: inline-block; + background: url(../img/breadcrumb_divider_1x.png) 0 50% no-repeat; + width: 5px; + height: 18px; + line-height: 18px; + margin: 0 8px; + vertical-align: top; +} + +.slightly-pull-right { + float: right; +} +.slightly-pull-left { + float: left; +} + + +.back_to_top_wrap { + display: block; + pointer-events: none; + cursor: default; + position: fixed; + left: 0; + top: 0; + bottom: 0; + outline: none; + box-shadow: none; + opacity: 0; + /*display: none;*/ + transition: opacity ease-in-out 0.2s; + -webkit-transition: opacity ease-in-out 0.2s; + direction: ltr; +} +.back_to_top_wrap.is_rtl { + left: auto; + right: 0; + direction: rtl; +} +.back_to_top_wrap.back_to_top_shown { + cursor: pointer; + pointer-events: all; + /*display: block;*/ + opacity: 1; +} +.back_to_top_wrap:hover { + text-decoration: none; +} +.back_to_top { + font-size: 15px; + width: 120px; + text-align: center; + padding: 18px 15px 18px 7px; + transition: background ease-in-out 0.2s; + -webkit-transition: background ease-in-out 0.2s; +} +.back_to_top_wrap:hover .back_to_top { + background: #ecf3f8; + background: rgba(174, 198, 215, 0.2); +} +.icon-to-top { + display: inline-block; + background: url(../img/back_to_top_1x.png) 0 50% no-repeat; + width: 16px; + height: 7px; + margin-right: 12px; + margin-top: 7px; + vertical-align: text-top; +} +.back_to_top_wrap.is_rtl .icon-to-top { + margin-left: 12px; + margin-right: 0; +} + + +.navbar-tg .navbar-twitter a { + padding-top: 14.5px; + padding-bottom: 14.5px; +} + +.tl_main_page_container { + padding: 0; +} + +.tl_main_wrap { + margin-top: 17px; +} +.tl_main_wrap h3 { + color: #222222; + font-size: 23px; + font-weight: 500; +} +.tl_main_award { + width: 100px; + height: 100px; + display: block; + background: url(../img/SiteAward.gif) 0 0 no-repeat; + margin: 2px; +} +.tl_main_card_animated { + width: 160px; + margin: 0 auto; +} +.tl_main_card_animated div { + padding-top: 100%; +} + +.no_access_wrap { + color: #999; + padding: 100px 40px; + text-align: center; + font-size: 18px; +} + +.side_blog_wrap { + background: #ecf3fa; + padding: 15px 20px 20px; + font-size: 12px; + width: 200px; +} +.tl_blog_side_blog .side_blog_wrap { + width: 180px; +} +.side_blog_header { + display: block; + color: #0088cc; + font-weight: bold; + font-size: 16px; + margin-bottom: 15px; +} +a.side_blog_entry { + display: block; + margin-top: 10px; +} +a.side_blog_entry:hover { + text-decoration: none; +} +.side_blog_date { + color: #000; + font-weight: bold; +} +.side_blog_title { + color: #0088cc; +} +a.side_blog_entry:hover .side_blog_title { + text-decoration: underline; +} +.side_tour_entry .side_blog_title { + font-size: 14px; +} + +.tl_main_bottom_blog, +.tl_blog_bottom_blog { + display: none; +} +.tl_main_side_blog { + position: relative; +} +.tl_main_side_blog .side_blog_wrap { + position: absolute; + margin-top: 20px; + right: 137px; +} +.lang_rtl .tl_main_side_blog .side_blog_wrap { + left: 137px; + right: auto; +} +.tl_main_bottom_blog { + margin: 0px 15px 20px; +} +.side_blog_wrap { + background: none; + padding: 5px 17px 5px 0; + margin: 0 0 17px 26px; + display: flex; + flex-wrap: nowrap; + flex-direction: row; + justify-content: start; + align-items: stretch; + align-content: start +} +.tl_blog_bottom_blog .side_blog_wrap { + margin: 0 0 0 10px; +} +.tl_blog_side_blog { + position: relative; +} +.tl_blog_side_blog .side_blog_wrap { + position: absolute; + margin-top: 50px; + right: -200px; +} +.lang_rtl .tl_blog_side_blog .side_blog_wrap { + left: -200px; + right: auto; +} +.side_blog_wrap:before { + content: ' '; + display: block; + width: 5px; + background: #179cde; + border-radius: 5px; + overflow: hidden; + flex: 0 0 auto; + margin: 0 17px 0 0; +} +.lang_rtl .side_blog_wrap:before { + margin: 0 0 0 17px; +} + + + +.tl_main_logo_wrap { + max-width: 400px; + margin: 0 auto; + padding: 20px 0 20px; +} +a.tl_main_logo { + display: block; + line-height: 0; + text-decoration: none !important; +} +svg.tl_main_logo, +image.tl_main_logo, +img.tl_main_logo { + display: block; + width: 128px; + height: 128px; + margin: 0 auto; +} + +.tl_main_logo_title, +.tl_main_logo_title:hover { + font-size: 34px; + color: #222222; + text-align: center; + margin-top: 18px; + margin-bottom: 6px; + font-weight: normal; + letter-spacing: -2px; +} +.tl_main_logo_title_image { + width: 144px; + height: 36px; + background: url(../img/Telegram_1x.png) 0 0 no-repeat; + margin: 18px auto 6px; +} +.tl_main_logo_lead { + font-size: 20px; + line-height: 148%; + max-width: 285px; + margin: 0 auto; + color: #8c8c8c; + text-align: center; + padding: 1px 0 10px; + + font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Light", Helvetica, Arial , Verdana, sans-serif; + font-weight: 300; +} + + +.tl_main_head_download { + margin: 6px auto 35px; + max-width: 798px; + text-align: center; +} +.tl_main_download_btn { + display: inline-block; + color: #FFF; + font-size: 16px; + background: #a19481; + border-radius: 4px; + padding: 10px 15px; + line-height: 35px; + overflow: hidden; + width: 220px; + margin: 5px 8px; + text-align: center; +} +.tl_main_download_btn:hover { + background-color: #a99d8b; + color: #FFF; + text-decoration: none; +} +.tl_main_download_btn:active { + background-color: #998e7e; +} + +.tl_main_download_mobile { + text-align: center; + max-width: 1028px; + margin: 0 auto; +} +.tl_main_download_link { + text-align: center; + display: inline-block; + height: 300px; + padding-top: 262px; + padding-bottom: 20px; + margin: 40px 0; + font-size: 15px; + max-width: 100%; + position: relative; +} +a.tl_main_download_link:hover { + text-decoration: none; +} +a.tl_main_download_link:after { + display: block; + height: 3px; + background: #179cde; + position: absolute; + border-radius: 2px; + content: ""; + left: 4px; + right: 4px; + opacity: 0; + bottom: -1px; + -webkit-transition: opacity .2s ease-in-out, transform .2s ease-in-out; + -moz-transition: opacity .2s ease-in-out, transform .2s ease-in-out; + -ms-transition: opacity .2s ease-in-out, transform .2s ease-in-out; + + transform-origin: bottom;; + transform: scaleX(0.3) scaleY(0); +} +a.tl_main_download_link:hover:after { + opacity: 1; + transform: scaleX(1.0) scaleY(1.0); +} + +.tl_main_download_link_android { + width: 28.210116857923%; + min-width: 245px; +} +.tl_main_download_link_ios { + width: 42.9961%; + min-width: 350px; +} +.tl_main_download_link_tdesktop { + display: none; + min-width: 320px; + background: url(../img/SiteTDesktop.jpg) 50% 0 no-repeat; +} + +.tl_main_download_image__ios, +.tl_main_download_image__android { + display: block; + position: absolute; + top: 50%; + left: 50%; + transform-origin: 50% 50%; + opacity: 1.0; + pointer-events: none; + -webkit-transition: opacity .1s ease-in-out; + -moz-transition: opacity .1s ease-in-out; + -ms-transition: opacity .1s ease-in-out; + padding: 0; + border: 0; +} +.tl_main_download_image__ios { + margin: -150px 0 0 -152px; + width: 304px; + height: 240px; + background: url(../img/SiteiOS.jpg?2) 50% 0 no-repeat; +} +.tl_main_download_image__android { + margin: -150px 0 0 -152px; + width: 304px; + height: 240px; + background: url(../img/SiteAndroid.jpg?2) 50% 0 no-repeat; +} + +.tl_main_video_player { + display: block; + position: absolute; + top: 50%; + left: 50%; + transform-origin: 50% 50%; + opacity: 0; + pointer-events: none; + -webkit-transition: opacity .1s ease-in-out; + -moz-transition: opacity .1s ease-in-out; + -ms-transition: opacity .1s ease-in-out; + padding: 0; + border: 0; +} +.tl_main_video_player.video__init_retina { + display: none; +} +.tl_main_video_player__android { + margin: -150px 0 0 -96px; + width: 192px; + height: 240px; +} +.tl_main_video_player__ios { + margin: -150px 0 0 -152px; + width: 304px; + height: 240px; +} +.video_play .tl_main_video_player { + opacity: 1; +} + + + + +.tl_main_download_more_btn { + margin-bottom: 0; + font-weight: normal; + text-align: center; + vertical-align: middle; + cursor: pointer; + background-image: none; + border: 0; + white-space: nowrap; + padding: 10px 16px; + font-size: 15px; + line-height: 1.33; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + color: #ffffff; + background-color: #318fd3; + margin-top: 5px; + display: none; + border-radius: 3px; +} +.tl_main_download_more_btn:hover { + color: #FFF; +} +.icon-arrow-more { + display: inline-block; + vertical-align: baseline; + width: 6px; + height: 11px; + background: url(../img/tl_arrow.png) 0 0 no-repeat; + margin-left: 10px; +} + +.tl_main_download_desktop_header { + text-align: center; +} +.tl_main_download_desktop_wrap1 { + height: 291px; + overflow: hidden; +} +.tl_main_download_desktop_wrap { + position: absolute; + left: 0; + right: 0; +} +.tl_main_download_desktop { + position: absolute; + left: 0; + right: 0; + min-width: 804px; + background: url(../img/SiteDesktop.jpg?2) 50% 19px no-repeat; + /*overflow: hidden;*/ +} + + + +.tl_main_download_desktop_links { + width: 595px; + margin: 0 auto; +} +.tl_main_download_desktop_link { + text-align: center; + display: inline-block; + padding: 270px 0 20px; + font-size: 15px; + vertical-align: top; + -webkit-transition: box-shadow .2s ease-in-out; + -moz-transition: box-shadow .2s ease-in-out; + -ms-transition: box-shadow .2s ease-in-out; + position: relative; + float: left; +} +.tl_main_download_desktop_link:hover { + text-decoration: none; +} +a.tl_main_download_desktop_link:hover { + text-decoration: none; +} +a.tl_main_download_desktop_link:after { + display: block; + height: 3px; + background: #179cde; + position: absolute; + border-radius: 2px; + content: ""; + left: 4px; + right: 4px; + opacity: 0; + bottom: -1px; + -webkit-transition: opacity .2s ease-in-out, transform .2s ease-in-out; + -moz-transition: opacity .2s ease-in-out, transform .2s ease-in-out; + -ms-transition: opacity .2s ease-in-out, transform .2s ease-in-out; + + transform-origin: bottom;; + transform: scaleX(0.3) scaleY(0); +} +a.tl_main_download_desktop_link:hover:after { + opacity: 1; + transform: scaleX(1.0) scaleY(1.0); +} +.tl_main_download_link_td { + width: 52%; + padding-left: 20px; + padding-right: 20px; +} +.tl_main_download_link_osx { + width: 48%; +} +.tl_main_body { + margin-top: 40px; + padding-top: 5px; +} +.tl_main_body_header { + text-align: center; + margin-top: 0; + padding-top: 20px; +} + +.icon-android, +.icon-ios, +.icon-wp { + display: inline-block; + vertical-align: text-top; + width: 25px; + height: 30px; + background: url(../img/SiteLogos.png) 0 0 no-repeat; + margin-right: 10px; +} +.lang_rtl .icon-android, +.lang_rtl .icon-ios, +.lang_rtl .icon-wp { + margin-right: 0; + margin-left: 10px; +} + +.icon-ios { + background-position: 0 0px; + height: 26px; + margin-top: -5px; +} +.icon-android { + background-position: 0 -46px; + height: 23px; + margin-top: -3px; +} +.icon-wp { + background-position: 0 -90px; + height: 20px; + margin-top: -1px; +} + +.icon { + display: inline-block; +} +.icon-twitter { + width: 21px; + height: 17px; + vertical-align: text-top; + background: url(../img/twitter.png) 0 0 no-repeat; + opacity: 0.9; +} +a:hover .icon-twitter { + opacity: 0.99; +} + +.app-icon { + display: inline-block; + width: 30px; + height: 30px; + line-height: 30px; + margin-right: 7px; + vertical-align: -9px; + background: no-repeat left; + background-size: cover; +} +.is_rtl .app-icon { + margin-right: 0; + margin-left: 7px; +} +.app-icon-android { + background-image: url(/img/app_icon_android.svg); +} +.app-icon-ios { + background-image: url(/img/app_icon_ios.svg); +} +.app-icon-macos { + background-image: url(/img/app_icon_macos.svg); +} +.app-icon-desktop { + background-image: url(/img/app_icon_desktop.svg); +} +.app-icon-webk { + background-image: url(/img/app_icon_webk.svg); +} +.app-icon-webz { + background-image: url(/img/app_icon_webz.svg); +} + + +.tl_main_cards { + max-width: 950px; + margin: 18px auto 0; + padding: 0; + display: flex; + flex-wrap: wrap; + justify-content: center; +} +.tl_main_card_cell { + position: relative; + min-height: 1px; + padding-left: 15px; + padding-right: 15px; + flex: 0 1 auto; + width: 100%; +} +@media (min-width: 768px) { + .tl_main_card_cell { + width: 50%; + } +} +@media (min-width: 992px) { + .tl_main_card_cell { + width: 33.33333%; + } +} + +.tl_main_card_wrap { + max-width: 260px; + margin: 0 auto; + padding: 20px 0 9px; +} +.tl_main_card { + background: url(../img/tl_card_fast.gif) 0 0 no-repeat; + background-size: 160px 160px; + width: 160px; + height: 160px; + margin: 0 auto; +} + +.tl_main_card_fast { + background-image: url(../img/tl_card_fast.gif); +} +.tl_main_card_powerful { + background-image: url(../img/tl_card_powerful.gif); +} +.tl_main_card_free { + background-image: url(../img/tl_card_free.gif); +} +.tl_main_card_secure { + background-image: url(../img/tl_card_secure.gif); +} +.tl_main_card_cloud { + background-image: url(../img/tl_card_cloud.gif); +} +.tl_main_card_private { + background-image: url(../img/tl_card_private.gif); +} +.tl_main_card_decentralized { + background-image: url(../img/tl_card_decentralized.gif); +} +.tl_main_card_open { + background-image: url(../img/tl_card_open.gif); +} +.tl_main_card_wecandoit { + background-image: url(../img/tl_card_wecandoit.gif); +} + +.tl_main_card_connect { + background-image: url(../img/tl_card_connect.gif); +} +.tl_main_card_coordinate { + background-image: url(../img/tl_card_coordinate.gif); +} +.tl_main_card_synchronize { + background-image: url(../img/tl_card_synchronize.gif); +} +.tl_main_card_build { + background-image: url(../img/tl_card_build.gif); +} +.tl_main_card_encrypt { + background-image: url(../img/tl_card_encrypt.gif); +} +.tl_main_card_send { + background-image: url(../img/tl_card_send.gif); +} +.tl_main_card_process { + background-image: url(../img/tl_card_process.gif); +} +.tl_main_card_destruct { + background-image: url(../img/tl_card_destruct.gif); +} +.tl_main_card_store { + background-image: url(../img/tl_card_store.gif); +} + +h3.tl_main_card_header { + color: #a19679; + text-align: center; + margin: 15px 0 6px; + font-size: 26px; + font-weight: normal; + letter-spacing: -1px; +} +.tl_main_cards_animated_wrap h3.tl_main_body_header { + padding: 0 10px; +} +.tl_main_cards_animated_wrap h3.tl_main_card_header { + color: #0088cc; +} +.tl_main_cards_animated_wrap { + padding-bottom: 20px; +} + +.tl_main_card_lead { + font-size: 15px; + line-height: 158%; + text-align: center; +} + +.tl_main_share { + margin: 24px auto 40px; + /*padding-bottom: 30px;*/ + max-width: 330px; + text-align: center; +} +.lang_rtl .tl_main_share { + max-width: none; +} +.tl_main_noshare { + height: 50px; +} +.tl_main_twitter_widget_wrap { + /*float: left;*/ + display: inline-block; +} +.tl_main_facebook_widget_wrap { + /*float: left;*/ + margin-right: 20px; + display: inline-block; +} +.fb_iframe_widget span { + vertical-align: baseline !important; +} + +.tl_blog_comments_widget { + margin: 0 -8px 40px; +} +.tl_blog_comments_widget iframe { + max-width: 100%; +} + +.tl_main_gplus_widget_wrap { + /*float: left;*/ + display: inline-block; +} + +.tl_twitter_share_btn { + display: inline-block; + border-radius: 16px; + background-color: #54a9eb; + cursor: pointer; + margin-right: 15px; + padding: 7px 17px; + color:#FFF; + font-weight: bold; +} +.lang_rtl .tl_twitter_share_btn { + margin-right: 0; + margin-left: 15px; +} +.tl_twitter_share_btn:hover, +.tl_twitter_share_btn:active, +.tl_twitter_share_btn:focus { + text-decoration: none; + color: #FFF; + outline: none; +} +.tl_twitter_share_cnt { + display: none; + color: #c4e3fb; +} + +.tl_blog_list_page_wrap { + max-width: 800px; + margin: 0 auto; +} +.tl_blog_list_page_wrap.tl_main_recent_news_wrap { + margin-top: 22px; + margin-bottom: 20px; +} +.tl_main_recent_news_header { + font-size: 16px; + font-weight: bold; + text-align: center; + margin-top: 42px; +} +.tlb_other_news_wrap .tl_main_recent_news_header { + margin-top: 22px; + font-size: 18px; +} +.tl_main_wrap .tl_main_recent_news_header { + margin-top: 66px; +} +.tl_main_download_mobile + .tl_main_recent_news_wrap .tl_main_recent_news_header, +.tl_main_download_mobile + .tl_main_recent_news_wrap { + margin-top: 12px; +} +.dev_blog_card_link_wrap:nth-child(odd) { + clear: left; +} +.dev_blog_card_link_wrap { + display: block; + max-width: 50%; + float: left; + padding: 15px 10px; +} +@media (max-width: 640px) { + .dev_blog_card_link_wrap { + max-width: 100%; + } +} +@media (min-width: 801px) { + .tl_main_recent_news_cards { + margin: 0 -15px; + } +} +.tlb_blog_page .dev_blog_card_link_wrap { + padding: 15px 0; +} +a.dev_blog_card_link_wrap:hover, +a.dev_blog_card_link_wrap:active, +a.dev_blog_card_link_wrap:focus { + text-decoration: none; +} +.dev_blog_card_image { + display: block; + max-width: 100%; + height: auto; + max-height: 220px; + margin: 0 auto; + -webkit-transition: opacity .2s ease-in-out; + -moz-transition: opacity .2s ease-in-out; + -ms-transition: opacity .2s ease-in-out; + opacity: 1; +} +.preload .dev_blog_card_image { + height: 220px; + max-height: initial; +} +a:hover .dev_blog_card_image { + opacity: 0.9; +} +.dev_blog_card_title { + margin: 12px 0 2px; + padding: 0 15px; + font-size: 16px; + line-height: 160%; +} +a.dev_blog_card_link_wrap:hover .dev_blog_card_title { + text-decoration: underline; +} +.dev_blog_card_lead { + color: #333; + font-size: 14px; + line-height: 160%; + padding: 0 15px; +} +.dev_blog_card_date { + margin-top: 4px; + font-size: 14px; + color: #888; + padding: 0 15px; +} +.tlb_blog_page .dev_blog_card_title, +.tlb_blog_page .dev_blog_card_lead, +.tlb_blog_page .dev_blog_card_date { + padding: 0 5px; +} +.pager_wrap { + margin-top: 40px; + clear: both; +} + + +.footer_wrap { + border-top: 1px solid #e8e8e8; + max-width: 925px; + margin: 10px auto 0; + padding: 28px 0 34px; +} +.footer_columns_wrap { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + -webkit-align-content: stretch; + -ms-flex-line-pack: stretch; + align-content: stretch; + -webkit-align-items: stretch; + -ms-flex-align: stretch; + align-items: stretch; + + margin: 0 auto; + max-width: 800px; + padding-left: 0; +} +.footer_mobile { + display: none; +} +.footer_column { + flex: 0 1 auto; + align-self: auto; +} +.footer_column_telegram { + flex: 0 1 290px; +} +.footer_column:last-child { + padding-right: 0; +} +.footer_column:first-child { + padding-left: 0; +} +.footer_column h5 { + font-size: 14px; + margin-top: 0; + margin-bottom: 9px; +} +.footer_column h5 a { + color: inherit; +} +.footer_column ul, +.footer_column ul li { + list-style: none; + margin: 0; + padding: 0; +} +.footer_column ul li { + font-size: 14px; + line-height: 23px; +} +.footer_privacy_description { + padding-top: 3px; + font-size: 13px; + line-height: 160%; +} +.footer_privacy_description p { + margin-bottom: 6px; +} +.footer_telegram_description { + font-size: 13px; +} + + + +.tl_mission_wrap #dev_page_content, +.tl_mission_wrap #dev_page_content p { + font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Light", Helvetica, Arial , Verdana, sans-serif; + font-weight: 300; + line-height: 160%; + font-size: 16px; +} + + + +/* Team */ +#dev_page_content.tl_team_wrap, +#dev_page_content.tl_team_wrap p { + line-height: 1.6; +} +.tl_team_lead { + margin-bottom: 30px; +} +.tl_team_member { + min-height: 120px; + position: relative; + margin-bottom: 30px; +} +.tl_team_member_photo_wrap { + position: absolute; + // float: left; + // margin-right: 25px; +} +.tl_team_member_photo { + width: 120px; + height: 120px; + display: block; + background: url('../img/team-sprite.png') 0 0 no-repeat; + background-size: 120px 1810px; +} + +.tl_team_member_pavel .tl_team_member_photo { + background-position: 0 0; +} +.tl_team_member_nikolay .tl_team_member_photo { + background-position: 0 -130px; +} +.tl_team_member_aliaksei .tl_team_member_photo { + background-position: 0 -260px; +} +.tl_team_member_vitalik .tl_team_member_photo { + background-position: 0 -390px; +} +.tl_team_member_arseny .tl_team_member_photo { + background-position: 0 -520px; +} +.tl_team_member_igor .tl_team_member_photo { + background-position: 0 -650px; +} +.tl_team_member_drklo .tl_team_member_photo { + background-position: 0 -780px; +} +.tl_team_member_peter .tl_team_member_photo { + background-position: 0 -910px; +} +.tl_team_member_john .tl_team_member_photo { + background-position: 0 -1040px; +} +.tl_team_member_kolar .tl_team_member_photo { + background-position: 0 -1170px; +} +.tl_team_member_ilya .tl_team_member_photo { + background-position: 0 -1300px; +} +.tl_team_member_igor1 .tl_team_member_photo { + background-position: 0 -1690px; +} +.tl_team_member_mike .tl_team_member_photo { + background-position: 0 -1560px; +} +.tl_team_member_grisha .tl_team_member_photo { + background-position: 0 -1430px; +} + + +.tl_team_member_name { + margin-left: 146px; +} +.tl_team_member_body { + margin-left: 146px; +} + +.tl_team_member_name { + margin-top: 5px; + font-size: 17px; +} +.tl_team_member_awards { + margin-top: 20px; + margin-bottom: 18px; + color: #0088cc; + font-size: 15px; +} +.tl_team_member_experience, +.tl_team_member_awards_list { + line-height: 1.8; +} +.tl_team_member_description { + margin-top: 20px; +} + + + +/* Core / dev */ + +.dev_page { + background: #FFF; + min-height: 500px; +} +#dev_page_content_wrap { + padding: 20px 0; + max-width: 800px; + margin: 0 auto; + direction: ltr; +} +#dev_page_content_wrap.is_rtl { + direction: rtl; +} +#dev_page_content, +#dev_page_content p { + font-size: 14px; + line-height: 1.5; +} +#dev_page_content img.emoji { + vertical-align: top; + -webkit-user-drag: none; + user-drag: none; + cursor: text; +} +.dev_page_bread_crumbs .breadcrumb { + margin-bottom: 10px; + border-radius: 0; +} +#dev_page_title { + position: static; +} + +.dev_page_head { + margin-bottom: 0; +} +.dev_page_head .dev_page_head_logo { + margin-left: 0; +} +#dev_page_content_wrap blockquote { + padding: 5px 17px; +} +#dev_page_content_wrap pre { + overflow-x: auto; + border-radius: 0; +} + +#dev_page_content_wrap pre::-webkit-scrollbar { + visibility: visible; + display: block; + height: 15px; +} +#dev_page_content_wrap pre::-webkit-scrollbar-track:horizontal { + background: rgba(93, 144, 177, 0.2); + border-radius: 0; + height: 15px; +} +#dev_page_content_wrap pre::-webkit-scrollbar-thumb:horizontal { + background: rgba(93, 144, 177, 0.4); + border-radius: 0; + height: 15px; +} + +#dev_page_content_wrap .richcode { + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 20px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + + color: #546172; + background: #ecf3f8; + + font-family: Monaco,Menlo,Consolas,"Courier New",monospace; +} +#dev_page_content_wrap .richcode code { + background: #FFF; +} +.richcode p:last-child { + margin-bottom: 0; +} + +#dev_page_content_wrap pre code { + overflow-wrap: normal; + white-space: pre; +} +#dev_page_content_wrap a.current_page_link { + color: #468847; + text-decoration: underline; +} + +#dev_page_content_wrap a.nonexisting_page_link { + color: #FF0000; + text-decoration: underline; +} + +.dev_side_image { + max-width: 200px; + float: right; + padding: 0 0 0 20px; +} +.dev_side_image img { + max-width: 180px; +} +.dev_side_image picture { + max-width: 180px; +} + + +#dev_page_content_wrap pre.page_scheme { + margin: 20px 0 30px; +} +.dev_page_edit_form { + border-top: 1px solid #DDD; + padding-top: 50px; + max-width: 800px; + margin: 30px auto 0; + direction: ltr; +} +.dev_page_edit_form .CodeMirror { + font-size: 14px; + line-height: 20px; + font-family: Monaco, Menlo, Consolas, "Courier New", monospace; + border: 1px solid #eee; + height: auto; + position: relative; + + margin-bottom: 9px; + color: #555555; + border: 1px solid #ccc; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; + -moz-transition: border linear 0.2s, box-shadow linear 0.2s; + -ms-transition: border linear 0.2s, box-shadow linear 0.2s; + -o-transition: border linear 0.2s, box-shadow linear 0.2s; + transition: border linear 0.2s, box-shadow linear 0.2s; +} + +.dev_page_edit_form .CodeMirror-focused { + border-color: rgba(82, 168, 236, 0.8); + outline: 0; + outline: thin dotted \9; + + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); +} + +.dev_page_edit_form .CodeMirror-scroll { + overflow-y: hidden; + overflow-x: auto; +} + +.dev_page_edit_form .CodeMirror pre { + white-space: pre-wrap; + word-break: break-all; + word-wrap: break-word; +} + +.dev_page_edit_form #dev_page_diff .CodeMirror { + font-size: 12px; + margin-bottom: 0; +} +#dev_page_diff .CodeMirror-merge, +#dev_page_diff .CodeMirror-merge .CodeMirror { + height: auto; +} +#dev_page_diff .CodeMirror-merge-2pane { + display: flex; + border: 0; + margin-bottom: 9px; +} +#dev_page_diff .CodeMirror-merge-2pane .CodeMirror-merge-pane { + width: 48%; +} +#dev_page_diff .CodeMirror-merge-2pane .CodeMirror-merge-gap { + height: auto; + width: 4%; +} +#dev_page_diff .CodeMirror-merge-pane-rightmost { + position: static; + right: auto; +} +#dev_page_diff .CodeMirror-merge-scrolllock-wrap { + display: none; +} +#dev_page_diff .CodeMirror-merge-left .CodeMirror { + background: rgba(0,0,0,0.06); +} +#dev_page_diff .CodeMirror-merge-l-inserted, +#dev_page_diff .CodeMirror-merge-l-deleted { + background: none; +} +#dev_page_diff.dev_page_diff__wcolor .CodeMirror-merge-l-inserted { + /*background: rgba(0,200,0,0.18);*/ + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==); + background-position: bottom left; + background-repeat: repeat-x; + background-color: #dfd; + /*border: 1px solid #4e4;*/ +} +#dev_page_diff.dev_page_diff__wcolor .CodeMirror-merge-l-deleted { + /*background: rgba(200,0,0,0.18);*/ + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12M4Kyb2/6yY2H8GBgYGJgYkAABURgPz6Ks7wQAAAABJRU5ErkJggg==); + background-position: bottom left; + background-repeat: repeat-x; + background-color: #fdd; + /*border: 1px solid #e44;*/ +} + +.table-msg-schema td { + text-align: center; +} +.table-msg-schema>thead>tr>th, +.table-msg-schema>tbody>tr>th, +.table-msg-schema>tfoot>tr>th, +.table-msg-schema>thead>tr>td, +.table-msg-schema>tbody>tr>td, +.table-msg-schema>tfoot>tr>td { + border: 1px solid #d5d5d5; +} + +#dev_upload_btn { + cursor: pointer; + overflow: hidden; + position: relative; +} +.dev_upload_input { + cursor: pointer; + font-size: 72px !important; + opacity: 0.01; + position: absolute; + z-index: 100; + margin: 0; + padding: 0; + top: 0; + right: 0; +} + + +.app_edit_page { + width: 700px; + margin: 40px auto; +} +.app_lock_tt { + padding: 3px; + display: inline-block; +} +.app_lock_text { + font-size: 13px; +} + +.tg-table-stats { + font-size: 12px; +} +.tg-table-stats th a.active { + color: inherit; +} + +.dev_side_nav_wrap { + position: relative; +} +.dev_side_nav { + position: absolute; + width: 200px; + right: -200px; + z-index: 1; +} +.is_rtl .dev_side_nav { + left: -200px; + right: auto; +} +.is_rtl .dev_side_nav .nav { + padding-right: 0; + padding-left: 0; + padding-right: 0; +} +.dev_side_nav > ul { + width: 200px; + background: none; + padding: 10px 0 10px; +} +.dev_side_nav > ul::-webkit-scrollbar { + display: none; +} +.dev_side_nav > ul.affix-top { + position: relative; +} +.dev_side_nav > ul.affix { + position: fixed; + top: 0; + max-height: 100%; + overflow-y: scroll; +} +.dev_side_nav > ul.affix-bottom { + position: relative; + height: auto; + overflow-y: scroll; +} +.dev_side_nav li { + float: none !important; +} +.dev_side_nav li a { + border-left: 2px solid transparent; + padding: 10px 10px; + background: none !important; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.is_rtl .dev_side_nav li a { + border-right: 2px solid transparent; + border-left: 0; +} +.dev_side_nav li a { + display: block; + font-size: 13px; + font-weight: 500; + padding: 4px 20px 4px 18px; + font-weight: 700; + background-color: transparent; +} +.is_rtl .dev_side_nav li a { + padding: 4px 18px 4px 20px; +} +.dev_side_nav li li a { + padding-left: 15px; + padding: 1px 18px 1px 30px; + font-size: 12px; + font-weight: 400; +} +.is_rtl .dev_side_nav li li a { + padding: 1px 30px 1px 18px; +} +.dev_side_nav li a:hover { + border-color: rgba(23, 156, 222, 0.6); +} +.dev_side_nav li.active > a { + border-color: #179cde; +} +.dev_side_nav li ul { + display: none; +} +.dev_side_nav li.active ul { + display: block; +} + + +/* Core / dev end*/ + + + +/* Support */ +.support_wrap { + max-width: 800px; + background: #FFF; + margin: 0 auto; + padding: 20px 0; +} +.support_submit { +} + + +/* FAQ */ +.twitter_timeline_wrap { + width: 300px; + padding-top: 14px; +} +.is_rtl .dev_layer_select .dropdown-menu { + right: auto; + left: 0; +} + +.is_rtl { + direction: rtl; +} + +.is_rtl blockquote { + padding: 0 15px 0 0; + margin: 0 0 20px; + border-left: 0; + border-right: 5px solid #179cde; +} + +.is_rtl .pull-right, +.is_rtl .slightly-pull-right { + float: left; +} +.is_rtl .pull-left, +.is_rtl .slightly-pull-left { + float: right; +} + +.is_rtl .anchor { + left: auto; + right: 0; +} + +.top_lang_select.tlb_top_lang_select { + float: right; + margin: -4px -5px -4px 0; +} +.lang_rtl .top_lang_select.tlb_top_lang_select { + float: left; +} +.top_lang_select .dropdown-toggle { + display: block; + text-align: center; + padding-top: 15.5px; + padding-bottom: 15.5px; + font-size: 15px; + line-height: 17px; +} +.top_lang_select.tlb_top_lang_select a.dropdown-toggle { + padding: 8px 6px 8px 8px; + border-radius: 6px; + /*transition: background-color ease-in-out 0.2s, color ease-in-out 0.2s;*/ +} +.navbar-tg .top_lang_select.open a.dropdown-toggle:active, +.navbar-tg .top_lang_select.open a.dropdown-toggle:hover, +.navbar-tg .top_lang_select.open a.dropdown-toggle { + background: transparent; + color: #0088cc; +} +.top_lang_select.tlb_top_lang_select.open a.dropdown-toggle:hover, +.top_lang_select.tlb_top_lang_select.open a.dropdown-toggle:active, +.top_lang_select.tlb_top_lang_select.open a.dropdown-toggle { + background-color: #3faee8; + color: #fff; +} +.dev_top_lang_icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: top; + line-height: 100%; + margin-right: 4px; + background: url("data:image/svg+xml;utf8,") no-repeat 0 0; +} +.lang_rtl .dev_top_lang_icon { + margin-right: 0; + margin-left: 4px; +} +.tlb_top_lang_select.open .dev_top_lang_icon { + background: url("data:image/svg+xml;utf8,") no-repeat 0 0; +} +.navbar-nav > li.top_lang_select > .dropdown-menu, +.top_lang_select.tlb_top_lang_select > .dropdown-menu { + width: 280px; + min-width: 280px; + border-radius: 8px; + padding: 14px; + right: 0; + left: auto; + margin-top: 4px; + box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, .10); + border-color: #e8e8e8; + + transition: transform ease-in-out 0.15s, opacity ease-out 0.15s; + transform-origin: top right; + transform: scaleX(0.15) scaleY(0.15); + display: block; + opacity: 0; + pointer-events: none; +} +.lang_rtl .navbar-nav > li.top_lang_select > .dropdown-menu, +.lang_rtl .top_lang_select.tlb_top_lang_select > .dropdown-menu { + transform-origin: top left; + right: auto; + left: 0; +} +body.preload .top_lang_select > .dropdown-menu, +.top_lang_select.tlb_top_lang_select > .dropdown-menu { + transition: none !important; +} +.navbar-nav > li.top_lang_select.open > .dropdown-menu, +.top_lang_select.tlb_top_lang_select.open > .dropdown-menu { + transform: scaleX(1.0) scaleY(1.0); + opacity: 1; + pointer-events: all; +} +.navbar-nav > li.top_lang_select > .dropdown-menu.dropdown-menu--short, +.top_lang_select.tlb_top_lang_select > .dropdown-menu.dropdown-menu--short { + width: 155px; + min-width: 155px; +} +@media (max-width: 640px) { + .navbar-nav > li.dev_top_lang_select > .dropdown-menu { + left: 0; + right: auto; + } +} +.top_lang_select .dropdown-menu li { + float: left; + display: block; + width: 125px; +} +.lang_rtl .top_lang_select .dropdown-menu li { + float: right; + text-align: right; +} + +.top_lang_select .dropdown-menu li.divider { + float: none; + clear: left; + width: auto; + margin: 6px 0; +} +.top_lang_select .dropdown-menu li a { + display: inline-block; + font-size: 13px; + max-width: 125px; + padding: 9px 10px; + border-radius: 4px; + white-space: normal; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + line-height: 15px; + margin: 0; +} +.top_lang_select .dropdown-menu li.long a { + font-size: 12px; +} +.top_lang_select .dropdown-menu li.missing a { + color: #777; +} +.navbar-nav > .top_lang_select .dropdown-menu li a:hover { + background: #e8f3fa; + color: #0088cc; +} +.top_lang_select.tlb_top_lang_select .dropdown-menu li a:hover { + background: #3faee8; + color: #fff; +} +.top_lang_select .dropdown-menu li.chosen a, +.top_lang_select .dropdown-menu li.chosen a:hover { + color: #000; + background: #fff; +} +.top_lang_select .minicaret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: 4px solid; + border-right: 4px solid transparent; + border-left: 4px solid transparent; +} +.lang_rtl .top_lang_select .minicaret { + margin-left: 0; + margin-right: 2px; +} + +#login_widget_config { + margin: 40px auto; +} +.form-group .dropdown + .dropdown { + margin-left: 15px; +} +.dropdown-label { + margin-right: 7px; + display: inline-block; + max-width: 300px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + vertical-align: top; +} +.dropdown-label .muted { + color: #999; +} + +.textfield-item input.form-control, +.form-control-dropdown-select, +.form-control-static-item, +.textfield-item-placeholder { + font-size: 14px; + line-height: 20px; + font-weight: normal; +} +.textfield-item input.form-control, +.form-control-dropdown-select { + padding: 11px 0 10px; + border: none; + height: auto; + resize: none; + color: inherit; + background: transparent; + border-bottom: 1px solid #e0e0e0; + box-shadow: none; +} +.textfield-item input.form-control:focus { + box-shadow: none; +} +.form-control-static-item { + padding: 11px 0; +} + +.textfield-item { + display: block; + position: relative; +} +.textfield-item-underline { + display: block; + position: absolute; + bottom: 0; + left: 50%; + right: 50%; + height: 2px; + background: #39ade7; + transition: opacity .2s ease-out, left 0s .2s linear, right 0s .2s linear; + opacity: 0; +} +.textfield-item input.form-control:focus ~ .textfield-item-underline { + transition: left .2s ease-out, right .2s ease-out; + left: 0; + right: 0; + opacity: 1; +} +.textfield-item-placeholder { + bottom: 0; + color: #ccc; + color: rgba(0,0,0,.26); + left: 0; + right: 0; + pointer-events: none; + position: absolute; + display: block; + top: 11px; + width: 100%; + overflow: hidden; + white-space: nowrap; + text-align: left +} + +.textfield-item input.form-control::-webkit-input-placeholder { + color: #999; + color: rgba(0,0,0,.42); +} +.textfield-item input.form-control::-moz-placeholder { + color: #999; + color: rgba(0,0,0,.42); +} +.textfield-item input.form-control:-ms-input-placeholder { + color: #999; + color: rgba(0,0,0,.42); +} +.textfield-item input.form-control:focus::-webkit-input-placeholder { + color: #ccc; + color: rgba(0,0,0,.26); +} +.textfield-item input.form-control:focus::-moz-placeholder { + color: #ccc; + color: rgba(0,0,0,.26); +} +.textfield-item input.form-control:focus:-ms-input-placeholder { + color: #ccc; + color: rgba(0,0,0,.26); +} +.textfield-item-error { + color: #d45a58; + position: absolute; + font-size: 14px; + line-height: 19px; + min-height: 19px; + margin: 5px 0 -19px; + background: #fff; + width: 100%; + padding-bottom: 7px; + visibility: hidden; + display: block; +} +.textfield-item.is-invalid .textfield-item-error { + visibility: visible +} +.textfield-item.is-invalid input.form-control { + border-bottom: 1px solid #d50000; +} +.textfield-item.is-invalid .textfield-item-underline { + background: #d50000; +} +.control-label-item, +.form-telegram .control-label { + text-align: right; + margin-bottom: 0; + line-height: 20px; + padding-top: 11px; +} +.form-telegram .help-block { + font-size: 13px; + color: #808080; + margin-top: 10px; + margin-bottom: 5px; +} +.form-telegram .form-group { + margin-bottom: 20px; +} +.form-telegram textarea.form-control { + margin-top: 7px; +} +.form-telegram .form-control[readonly] { + cursor: text; + background: #fff; +} +.form-telegram .form-control[readonly]:focus { + border: 1px solid #ccc; + box-shadow: none; +} +.form-control-dropdown { + position: relative; +} +.form-control-dropdown.has-items:before { + content: ''; + position: absolute; + display: inline-block; + margin: 16px 10px 0; + width: 14px; + height: 9px; + background: url(/img/rc_icons.png?1) no-repeat -3px -144px; + right: 0; + top: 0; +} +.form-control-dropdown .form-control-dropdown-search { + position: absolute; + top: 0; + left: 0; + right: 0; + visibility: hidden; + opacity: 0; +} +.form-control-dropdown.open .form-control-dropdown-search { + visibility: visible; + opacity: 1; +} +.form-control-dropdown.open .form-control-dropdown-select { + visibility: hidden; + opacity: 0; +} +.form-control-dropdown-select { + color: #ccc; + color: rgba(0,0,0,.26); + cursor: pointer; + position: relative; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.form-control-dropdown-select:focus { + outline: none; +} +.form-control-dropdown-select.is-dirty { + color: inherit; +} +.form-control-dropdown-button { + position: absolute; + display: inline-block; + transition: all .2s ease; + border: none; + padding: 0; + background: none !important; + visibility: hidden; + opacity: 0; + top: 0; + right: 0; +} +.form-control-dropdown-button:active { + box-shadow: none !important; +} +.form-control-dropdown-button:before { + content: ''; + display: inline-block; + margin: 16px 10px; + width: 14px; + height: 9px; + background: url(/img/rc_icons.png?1) no-repeat -3px -144px; + vertical-align: top; +} +.form-control-dropdown-list { + position: absolute; + left: -15px; + right: -15px; + margin: -2px 0; + background: #fff; + text-align: left; + padding: 7px 0; + box-shadow: 0 0 2px 1px rgba(0, 0, 0, .15); + border: none; + transition: all .2s ease; + visibility: hidden; + opacity: 0; + max-height: 220px; + overflow: auto; + overflow-x: hidden; + -webkit-overflow-scrolling: touch; + z-index: 10; +} +.form-control-dropdown.has-items .form-control-dropdown-button, +.form-control-dropdown.has-items.open .form-control-dropdown-list { + visibility: visible; + opacity: 1; +} +.form-control-dropdown-list-item, +.form-control-dropdown-list-no-results { + font-size: 14px; + line-height: 18px; + padding: 8px 15px; + cursor: pointer; +} +.form-control-static-item .small, +.form-control-dropdown-select .small, +.form-control-dropdown-list-item .small { + font-size: 13px; + line-height: 16px; + color: #a8a8a8; + padding-left: 8px; +} +.form-control-dropdown-search .form-control-dropdown-list-item:hover { + background: none; +} +.form-control-dropdown-search .form-control-dropdown-list-item.selected, +.form-control-dropdown-list-item:hover { + background: #f2f2f2; +} +.form-control-dropdown-list-no-results { + color: #a8a8a8; + cursor: auto; +} +.form-control-dropdown-select, +.form-control-dropdown input.form-control { + padding-right: 33px; +} +.help-block-item { + display: block; + font-size: 14px; + line-height: 18px; + margin-top: 5px; + margin-bottom: 0; + color: #a8a8a8; +} +.help-block-item a { + color: #76bfeb; +} + +.radio-item, +.checkbox-item { + display: inline-block; + vertical-align: top; + margin-bottom: 0; + font-size: 14px; + line-height: 20px; + font-weight: normal; +} +.radio-item-block, +.checkbox-item-block { + display: block; + margin: 6px 0 1px; + padding: 5px 0; + line-height: 20px; +} +.radio-item-block + .radio-item-block, +.checkbox-item-block + .checkbox-item-block { + margin-top: 1px; +} +.radio-item input.radio, +.checkbox-item input.checkbox { + position: absolute; + left: -5000px; +} +body.rtl .radio-item input.radio, +body.rtl .checkbox-item input.checkbox { + right: -5000px; + left: auto; +} +.radio-item input.radio ~ .radio-label, +.checkbox-item input.checkbox ~ .checkbox-label { + display: inline-block; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; + max-width: calc(100% - 31px); +} +.radio-item .radio-input, +.checkbox-item .checkbox-input { + display: inline-block; + vertical-align: top; + position: relative; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; + transition: opacity 0.12s linear; +} +.radio-item .radio-input + .radio-label, +.checkbox-item .checkbox-input + .checkbox-label { + margin-left: 11px; +} +body.rtl .radio-item .radio-input + .radio-label, +body.rtl .checkbox-item .checkbox-input + .checkbox-label { + margin-right: 11px; + margin-left: 0; +} +.radio-item .radio-input-icon, +.checkbox-item .checkbox-input-icon { + display: inline-block; + content: ''; + width: 20px; + height: 20px; + border: 2px solid #b3b3b3; + background: #fff; + border-radius: 10px; + vertical-align: top; + padding: 0; + cursor: pointer; + position: relative; +} +.radio-item .radio-input-icon:before, +.checkbox-item .checkbox-input-icon:before { + display: inline-block; + content: ''; + position: absolute; + width: 20px; + height: 20px; + border: 2px solid #54a9eb; + border-radius: 10px; + top: -2px; + left: -2px; + transition: opacity 0.12s linear; + opacity: 0; +} +.radio-item .radio-input-icon:after { + display: inline-block; + content: ''; + position: absolute; + width: 10px; + height: 10px; + background: #54a9eb; + border-radius: 5px; + top: 3px; + left: 3px; + transition: transform 0.12s linear; + transform: scale3d(0, 0, 1); +} +.radio-item input.radio:checked + .radio-input .radio-input-icon:before, +.checkbox-item input.checkbox:checked + .checkbox-input .checkbox-input-icon:before { + opacity: 1; +} +.radio-item input.radio:checked + .radio-input .radio-input-icon:after { + transform: scale3d(1, 1, 1); +} +.checkbox-item .checkbox-input-icon, +.checkbox-item .checkbox-input-icon:before { + width: 18px; + height: 18px; + margin: 1px; + border-radius: 3px; +} +.checkbox-item .checkbox-input-icon:before { + margin: 0; + background: #54a9eb url('data:image/svg+xml,%3Csvg height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%23fff" fill-rule="evenodd"%3E%3Crect height="6" rx="1" transform="matrix(.70710678 -.70710678 .70710678 .70710678 -6.746804 8.368629)" width="2" x="5.728427" y="9.328427"/%3E%3Crect height="11.5" rx="1" transform="matrix(.70710678 .70710678 -.70710678 .70710678 10.712311 -5.169417)" width="2" x="10.596194" y="4.596194"/%3E%3C/g%3E%3C/svg%3E') no-repeat center; +} +.radio-item input.radio:disabled + .radio-input, +.checkbox-item input.checkbox:disabled + .checkbox-input { + cursor: default; + pointer-events: none; + opacity: .65; +} + +.button-item { + font-size: 14px; + font-weight: 500; + line-height: 18px; + color: #fff; + background: #4ca3e2; + border-radius: 19px; + display: inline-block; + padding: 10px 26px; + text-transform: uppercase; + text-align: center; + vertical-align: middle; + border: none; + transition: background-color .2s ease; + white-space: nowrap; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.button-item-flat { + color: #1385d8; + background: transparent; +} +.button-item:hover { + background: #4199d9; +} +.button-item-flat:hover { + background: #e7f4fd; +} +.button-item-label { + display: inline-block; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + vertical-align: top; + position: relative; + z-index: 1; +} + +.button-item.ripple-handler, +.button-nostyle-item.ripple-handler { + position: relative; +} +.ripple-mask { + position: absolute; + left: 0; right: 0; + top: 0; bottom: 0; + transform: translateZ(0); + overflow: hidden; + pointer-events: none; +} +.radio-item .ripple-mask, +.checkbox-item .ripple-mask { + width: 32px; + height: 32px; + left: -6px; + top: -6px; + border-radius: 16px; +} +.button-nostyle-item .ripple-mask, +.button-item .ripple-mask { + border-radius: 19px; +} +.radio-item .ripple, +.checkbox-item .ripple { + position: absolute; + width: 80px; + height: 80px; + left: -24px; + top: -24px; + border-radius: 50%; + background-color: rgba(179, 179, 179, .2); + transition: transform .65s ease-out, opacity .65s ease-out, background-color .65s ease-out; + opacity: 0; +} +.radio-item input.radio:checked + .radio-input .ripple, +.checkbox-item input.checkbox:checked + .checkbox-input .ripple { + background-color: rgba(84, 169, 235, .2); +} +.button-nostyle-item .ripple, +.button-item .ripple { + position: absolute; + width: 200%; + left: 50%; top: 50%; + margin: -100% 0 0 -100%; + padding-top: 200%; + border-radius: 50%; + background-color: #3790cf; + transition: transform .65s ease-out, opacity .65s ease-out, background-color .65s ease-out; + opacity: 0; +} +.button-nostyle-item .ripple, +.button-item-flat .ripple { + background-color: #d9ebf7; +} + +.radio-item input.radio + .radio-label:before, +.checkbox-item input.checkbox + .checkbox-label:before { + display: inline-block; + content: ''; + width: 20px; + height: 20px; + vertical-align: top; + margin-right: 11px; + padding: 0; + background: url(/img/rc_icons.png?1) no-repeat; + cursor: pointer; +} +.radio-item input.radio + .radio-label:before { + background-position: 0 0; +} +.radio-item input.radio:checked + .radio-label:before { + background-position: 0 -30px; +} +.checkbox-item input.checkbox + .checkbox-label:before { + background-position: 0 -60px; +} +.checkbox-item input.checkbox:checked + .checkbox-label:before { + background-position: 0 -88px; +} +.radio-item-justified .radio-input { + float: left; +} +.radio-item-justified .radio-label { + float: left; + margin-right: 16px; +} +.radio-item-justified .radio-label:after { + content: ':'; + opacity: 0; + transition: opacity .2s ease; +} +.radio-item-justified .justified-wrap { + display: block; + padding: 5px 0; + margin: -5px 0; + overflow: hidden; + opacity: 0; + transition: opacity .2s ease; +} +.radio-item-justified .justified-wrap input.form-control { + cursor: inherit; +} +.radio-item-justified input.radio:checked ~ .justified-wrap, +.radio-item-justified input.radio:checked ~ .radio-label:after { + opacity: 1; +} +.radio-item-justified input.radio:checked ~ .justified-wrap input.form-control { + cursor: auto; +} +.radio-item-justified .textfield-item { + margin: -5px 0; +} +.radio-item-justified input.form-control { + padding: 5px 0 4px; +} + +.bgcolor0 { background: #e17076; } +.bgcolor1 { background: #faa774; } +.bgcolor2 { background: #a695e7; } +.bgcolor3 { background: #7bc862; } +.bgcolor4 { background: #6ec9cb; } +.bgcolor5 { background: #65aadd; } +.bgcolor6 { background: #ee7aae; } + +.dots-animated:after { + display: inline-block; + animation: dotty steps(1, end) 1s infinite; + content: '...'; + position: absolute; +} + +@-webkit-keyframes dotty { + 0%, 100% { content: ''; } + 25% { content: '.'; } + 50% { content: '..'; } + 75% { content: '...'; } +} +@keyframes dotty { + 0%, 100% { content: ''; } + 25% { content: '.'; } + 50% { content: '..'; } + 75% { content: '...'; } +} + +.widget_container { + padding: 10px 20px; + margin: -10px 0; + text-align: center; +} +.widget_container.dark { + background: #15202b; +} +.widget_container iframe { + vertical-align: top; +} + +button.dropdown-toggle:focus, +button.dropdown-toggle:active:focus { + outline: none; +} +.embed_code { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + white-space: pre-wrap; + word-break: break-all; + word-wrap: break-word; + text-align: left; + -webkit-appearance: none; +} + +.dev_page_nav_wrap > p > a:first-child { + color: #333; +} + +#dev_page_content .dev_page_nav_wrap ul { + list-style-type: none; + margin: 0; + padding: 0 0 20px; +} +#dev_page_content .dev_page_nav_wrap ul + h4 { + margin-top: 4px; +} +#dev_page_content .dev_page_nav_wrap ul li { + background: none; + padding-left: 0; + padding-top: 1px; + padding-bottom: 2px; +} + +.dev_page_image { + display: block; + max-width: 800px; + margin: 0 auto; + padding: 10px 0px 5px; +} +.tl_contest_page_wrap .dev_page_image { + max-width: 600px; +} + +.dev_page_tgsticker { + position: relative; + display: block; + max-width: 256px; +} +.dev_page_tgsticker img, +.dev_page_tgsticker canvas { + position: absolute; + top: 0; bottom: 0; + left: 0; right: 0; + width: 100%; + height: 100%; +} + +.dev_page_widget_item { + display: block; + width: 300px; + vertical-align: top; + max-width: 100%; + margin: 30px auto 10px; +} +.dev_page_widget_thumb { + display: inline-block; + vertical-align: top; + width: 100%; + padding-top: 66.6667%; + border-radius: 12px; + background: #f7f7f7 no-repeat center; + background-size: 100%; + -webkit-filter: brightness(100%); + -webkit-transition: all .2s ease; + -moz-transition: all .2s ease; + -o-transition: all .2s ease; + -ms-transition: all .2s ease; + transition: all .2s ease; +} +.dev_page_widget_thumb:hover { + -webkit-filter: brightness(94%); +} +.dev_page_widget_thumb_share { + background-image: url(/img/Widget_Share.svg?1); +} +.dev_page_widget_thumb_post { + background-image: url(/img/Widget_Post.svg?1); +} +.dev_page_widget_thumb_login { + background-image: url(/img/Widget_Login.svg?1); +} +.dev_page_widget_thumb_comments { + background-image: url(/img/Widget_Comments.svg?1); +} +.dev_page_widget_title { + font-size: 15px; + line-height: 1.5; + margin: 12px 0 0; + font-weight: bold; + text-align: center; +} +@media (min-width: 670px) { + .dev_page_widgets_list { + margin-right: -36px; + } + .dev_page_widget_item { + float: left; + margin-left: 0; + margin-right: 36px; + } + .dev_page_widget_title { + margin-top: 17px; + } +} + +/* Contest */ + +.tl_contest_page_wrap { + padding: 0 0 20px; + max-width: 600px; + margin: 0 auto; +} +.tl_contest_intro { + margin: 0; +} +.tl_contest_side_image_wrap { + position: relative; +} +.tl_contest_side_image { + margin: 50px 0 0 -180px; + width: 160px; + height: 160px; + position: absolute; +} +.tl_contest_side_image2 { + margin-top: 0px; +} +.tl_contest_side_image3 { + margin-top: 10px; +} +.tl_contest_page_wrap .tl_main_share { + margin: 0 0 20px; + text-align: left; +} +.lang_rtl .tl_contest_page_wrap .tl_main_share { + text-align: right; +} +.tl_contest_page_wrap #dev_page_title { + font-size: 24.5px; + line-height: 33px; + margin: 20px 0 10px 0; +} +.tl_contest_dl_btn { + padding: 0; +} +#traffic_log_wrap { + min-height: 300px; + /*max-height: 600px;*/ + /*overflow: auto;*/ + overflow-wrap: normal; + white-space: pre; +} + +.tl_contest_log { + padding-top: 10px; +} +.tl_contest_log h3 { + margin-top: 0; +} + +/* Blog */ +.blog_side_image_wrap { + position: relative; + direction: ltr; +} +.lang_rtl .blog_side_image_wrap { + direction: rtl; +} +.blog_side_image { + margin: -41px 0 0 -180px; + width: 160px; + height: 160px; + position: absolute; +} +.lang_rtl .blog_side_image { + margin: -41px -180px 0 0; +} + +.blog_side_centered_image_wrap { + position: relative; +} +a.blog_side_cetered_image, +a.blog_side_centered_image { + display: block; + width: 160px; + height: 160px; + margin: 10px auto 20px; +} +img.blog_side_cetered_image, +img.blog_side_centered_image { + width: 160px; + height: 160px; +} + +.tlb_blog_page .blog_side_image_wrap { + position: static; +} +.tlb_blog_page .blog_side_image { + display: block; + margin: 20px auto; + width: 160px; + height: 160px; + position: static; +} + +.blog_wide_image img { + width: 100%; + padding-bottom: 20px; +} +.blog_image_wrap { + width: 275px; + margin: 10px auto 20px; +} +.blog_image_wrap a { + +} +.blog_image_wrap img { + width: 275px; + padding: 10px 5px; +} +.blog_medium_image_wrap, +.blog_medium_image_wrap img { + width: 400px; +} + +.blog_wide_image_wrap, +.blog_wide_image_wrap img { + width: 100%; + max-width: auto; +} +#dev_page_content .blog_image_wrap p, +.tlb_page_wrap .tl_contest_page_wrap #dev_page_content .blog_image_wrap p { + text-align: center; + color: #808080; + font-size: 12px; + margin: 10px 0 0; + line-height: 150%; + padding: 0 10px; +} +.blog_footer { + font-style: italic; +} + +.blog_2images_wrap, +.blog_3images_wrap { + width: 564px; + margin: 20px auto 20px; +} +.blog_3images_wrap { + width: 575px; +} +.blog_2images_wrap:before, +.blog_2images_wrap:after, +.blog_3images_wrap:before, +.blog_3images_wrap:after { + content: " "; + display: table; +} +.blog_2images_wrap:after, +.blog_3images_wrap:after { + clear: both; +} +.blog_2images_wrap .blog_image_wrap, +.blog_3images_wrap .blog_image_wrap { + float: left; + margin-left: 0; + margin-right: 14px; +} +.blog_3images_wrap .blog_image_wrap { + margin-right: 10px; +} +.blog_2images_wrap .blog_image_wrap:last-child, +.blog_3images_wrap .blog_image_wrap:last-child { + margin-right: 0; +} + + +.blog_video_player_wrap { + max-width: 640px; + margin: 10px auto 20px; +} +.blog_video_player { + width: 100%; +} + + +/* My page */ +.my_page_wrap { + margin-top: 50px; + font-size: 14px; + line-height: 20px; +} +.my_page_wrap .container { + max-width: 570px; +} + +.my_page_wrap .tl_main_card { + margin: 0; +} +#my_login_form_wrap { + max-width: 400px; +} +.my_login_form_details { + margin: 10px 0 20px; +} + + +#my_login_form_wrap .btn { + box-shadow: none; + margin-bottom: 0; + font-size: 14px; + font-weight: normal; + line-height: 1.428571429; + text-align: center; + white-space: nowrap; + vertical-align: middle; + cursor: pointer; + background-image: none; + border: 1px solid transparent; + border: 0; + border-radius: 4px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; + text-shadow: none; +} +#my_login_form_wrap .btn-primary { + color: #fff; + background-color: #428bca; + border-color: #357ebd; +} +#my_login_form_wrap .btn-danger { + color: #fff; + background-color: #d9534f; + border-color: #d43f3a; +} +#my_login_form_wrap .btn-success { + color: #fff; + background-color: #5cb85c; + border-color: #4cae4c; +} +.modal-header h4 { + position: static; +} + +.my_email_confirmation_result_wrap { + margin-top: 40px; +} +.my_email_confirmation_result_text { + padding: 10px; + font-size: 24px; + font-weight: bold; + line-height: 1.2; + text-align: center; +} + + +.smartphone_video_player_wrap { + width: 270px; + height: 555px; + margin: 20px auto; + position: relative; + background: #000 url(../img/iPhone6.png) 0 0 no-repeat; + background-size: 270px 555px; +} +.smartphone_video_player_iphone { + position: absolute; + margin-top: 69px; + margin-left: 18px; + border-radius: 3px; + overflow: hidden; + line-height: 0; +} +video.smartphone_video_player { + cursor: pointer; + width: 234px; + height: 416px; + line-height: 0; + margin: 0; + vertical-align: top; +} + + +.smarphone_device_nexus { + margin: 40px auto; + padding: 45px 14px 45px 14px; + width: 290px; + height: 514px; + background: #1e1e1e; + border-radius: 18.125px; + display: block; + position: relative; + box-sizing: content-box; +} +.smarphone_device_nexus:before { + -webkit-border-radius: 540px / 45px; + border-radius: 540px / 45px; + background: inherit; + content: ''; + top: 0; + position: absolute; + height: 103.1%; + width: calc(100% - 23px); + top: 50%; + left: 50%; + -moz-transform: translateX(-50%) translateY(-50%); + -webkit-transform: translateX(-50%) translateY(-50%); + -o-transform: translateX(-50%) translateY(-50%); + -ms-transform: translateX(-50%) translateY(-50%); + transform: translateX(-50%) translateY(-50%); + box-sizing: content-box; +} +.smarphone_device_nexus .top-bar { + width: calc(100% - 7px); + height: calc(100% - 5px); + position: absolute; + top: 3px; + left: 4px; + -webkit-border-radius: 18px; + border-radius: 18px; + background: #181818; + box-sizing: content-box; +} +.smarphone_device_nexus .top-bar:before { + -webkit-border-radius: 540px / 45px; + border-radius: 540px / 45px; + background: inherit; + content: ''; + top: 0; + position: absolute; + height: 103.0%; + width: calc(100% - 26px); + top: 50%; + left: 50%; + -moz-transform: translateX(-50%) translateY(-50%); + -webkit-transform: translateX(-50%) translateY(-50%); + -o-transform: translateX(-50%) translateY(-50%); + -ms-transform: translateX(-50%) translateY(-50%); + transform: translateX(-50%) translateY(-50%); + box-sizing: content-box; +} +.smarphone_device_nexus .bottom-bar{ + display: none; + box-sizing: content-box; +} +.smarphone_device_nexus .sleep { + width: 3px; + position: absolute; + left: -3px; + top: 99px; + height: 90px; + background: inherit; + -webkit-border-radius: 2px 0px 0px 2px; + border-radius: 2px 0px 0px 2px; + box-sizing: content-box; +} +.smarphone_device_nexus .volume { + width: 3px; + position: absolute; + right: -3px; + top: 63px; + height: 45px; + background: inherit; + -webkit-border-radius: 0px 2px 2px 0px; + border-radius: 0px 2px 2px 0px; + box-sizing: content-box; +} +.smarphone_device_nexus .camera { + background: #3c3d3d; + width: 9px; + height: 9px; + position: absolute; + top: 18px; + left: 50%; + z-index: 3; + margin-left: -5px; + border-radius: 100%; + box-sizing: content-box; +} +.smarphone_device_nexus .camera:before { + background: #3c3d3d; + width: 6px; + height: 6px; + content: ''; + display: block; + position: absolute; + top: 2px; + left: -90px; + z-index: 3; + border-radius: 100%; + box-sizing: content-box; +} +.smarphone_device_nexus .screen { + position: relative; + box-sizing: content-box; +} +.smarphone_device_nexus video { + display: block; + width: 290px; + height: 514px; + margin: 0 auto; +} + + +/* Telegram Me */ +.tgme_page_wrap { + font-family: 'Roboto', sans-serif;; + color: #2b2d2e; +} +.tgme_page_wrap a, +.tgme_page_wrap a:hover, +.tgme_page_wrap a:active { + color: #3ca2d9; +} + +.tgme_head_wrap { + background: #FFF; + height: 59px; + padding: 14px 16px; + -webkit-box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.15); + -moz-box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.15); + box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.15); +} +.tgme_logo { + display: inline-block; + background: url('data:image/svg+xml,%3Csvg height="34" viewBox="0 0 133 34" width="133" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Ccircle cx="17" cy="17" fill="%2327a7e5" r="17"/%3E%3Cpath d="m7.06510669 16.9258959c5.22739451-2.1065178 8.71314291-3.4952633 10.45724521-4.1662364 4.9797665-1.9157646 6.0145193-2.2485535 6.6889567-2.2595423.1483363-.0024169.480005.0315855.6948461.192827.1814076.1361492.23132.3200675.2552048.4491519.0238847.1290844.0536269.4231419.0299841.65291-.2698553 2.6225356-1.4375148 8.986738-2.0315537 11.9240228-.2513602 1.2428753-.7499132 1.5088847-1.2290685 1.5496672-1.0413153.0886298-1.8284257-.4857912-2.8369905-1.0972863-1.5782048-.9568691-2.5327083-1.3984317-4.0646293-2.3321592-1.7703998-1.0790837-.212559-1.583655.7963867-2.5529189.2640459-.2536609 4.7753906-4.3097041 4.755976-4.431706-.0070494-.0442984-.1409018-.481649-.2457499-.5678447-.104848-.0861957-.2595946-.0567202-.3712641-.033278-.1582881.0332286-2.6794907 1.5745492-7.5636077 4.6239616-.715635.4545193-1.3638349.6759763-1.9445998.6643712-.64024672-.0127938-1.87182452-.334829-2.78737602-.6100966-1.12296117-.3376271-1.53748501-.4966332-1.45976769-1.0700283.04048-.2986597.32581586-.610598.8560076-.935815z" fill="%23fff"/%3E%3Cpath d="m49.4 24v-12.562h-4.224v-2.266h11.198v2.266h-4.268v12.562zm16.094-4.598h-7.172c.066 1.936 1.562 2.772 3.3 2.772 1.254 0 2.134-.198 2.97-.484l.396 1.848c-.924.396-2.2.682-3.74.682-3.476 0-5.522-2.134-5.522-5.412 0-2.97 1.804-5.764 5.236-5.764 3.476 0 4.62 2.86 4.62 5.214 0 .506-.044.902-.088 1.144zm-7.172-1.892h4.708c.022-.99-.418-2.618-2.222-2.618-1.672 0-2.376 1.518-2.486 2.618zm9.538 6.49v-15.62h2.706v15.62zm14.84-4.598h-7.172c.066 1.936 1.562 2.772 3.3 2.772 1.254 0 2.134-.198 2.97-.484l.396 1.848c-.924.396-2.2.682-3.74.682-3.476 0-5.522-2.134-5.522-5.412 0-2.97 1.804-5.764 5.236-5.764 3.476 0 4.62 2.86 4.62 5.214 0 .506-.044.902-.088 1.144zm-7.172-1.892h4.708c.022-.99-.418-2.618-2.222-2.618-1.672 0-2.376 1.518-2.486 2.618zm19.24-1.144v6.072c0 2.244-.462 3.85-1.584 4.862-1.1.99-2.662 1.298-4.136 1.298-1.364 0-2.816-.308-3.74-.858l.594-2.046c.682.396 1.826.814 3.124.814 1.76 0 3.08-.924 3.08-3.234v-.924h-.044c-.616.946-1.694 1.584-3.124 1.584-2.662 0-4.554-2.2-4.554-5.236 0-3.52 2.288-5.654 4.862-5.654 1.65 0 2.596.792 3.102 1.672h.044l.11-1.43h2.354c-.044.726-.088 1.606-.088 3.08zm-2.706 2.948v-1.738c0-.264-.022-.506-.088-.726-.286-.99-1.056-1.738-2.2-1.738-1.518 0-2.64 1.32-2.64 3.498 0 1.826.924 3.3 2.618 3.3 1.012 0 1.892-.66 2.2-1.65.088-.264.11-.638.11-.946zm5.622 4.686v-7.26c0-1.452-.022-2.508-.088-3.454h2.332l.11 2.024h.066c.528-1.496 1.782-2.266 2.948-2.266.264 0 .418.022.638.066v2.53c-.242-.044-.484-.066-.814-.066-1.276 0-2.178.814-2.42 2.046-.044.242-.066.528-.066.814v5.566zm16.05-6.424v3.85c0 .968.044 1.914.176 2.574h-2.442l-.198-1.188h-.066c-.638.836-1.76 1.43-3.168 1.43-2.156 0-3.366-1.562-3.366-3.19 0-2.684 2.398-4.07 6.358-4.048v-.176c0-.704-.286-1.87-2.178-1.87-1.056 0-2.156.33-2.882.792l-.528-1.76c.792-.484 2.178-.946 3.872-.946 3.432 0 4.422 2.178 4.422 4.532zm-2.64 2.662v-1.474c-1.914-.022-3.74.374-3.74 2.002 0 1.056.682 1.54 1.54 1.54 1.1 0 1.87-.704 2.134-1.474.066-.198.066-.396.066-.594zm5.6 3.762v-7.524c0-1.232-.044-2.266-.088-3.19h2.31l.132 1.584h.066c.506-.836 1.474-1.826 3.3-1.826 1.408 0 2.508.792 2.97 1.98h.044c.374-.594.814-1.034 1.298-1.342.616-.418 1.298-.638 2.2-.638 1.76 0 3.564 1.21 3.564 4.642v6.314h-2.64v-5.918c0-1.782-.616-2.838-1.914-2.838-.924 0-1.606.66-1.892 1.43-.088.242-.132.594-.132.902v6.424h-2.64v-6.204c0-1.496-.594-2.552-1.848-2.552-1.012 0-1.694.792-1.958 1.518-.088.286-.132.594-.132.902v6.336z" fill="%23363b40" fill-rule="nonzero"/%3E%3C/g%3E%3C/svg%3E') 0 0 no-repeat; + width: 133px; + height: 34px; + margin: -1px 0; +} +a.tgme_head_dl_button { + display: block; + font-size: 16px; + line-height: 100%; + color: #FFF; + background: #32afed; + padding: 2px 15px 0 16px; + height: 45px; + line-height: 43px; + text-align: center; +} +.tlb_page_wrap a.tgme_head_dl_button { + color: #FFF; +} +a.tgme_head_dl_button:hover, +a.tgme_head_dl_button:active, +.tlb_page_wrap a.tgme_head_dl_button:hover, +.tlb_page_wrap a.tgme_head_dl_button:active { + color: #FFF; + background: #32afed; + text-decoration: none; +} +.tgme_icon_arrow { + display: inline-block; + background: url(/img/tgme/Arrow_1x.png) 0 0 no-repeat; + width: 8px; + height: 12px; + background-size: 8px 12px; + vertical-align: top; + margin-top: 15px; + margin-left: 9px; +} + +.tgme_page { + position: relative; + margin: 52px auto 50px; + max-width: 424px; +} +.tgme_page_post { + max-width: 455px; + padding: 52px 0 50px; + margin: 0 auto; +} +.tgme_page_icon { + text-align: center; + margin-bottom: 20px; +} +.tgme_icon_user { + display: inline-block; + width: 40px; + height: 39px; + background: url(/img/tgme/Web1x.png?1) -2px -38px no-repeat; + background-size: 44px 177px; +} +.tgme_icon_group { + display: inline-block; + width: 44px; + height: 28px; + background: url(/img/tgme/Web1x.png?1) 0 0 no-repeat; + background-size: 44px 177px; +} +.tgme_icon_stickers { + display: inline-block; + width: 40px; + height: 40px; + background: url(/img/tgme/Web1x.png?1) -2px -87px no-repeat; + background-size: 44px 177px; +} +.tgme_icon_share { + display: inline-block; + width: 44px; + height: 23px; + background: url(/img/tgme/Web1x.png?1) 0 -137px no-repeat; + background-size: 44px 177px; +} +.tgme_page_photo { + text-align: center; + margin-top: -15px; + margin-bottom: 15px; +} +.tgme_page_photo_image { + width: 122px; + height: 122px; + border-radius: 61px; +} +.tgme_page_title { + font-size: 26px; + line-height: 32px; + font-weight: bold; + text-align: center; + max-width: 340px; + padding: 0 10px; + margin: 0 auto; + color: #333; + overflow: hidden; + text-overflow: ellipsis; +} +.verified-icon { + display: inline-block; + width: 1em; + height: 1em; + padding: 1px; + color: transparent; + background: url('data:image/svg+xml,%3Csvg height="26" viewBox="0 0 26 26" width="26" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="m14.378741 1.509638 1.818245 1.818557c.365651.365716.861601.571194 1.378741.571259l2.574273.000312c1.01361.000117 1.846494.773578 1.940861 1.762436l.008905.187798-.000312 2.5727c-.000065.517322.205439 1.013454.571259 1.379222l1.819649 1.819337c.714441.713427.759174 1.843179.134563 2.609139l-.134797.148109-1.819181 1.8182502c-.365963.3657823-.571558.8620196-.571493 1.3794456l.000312 2.5737972c.000559 1.0136048-.772668 1.846676-1.7615 1.9412861l-.188266.0084786-2.573792-.0003107c-.517426-.0000624-1.013675.2055248-1.379456.5714956l-1.818245 1.8191823c-.71331.7145515-1.843049.7594886-2.609113.1349998l-.148135-.1347645-1.8193435-1.8196542c-.3657628-.3658252-.8618987-.5713214-1.3792103-.571259l-2.5727052.0003107c-1.0136048.0001222-1.846676-.7731321-1.9412861-1.761968l-.0089492-.1877967-.0003107-2.5742678c-.0000624-.5171478-.2055495-1.0130926-.571259-1.3787397l-1.8185622-1.8182515c-.7139886-.713869-.758706-1.843647-.1340846-2.609607l.1338493-.148109 1.8190328-1.81935c.3655665-.365625.5709613-.861471.5710237-1.378494l.0003107-2.573181c.0006006-1.076777.8734635-1.949636 1.9502353-1.950234l2.5731758-.000312c.5170321-.000065 1.0128768-.205452 1.3785044-.571025l1.8193448-1.819038c.761592-.761449 1.996254-.761345 2.757716.000247zm3.195309 8.047806c-.426556-.34125-1.032655-.306293-1.417455.060333l-.099151.108173-4.448444 5.55815-1.7460313-1.74707-.1104961-.096564c-.4229264-.32188-1.0291801-.289692-1.4154413.096564-.3862612.386269-.4184492.992511-.0965653 1.41544l.0965653.1105 2.5999987 2.5999987.109876.0961467c.419874.320359 1.015131.2873897 1.397071-.0773773l.098579-.107692 5.2-6.4999961.083772-.120484c.273208-.455884.174278-1.054885-.252278-1.396122z" fill="%2333AFED" fill-rule="evenodd"/%3E%3C/svg%3E') no-repeat 0 0; + background-size: 100%; + vertical-align: -4px; + margin-left: 8px; +} +.tgme_page_extra { + font-size: 15px; + line-height: 27px; + text-align: center; + margin-bottom: 6px; + color: #808080; +} +.tgme_page_description, +.tgme_page_additional { + font-size: 16px; + line-height: 25px; + text-align: center; + max-width: 340px; + padding: 0 10px; + margin: 0 auto; + overflow: hidden; + text-overflow: ellipsis; +} +.tgme_page_description { + display: -webkit-box; + -webkit-line-clamp: 5; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + max-height: 125px; + word-break: break-word; +} +.tgme_page_long_description { + max-height: none; + -webkit-line-clamp: unset; +} +.tgme_page_additional { + display: none; + font-size: 14px; + line-height: 23px; + margin-top: 32px; + color: #808080; +} +a.tgme_username_link, +a.tgme_username_link:hover, +a.tgme_username_link:active { + text-decoration: none; +} +.tgme_page_action { + text-align: center; + margin-top: 32px; + line-height: 0; +} +a.tgme_action_button, +a.tgme_action_button_new { + font-size: 14px; + font-weight: bold; + line-height: 100%; + color: #FFF; + background: #5dc390; + border-radius: 22px; + overflow: hidden; + display: inline-block; + padding: 15px 27px 13px; + text-transform: uppercase; +} +a.tgme_action_button:hover, +a.tgme_action_button:active, +a.tgme_action_button_new:hover, +a.tgme_action_button_new:active { + color: #FFF; + background: #4bbc87; + text-decoration: none; +} +a.tgme_action_button_new { + background: #33d684; +} +a.tgme_action_button_new:hover, +a.tgme_action_button_new:active { + background: #28c979; +} + +.tgme_page_web_action { + margin-top: 18px; +} +.tgme_page_web_action a.tgme_action_button { + color: #5dc390;; + background: #fff; + border: 2px solid #5dc390; + padding: 13px 25px 11px; +} +.tgme_page_web_action a.tgme_action_button:hover, +.tgme_page_web_action a.tgme_action_button:active { + color: #5dc390;; + background: #FFF;; + text-decoration: none; +} +.tgme_action_privacy_action { + margin-top: 12px; +} +.tgme_action_privacy_action a.tgme_action_privacy_button { + color: #5dc390;; + background: #fff; + border: 0; + padding: 13px 25px 11px; + font-size: 12px; +} +.tgme_action_privacy_action a.tgme_action_privacy_button:hover, +.tgme_action_privacy_action a.tgme_action_privacy_button:active { + color: #5dc390;; + background: #FFF;; + text-decoration: none; +} + +.tgme_footer { + margin: 0 auto 50px; + border-top: 1px solid #e0e0e0; + max-width: 424px; + padding-top: 38px; +} + +.tgme_footer_description { + font-size: 17px; + line-height: 27px; + text-align: center; + max-width: 330px; + padding: 0 10px; + margin: 0 auto 0; +} +.tgme_footer_action { + text-align: center; + margin-top: 28px; + line-height: 0; +} +a.tgme_footer_dl_button { + background: #32afed; +} +a.tgme_footer_dl_button:hover, +a.tgme_footer_dl_button:active { + background: #1ca4e7; +} + +.tgme_page_widget { + margin-left: -45px; +} +.tgme_page_widget_action { + text-align: center; + line-height: 0; +} +.tgme_page_widget iframe { + vertical-align: top; + max-width: 100%; +} +.tgme_page_widget_actions { + position: relative; + max-width: 595px; + padding: 30px 0; +} +.fixed_actions .tgme_page_widget_actions { + position: fixed; + left: 0; + right: 0; + bottom: 0; + border-top: 1px solid #d7e3ec; + padding: 30px 70px; + margin: 0 auto; + background: #fff; +} +.tgme_page_widget_actions_cont { + max-width: 455px; + margin: 0 auto; + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} +.tgme_page_widget_actions .tgme_page_action { + position: relative; + margin: 0 auto; +} +.tgme_page_widget_action_right, +.tgme_page_widget_action_left { + width: 120px; + flex-grow: 2; +} +.tgme_page_widget_action_right { + float: right; + text-align: right; + order: 1; +} +.tgme_page_widget_action_left { + float: left; + text-align: left; +} +.tgme_page_widget_actions a.tgme_action_web_button { + border: none; + background: none; + padding: 15px 10px 13px; +} +.tgme_page_widget_actions a.tgme_action_web_button:hover { + text-decoration: underline; +} +.tgme_page_widget_actions a.tgme_action_web_button:before { + content: ''; + display: none; + width: 24px; + height: 24px; + margin: -7px 0 -7px 0; + background: url(/img/tgme/web_icon.png) 0 0 no-repeat; +} +.tgme_page_widget_actions .tgme_page_web_action { + margin-top: 0; + text-align: inherit; +} +.tgme_page_context_action { + margin-top: 8px; +} +.tgme_page_context_action a.tgme_action_button_new { + font-weight: normal; + text-transform: none; +} +.tgme_page_embed_action { + text-align: center; + margin-top: 30px; + display: none; + order: 3; + flex-basis: 100%; +} +.embed_opened .tgme_page_embed_action { + display: block; +} +.tgme_page_embed_btn { + line-height: 0; +} +.tgme_page_copy_action { + text-align: center; + margin-top: 18px; + margin-bottom: -16px; +} +.tgme_page_embed_btn a.tgme_action_button_new, +.tgme_page_context_btn a.tgme_action_button_new, +.tgme_page_copy_action a.tgme_action_button_new { + color: #8197af; + padding: 15px 10px 13px; + background: none; + cursor: pointer; +} +.tgme_page_embed_btn a.tgme_action_button_new:before { + content: ''; + display: inline-block; + width: 24px; + height: 24px; + margin: -7px 7px -7px 0; + background: url(/img/tgme/embed_icon.png?1) 0 0 no-repeat; +} +.embed_opened .tgme_page_embed_btn a.tgme_action_button_new:before { + background-position: -24px 0; +} +.tgme_page_copy_action a.tgme_action_button_new:before { + content: ''; + display: inline-block; + width: 24px; + height: 24px; + margin: -7px 7px -7px 0; + background: url(/img/tgme/embed_copy.png) 0 0 no-repeat; +} +.embed_opened .tgme_page_embed_btn a.tgme_action_button_new { + color: #2481cc; +} +.tgme_page_embed_action a.tgme_action_button_new:hover, +.tgme_page_embed_action a.tgme_action_button_new:active, +.tgme_page_copy_action a.tgme_action_button_new:hover, +.tgme_page_copy_action a.tgme_action_button_new:active { + color: #8197af; + text-decoration: none; + background: none; +} +.tgme_page_embed_code { + font-size: 13px; + color: #546172; + background: #ecf3f8; + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + width: 100%; + padding: 11px 17px; + border: 1px solid #d7e3ec; + border-radius: 10px; + white-space: pre-wrap; + word-break: break-all; + word-wrap: break-word; + text-align: left; + -webkit-appearance: none; + vertical-align: top; +} +.tgme_page_embed_code:focus { + outline: none; +} +@media (max-width: 595px) { + .tgme_page_widget { + padding: 0 10px; + margin-left: 0; + } + .tgme_page_widget_actions, + .fixed_actions .tgme_page_widget_actions { + padding: 20px 0; + } + .tgme_page_widget_action_right, + .tgme_page_widget_action_left { + text-align: center; + width: 20%; + } + .tgme_page_widget_actions .tgme_action_button_label { + display: none; + } + .tgme_page_widget_actions a.tgme_action_web_button:before { + display: inline-block; + } + .tgme_page_embed_btn a.tgme_action_button_new:before { + margin-right: 0; + } + .tgme_page_embed_action { + margin-top: 20px; + margin-left: 10px; + margin-right: 10px; + } + .tgme_page_copy_action { + margin-top: 8px; + } + #embed_code { + margin-top: 24px; + } +} + +.tgme_page_bg { + margin: 0; + max-width: none; +} +.tgme_bg_wrap { + height: 100%; + height: calc(100vh - 104px); + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; +} +.tgme_bg_image_wrap { + position: absolute; + width: 100%; + height: 100%; + height: calc(100vh - 104px); + overflow: hidden; +} +.tgme_bg_image { + width: 110%; + width: calc(100vw + 40px); + height: 110%; + height: calc(100vh - 104px + 40px); + margin: -20px; + + background-repeat: no-repeat; + background-size: cover; + z-index: 1; + + -webkit-filter: blur(5px); + -moz-filter: blur(5px); + -o-filter: blur(5px); + -ms-filter: blur(5px); + filter: blur(5px); +} +.tgme_bg_wrap_pattern1 .tgme_bg_image { + -webkit-filter: blur(8px); + -moz-filter: blur(8px); + -o-filter: blur(8px); + -ms-filter: blur(8px); + filter: blur(8px); +} +.tgme_bg_wrap_full .tgme_bg_image { + -webkit-filter: none; + -moz-filter: none; + -o-filter: none; + -ms-filter: none; + filter: none; +} +.tgme_bg { + position: relative; + z-index: 2; +} +.tgme_bg_popup_wrap { + background: #fff; + border-radius: 10px; + flex: 1 0 auto; + padding: 40px 40px 30px; + margin: 0 40px; + max-width: 390px; + text-align: center; +} +.tgme_bg_title { + font-size: 18px; + font-weight: bold; + margin: 0 0 10px; +} +.tgme_bg_size { + color: #64686B; + font-size: 14px; + margin: 10px 0 17px; +} + + +#tgme_frame_cont { + position: absolute; + left: -10000px; + top: -10000px; +} + +/* New mobile blog */ +.tlb_page_wrap { + font-family: 'Roboto', sans-serif;; +} +.tlb_page_wrap a, +.tlb_page_wrap a:hover, +.tlb_page_wrap a:active { + color: #1497d9; +} +.tlb_page_head { + background: #FFF; + height: 47px; + padding: 12px 12px; +} +.tlb_blog_logo { + display: inline-block; + background: url(/img/blog/BlogLogo1x.png?1) 0 0 no-repeat; + width: 146px; + height: 20px; + background-size: 146px 20px; + line-height: 0; + margin-top: 2px; +} +.tlb_head_home { + float: right; + display: inline-block; + line-height: 24px; + height: 24px; + vertical-align: top; + font-size: 14px; +} +a.tlb_blog_head_more_link { + display: block; + font-size: 15px; + color: #FFF; + background: #3faee8; + padding: 0 15px 0 15px; + height: 42px; + line-height: 42px; +} +a.tlb_blog_head_more_link:hover, +a.tlb_blog_head_more_link:active { + color: #FFF; + background: #3faee8; + text-decoration: none; +} + +a.tlb_blog_head_more_link .tlb_head_more_active, +.tlb_blog_head_recent_active a.tlb_blog_head_more_link .tlb_head_more_inactive, +.tlb_head_more_entries { + display: none; +} +.tlb_blog_head_recent_active a.tlb_blog_head_more_link .tlb_head_more_active, +.tlb_blog_head_recent_active .tlb_head_more_entries { + display: block; +} +.tlb_head_more_icon_wrap { + float: right; + vertical-align: top; + margin-top: 15px; + line-height: 0; +} +.lang_rtl .tlb_head_more_icon_wrap { + float: left; +} +.tlb_head_more_icon { + display: inline-block; + border: 2px solid #FFF; + border-left: 0; + border-bottom: 0; + width: 10px; + height: 10px; + + -moz-transform: rotate(135deg); + -webkit-transform: rotate(135deg); + -o-transform: rotate(135deg); + -ms-transform: rotate(135deg); + transform: rotate(135deg); + + /*-webkit-transition: all linear 0.2s; + -moz-transition: all linear 0.2s; + -ms-transition: all linear 0.2s; + -o-transition: all linear 0.2s; + transition: all linear 0.2s;*/ +} +.tlb_blog_head_recent_active .tlb_head_more_icon_wrap { + margin-top: 18px; +} +.tlb_blog_head_recent_active .tlb_head_more_icon { + -moz-transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); + -o-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + transform: rotate(-45deg); +} + +.tlb_page_wrap .side_blog_wrap { + margin: 22px 0 0 16px; + padding: 0 10px 0 0; + font-size: 13px; +} +.tlb_page_wrap .side_blog_wrap:before { + width: 4px; + background: #3faee8; + border-radius: 4px; + margin: 0 15px 0 0; +} +.lang_rtl .tlb_page_wrap .side_blog_wrap:before { + margin: 0 0 0 15px; +} + +.tlb_page_wrap .side_blog_header { + font-size: 15px; + font-weight: bold; +} +.tlb_page_wrap .side_blog_entry { + margin-top: 12px; +} +.tlb_page_wrap .side_blog_date { + color: #444; + font-size: 14px; +} +.tlb_page_wrap .side_blog_title { + margin-top: 2px; + font-size: 15px; +} + + + +.tlb_page_wrap #dev_page_title a, +.tlb_page_wrap #dev_page_title a:hover, +.tlb_page_wrap #dev_page_title a:active { + color: #444; +} +.tlb_page_wrap .tl_contest_page_wrap #dev_page_title { + text-align: center; + max-width: 250px; + margin-left: auto; + margin-right: auto; + margin-bottom: 20px; +} +.tlb_page_wrap .tl_contest_page_wrap #dev_page_title, +.tlb_page_wrap .tl_contest_page_wrap h4 { + color: #444; + font-size: 18px; + line-height: 25px; +} + +.tlb_page_wrap .tl_contest_page_wrap #dev_page_content, +.tlb_page_wrap .tl_contest_page_wrap #dev_page_content p { + color: #333333; + font-size: 15px; +} +.tlb_page_wrap .tl_contest_page_wrap #dev_page_content p { + margin-bottom: 15px; +} +.tlb_page_wrap .tl_contest_page_wrap #dev_page_content blockquote p:last-child { + margin-bottom: 0; +} + +.tlb_page_wrap a.tl_twitter_share_btn { + background: #3faee8; + color: #FFF; + font-size: 14px; + line-height: 18px; + border-radius: 17px; + padding-top: 8px; +} +.tlb_page_wrap span.tl_twitter_share_cnt { + color: #c2eaff; +} +.tlb_page_wrap a.tl_twitter_share_btn:hover, +.tlb_page_wrap a.tl_twitter_share_btn:active { + color: #c2eaff; +} + + +.tl_telegram_share_btn { + display: inline-block; + border-radius: 16px; + background-color: #54a9eb; + cursor: pointer; + line-height: 22px; + margin-right: 10px; + padding: 5px 17px 5px 11px; + color: #FFF; + font-weight: bold; +} +.tl_telegram_share_btn:hover, +.tl_telegram_share_btn:active, +.tl_telegram_share_btn:focus { + text-decoration: none; + color: #FFF; + outline: none; +} +.lang_rtl .tl_telegram_share_btn { + margin-right: 0; + margin-left: 10px; +} +i.tl_telegram_share_icon { + display: inline-block; + width: 20px; + height: 20px; + background: url('data:image/svg+xml,%3Csvg height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="m1.77404283 9.58769086c4.67714245-1.99564845 7.79596997-3.31130205 9.35648257-3.9469608 4.4555806-1.81493491 5.381412-2.13020854 5.984856-2.14061906.1327219-.0022897.4294781.02992311.6217044.18267827.162312.12898346.2069705.30322179.2283411.42551228.0213705.12229049.047982.40087134.0268279.61854631-.2414495 2.48450744-1.2861975 8.51375174-1.817706 11.29644264-.2249011 1.1774608-.6709749 1.4294697-1.0996928 1.4681058-.9317032.0839651-1.6359598-.4602232-2.5383599-1.0395344-1.412078-.9065075-1.9311138-1.1506648-3.30178003-2.0352487-1.58404193-1.0222898-.71982554-1.5573792.18291533-2.4756292.23625159-.2403103 4.3705401-3.98382431 4.4499945-4.31554914.0099371-.04148774-.12607-.45629906-.2198814-.53795815s-.2322689-.05373486-.3321837-.03152647c-.1416262.03147972-2.397439 1.49167812-6.76743852 4.38059516-.64030496.4305972-1.22027332.6403987-1.73990507.6294043-.5728523-.0121204-1.67479033-.3172064-2.49396798-.5779863-1.00475474-.3198572-1.37564449-.4704946-1.30610794-1.013711.03621894-.2829407.29151946-.57846124.76590154-.88656154z" fill="%23fff" fill-rule="evenodd"/%3E%3C/svg%3E') 0 0 no-repeat; + margin-right: 11px; + vertical-align: top; +} +.lang_rtl i.tl_telegram_share_icon { + margin-right: 0; + margin-left: 11px; +} +.tl_telegram_share_label { + line-height: 21px; + vertical-align: top; + display: inline-block; + /*margin-top: 1px;*/ +} + +.tlb_page_wrap a.tl_telegram_share_btn { + background: #3faee8; + color: #FFF; + font-size: 14px; + border-radius: 17px; + padding: 6px 12px 5px 6px; +} +.tlb_page_wrap a.tl_telegram_share_btn:hover, +.tlb_page_wrap a.tl_telegram_share_btn:active { + color: #c2eaff; +} + + +/* Telegram Desktop */ +.td_btn_hidden, +.td_all_shown .td_show_all_platforms { + display: none; +} +.td_all_shown span.td_btn_hidden { + display: inline; +} +.td_all_shown div.td_btn_hidden { + display: block; +} +.td_content_wrap { + width: 420px; + margin: 0 auto; + font-size: 16px; +} +.td_content_title { + font-size: 28px; + color: #383a3b; + text-align: center; + margin-top: 32px; + margin-bottom: 14px; + font-weight: normal; + letter-spacing: -1px; +} +.tl_content_title_link, +.tl_content_title_link:hover { + text-decoration: none; +} +.td_screenshot { + background: url(../img/td_laptop.png) 50% 0 no-repeat; + background-size: contain; + padding-top: 58%; + margin-top: 48px; +} +.td_download_wrap, +.td_download_wrap_low { + margin: 0 -130px; + width: 680px; + text-align: center; +} +.td_download_wrap_low { + margin-bottom: 30px; +} +.td_download_icon { + display: inline-block; + vertical-align: top; + width: 25px; + height: 30px; + background: url(../img/td_icons.png) 0 2px no-repeat; + background-size: 25px 105px; + margin: -2px 5px 0 0; +} +.td_osx .td_download_icon { + background-position: 0 -33px; +} +.td_linux .td_download_icon { + background-position: 0 -68px; +} +.td_download_add_wrap { + width: 680px; + margin: 0 -130px 10px; + text-align: center; +} +.td_download_add { + min-width: 256px; + padding: 0 15px 20px; + margin: 5px 10px; + text-align: center; + display: inline-block; + cursor: pointer; +} +.td_download_btn { + display: inline-block; + vertical-align: top; + font-weight: normal; + text-align: center; + vertical-align: middle; + cursor: pointer; + background-image: none; + white-space: nowrap; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + color: #fff; + border-color: #357ebd; + padding: 10px 14px; + min-width: 266px; + font-size: 15px; + line-height: 2; + border-radius: 30px; + background-color: #1d98dc; + margin: 5px 10px; +} +.td_download_btn_wrap { + display: inline-block; + vertical-align: top; +} +.td_download_btn_wrap .td_download_btn, +.td_download_btn_wrap .td_download_add { + display: block; +} +.td_download_btn_wrap .td_download_add { + margin-top: 10px; +} +.td_download_divider { + font-size: 9px; + color: #777; + margin: 0 4px; + vertical-align: text-bottom; +} + +.td_download_btn:hover { + outline: 0px; + text-decoration: none; + color: #fff; + background-color: #0e8ed4; +} +.td_download_btn:active, +.td_download_btn:focus { + outline: 0px; + text-decoration: none; + color: #fff; +} +.td_about_license { + font-size: 14px; + color: #67696a; + text-align: center; + margin-top: 50px; + margin-bottom: 30px; + line-height: 170%; +} + +#td_versions { + opacity: 1; + -webkit-transition: opacity 200ms linear; + -moz-transition: opacity 200ms linear; + -o-transition: opacity 200ms linear; + transition: opacity 200ms linear; +} +#td_versions.td_hidden { + opacity: 0.1; +} + +#td_about_osx { + font-size: 20px; + color: #525252; + padding: 9px 0 5px; + font-weight: normal; +} +#td_about_osx { + position: absolute; + width: 600px; + opacity: 0; + margin-top: -32px; + text-align: center; + -webkit-transition: opacity 200ms linear; + -moz-transition: opacity 200ms linear; + -o-transition: opacity 200ms linear; + transition: opacity 200ms linear; +} +#td_about_osx.td_shown { + opacity: 1; +} +#td_about_tdesktop, +#td_open_from_desktop { + font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Light', Helvetica, Arial , Verdana, sans-serif; + line-height: 148%; + text-align: center; +} +#td_about_tdesktop { + font-size: 17px; + margin: 0 auto; + color: #67696a; + margin: 14px 10px 24px; + font-weight: 300; +} +#td_open_from_desktop { + font-size: 17px; + color: #0088cc; + border: 1px solid #179cde; + border-radius: 10px; + padding: 13px 24px; + margin: 24px 0 40px; +} +.td_changelog_wrap { + padding: 0 15px; +} +.td_changelog_wrap h3 { + margin-top: 20px; + font-size: 16px; + font-weight: normal; +} +.td_changelog_wrap h3 strong { + color: #999; + font-size: 14px; + font-weight: normal; +} + +.td_screenshot_macos { + background: url(https://osx.telegram.org/updates/site/artboard.png) 50% 0 no-repeat; + background-size: 420px 280px; + height: 280px; +} + +.td_screenshot_tdirect { + background: url(/img/tdirect.jpg?1) 50% 0 no-repeat; + background-size: 300px 360px; + height: 360px; + margin: 40px 20px; +} +.td_content_tdirect_title { + font-size: 26px; + color: #383a3b; + text-align: center; + margin-top: 32px; + margin-bottom: 14px; + font-weight: 600; + letter-spacing: -1px; +} +.td_about_tdirect { + font-size: 14px; + margin: 14px 10px 24px; + line-height: 1.5; + text-align: center; +} +.td_download_btn.td_tdirect { + border-radius: 5px; + font-weight: bold; + margin: 10px; +} +.td_howto_install_wrap { + text-align: center; + margin: 50px 0 40px; +} +.td_about_tdirect_store { + margin-top: 60px; +} +.td_download_store_wrap { + margin: 20px 0 10px; + text-align: center; +} + + + + + + + +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) { + .tl_main_logo_title_image { + background-image: url(../img/Telegram_2x.png); + background-size: 144px 36px; + } + .caret { + background-image: url(../img/dropdown.png); + background-size: 18px 26px; + } + .icon-twitter { + background-image: url(../img/twitter_2x.png); + background-size: 21px 17px; + } + .icon-breadcrumb-divider { + background-image: url(../img/breadcrumb_divider.png); + background-size: 5px 10px; + } + .icon-to-top { + background-image: url(../img/back_to_top.png); + background-size: 16px 7px; + } + .tl_main_award { + background-image: url(../img/SiteAward_2x.gif); + background-size: 100px 100px; + } + .icon-arrow-more { + background-image: url(../img/tl_arrow_2x.png); + background-size: 6px 11px; + } + .tl_main_download_desktop { + background-image: url(../img/SiteDesktop_2x.jpg?2); + background-size: 1246px 260px; + } + + .icon-android, + .icon-ios, + .icon-wp { + background-image: url(../img/SiteLogos_2x.png); + background-size: 21px 120px; + } + + .tl_main_download_image__android { + background-image: url(../img/SiteAndroid_2x.jpg?2); + background-size: 290px 270px; + } + .tl_main_download_image__ios { + background-image: url(../img/SiteiOS_2x.jpg?2); + background-size: 442px 270px; + } + .tl_main_download_link_tdesktop { + background-image: url(../img/SiteTDesktop_2x.jpg?1); + background-size: 320px 157px; + } + + #dev_page_content > ul:not(.nav) li, + #dev_page_content > ol:not(.nav) ul:not(.nav) li { + background-image: url(../img/bullet_2x.png?3); + background-size: 7px 7px; + } + + .tgme_icon_arrow { + background-image: url(/img/tgme/Arrow_2x.png); + } + .tgme_icon_user, + .tgme_icon_group, + .tgme_icon_stickers, + .tgme_icon_share { + background-image: url(/img/tgme/Web2x.png?1); + background-size: 44px 177px; + } + + .tgme_page_widget_actions a.tgme_action_web_button:before { + background-image: url(/img/tgme/web_icon_2x.png); + background-size: 24px 24px; + } + .tgme_page_embed_btn a.tgme_action_button_new:before { + background-image: url(/img/tgme/embed_icon_2x.png?1); + background-size: 48px 24px; + } + .tgme_page_copy_action a.tgme_action_button_new:before { + background-image: url(/img/tgme/embed_copy_2x.png); + background-size: 24px 24px; + } + + .tlb_blog_logo { + background-image: url(/img/blog/BlogLogo2x.png?1); + background-size: 146px 20px; + } + + .radio-item input.radio + .radio-label:before, + .checkbox-item input.checkbox + .checkbox-label:before, + .form-control-dropdown-button:before { + background-image: url(/img/rc_icons_2x.png?1); + background-size: 20px 152px; + } + + .form-control-dropdown.has-items:before { + background-image: url(/img/rc_icons_2x.png?1); + background-size: 20px 152px; + } + .td_screenshot_macos { + background-image: url(https://osx.telegram.org/updates/site/artboard_2x.png); + background-size: 420px 280px; + height: 280px; + } + .td_screenshot_tdirect { + background-image: url(/img/tdirect_2x.jpg?1); + } +} + +@media only screen and (-webkit-min-device-pixel-ratio: 2.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min--moz-device-pixel-ratio: 2.5), only screen and (min-device-pixel-ratio: 2.5) { + + .tlb_blog_logo { + background-image: url(/img/blog/BlogLogo3x.png); + background-size: 146px 20px; + } +} + +@media (max-width: 1200px) { + .dev_side_nav_wrap { + display: none; + } +} + +/* Mobile */ +@media (max-width: 1000px) { + a.anchor { + margin-left: -19px; + } + .footer_wrap { + padding: 16px 0 16px; + padding-bottom: calc(max(16px, env(safe-area-inset-bottom))); + } + .footer_desktop { + display: none; + } + .footer_mobile { + display: flex; + justify-content: center; + } + .footer_columns_wrap { + text-align: center; + } + .footer_column { + margin: 0 6px; + } + .footer_column h5 { + color: #08c; + font-size: 12px; + font-weight: normal; + text-transform: uppercase; + margin: 0; + } + + .blog_side_image_wrap { + position: static; + } + .blog_side_image { + display: block; + margin: 20px auto; + width: 160px; + height: 160px; + position: static; + } + .blog_side_image.js-tgsticker_image { + position: relative; + } + + .tl_blog_side_blog { + display: none; + } + .tl_blog_bottom_blog { + display: block; + } + .tl_main_side_blog .side_blog_wrap { + position: static; + margin: 22px 0 0 16px; + padding: 0 10px 0 15px; + border-width: 4px; + border-color: #3faee8; + } + .side_blog_wrap { + width: auto; + } + + .tl_main_side_blog .side_blog_header { + font-size: 14px; + } + .tl_main_side_blog a.side_blog_entry { + margin-top: 12px; + } + .tl_main_side_blog .side_blog_date { + color: #444; + font-size: 13px; + } + .tl_main_side_blog .side_blog_title { + font-size: 14px; + margin-top: 2px; + } + +} + +@media (max-width: 640px) { + a:hover { + text-decoration: none; + } + h1 { + font-size: 19px; + } + h2 { + font-size: 19px; + } + h3 { + font-size: 16px; + } + h4 { + font-size: 16px; + } + h5 { + font-size: 14px; + } + .dropdown-menu { + min-width: 210px; + } + .dropdown-menu > li > a { + white-space: normal; + } + .tl_main_body { + margin-top: 25px; + padding-top: 5px; + } + .tl_main_body_header { + font-size: 20px; + } + .tl_main_download_mobile { + padding: 0 20px; + } + + .tl_main_download_link { + width: auto; + min-width: 0; + display: block; + margin-top: 20px; + margin-bottom: 30px; + } + a.tl_main_download_link:after { + display: none; + } + .tl_main_download_link_ios/*, + .tl_main_download_link_tdesktop*/ { + padding-top: 210px; + height: 245px; + padding-bottom: 15px; + } + .tl_main_download_image__ios { + margin: -123px 0 0 -121px; + background-size: 360px 220px; + width: 248px; + height: 198px; + } + .tl_main_video_player__ios { + margin: -124px 0 0 -121px; + width: 248px; + height: 198px; + } + + .tl_main_download_link_tdesktop { + display: block; + padding-top: 156px; + height: 188px; + } + .tl_main_download_desktop_section, + .tl_main_download_desktop_wrap1 { + display: none; + } + .tl_main_download_more_btn { + display: inline-block; + } + + .dev_page_bread_crumbs .breadcrumb { + margin-bottom: 15px; + } + #dev_page_content_wrap { + padding-top: 12px; + } + #dev_page_title { + margin-top: 10px; + margin-bottom: 21px; + } + .nav-pills > li > a { + padding: 8px 10px; + } + .dev_page_nav_wrap { + margin-top: 25px; + } + .dev_page_nav_wrap > p { + margin-bottom: 3.5px; + } + .dev_page_nav_wrap > p > a:first-child { + font-size: 15px; + } + #dev_page_content .dev_page_nav_wrap ul li { + padding: 3px 0 4px; + } + #dev_page_content .dev_page_nav_wrap ul li a:first-child { + font-size: 14px; + display: inline-block; + line-height: 22px; + padding: 2px 6px 1px; + margin-left: -6px; + } + #dev_page_content .dev_page_nav_wrap ul li a:first-child:hover { + border-radius: 2px; + background: #e6f1f7; + } + #dev_page_content .dev_page_nav_wrap hr { + display: none; + } + .dev_faq_page h4 { + font-size: 15px; + line-height: 140%; + margin-top: 26px; + margin-bottom: 5px; + } + .dev_page_image, + .tl_contest_page_wrap .dev_page_image { + max-width: 100%; + max-height: 400px; + margin: 0 auto; + } + .dev_page_image img, + .tl_contest_page_wrap .dev_page_image img { + max-width: 100%; + max-height: 400px; + } + + .tl_main_download_link:hover, + .tl_main_download_desktop_link:hover { + box-shadow: none; + } + + .dev_side_image { + width: auto; + max-width: none; + float: none; + text-align: center; + padding: 0; + } + .dev_side_image img { + display: block; + margin: 20px auto; + width: 180px; + } + + + .tl_team_member_photo_wrap { + margin-bottom: 10px; + } + .tl_team_member_photo { + width: 60px; + height: 60px; + background-size: 60px 905px; + } + .tl_team_member_pavel .tl_team_member_photo { + background-position: 0 0; + } + .tl_team_member_nikolay .tl_team_member_photo { + background-position: 0 -65px; + } + .tl_team_member_aliaksei .tl_team_member_photo { + background-position: 0 -130px; + } + .tl_team_member_vitalik .tl_team_member_photo { + background-position: 0 -195px; + } + .tl_team_member_arseny .tl_team_member_photo { + background-position: 0 -260px; + } + .tl_team_member_igor .tl_team_member_photo { + background-position: 0 -325px; + } + .tl_team_member_drklo .tl_team_member_photo { + background-position: 0 -390px; + } + .tl_team_member_peter .tl_team_member_photo { + background-position: 0 -455px; + } + .tl_team_member_john .tl_team_member_photo { + background-position: 0 -520px; + } + .tl_team_member_kolar .tl_team_member_photo { + background-position: 0 -585px; + } + .tl_team_member_ilya .tl_team_member_photo { + background-position: 0 -650px; + } + .tl_team_member_igor1 .tl_team_member_photo { + background-position: 0 -845px; + } + .tl_team_member_mike .tl_team_member_photo { + background-position: 0 -780px; + } + .tl_team_member_grisha .tl_team_member_photo { + background-position: 0 -715px; + } + .tl_team_member_name { + margin-top: 20px; + margin-left: 80px; + margin-bottom: 40px; + } + .tl_team_member_body { + margin-left: 0; + } +} + +@media (max-width: 480px) { + .navbar-tg .container { + padding: 0; + } + h3 a.anchor i.anchor-icon {margin-top: 1px;} + a.anchor { + margin-left: -16px; + } + .tl_main_award { + display: none; + } + .tl_main_logo_wrap { + padding-top: 10px; + padding-bottom: 2px; + } + svg.tl_main_logo, + image.tl_main_logo, + img.tl_main_logo { + width: 85px !important; + height: 85px !important; + } + .tl_main_logo_title, + .tl_main_logo_title:hover { + font-size: 23px; + margin-top: 15px; + margin-bottom: 5px; + letter-spacing: -1px; + } + .tl_main_logo_lead { + font-size: 16px; + max-width: 224px; + } + + .tl_main_head_download { + margin-bottom: 10px; + } + .tl_main_download_btn { + max-width: 200px; + width: auto; + padding: 6px 9px; + line-height: 20px; + font-size: 13px; + margin: 5px 10px; + } + + .tl_main_cards { + margin-top: 10px; + } + + .tl_main_card_header { + margin: 10px 0 6px; + font-size: 21px; + font-weight: normal; + letter-spacing: -1px; + } + + .tl_main_card_lead { + font-size: 15px; + } + .smartphone_video_player_wrap { + /*display: none;*/ + } + + .td_content_wrap { + width: auto; + font-size: 14px; + margin: 0 20px; + } + .td_screenshot { + margin-top: 26px; + } + .td_content_title { + font-size: 22px; + margin-top: 21px; + margin-bottom: 10px; + } + .td_download_wrap, + .td_download_wrap_low { + margin: 0 auto; + width: 320px; + } + .td_download_wrap_low { + margin-bottom: 30px; + } + .td_download_add_wrap { + width: 280px; + margin: 0 auto 10px; + } + #td_about_osx { + width: 320px; + font-size: 16px; + } + .td_about_osx_team { + display: none; + } + .td_about_license { + font-size: 12px; + } + #td_about_tdesktop { + font-size: 16px; + margin: 10px 15px 24px; + } + .td_screenshot_tdirect { + background-size: 225px 270px; + height: 270px; + margin: 40px 20px 20px; + } + .td_content_tdirect_title { + font-size: 20px; + margin-top: 21px; + margin-bottom: 10px; + letter-spacing: 0; + } + + + /* Telegram.me */ + .tgme_head_wrap { + background: #FFF; + height: 59px; + padding: 14px 16px; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + } + a.tgme_head_dl_button { + text-align: left; + -webkit-box-shadow: inset 0px 1px 3px 0px rgba(0,0,0,0.15); + -moz-box-shadow: inset 0px 1px 3px 0px rgba(0,0,0,0.15); + box-shadow: inset 0px 1px 3px 0px rgba(0,0,0,0.15); + } + .tgme_icon_arrow { + float: right; + } + .tgme_page_photo_image { + width: 110px; + height: 110px; + border-radius: 55px; + } + .tgme_icon_user { + width: 30px; + height: 30px; + background: url(/img/tgme/Mobile1x.png?1) -2px -31px no-repeat; + background-size: 33px 148px; + } + .tgme_icon_group { + width: 32px; + height: 18px; + background: url(/img/tgme/Mobile1x.png?1) 0 0 no-repeat; + background-size: 33px 148px; + } + .tgme_icon_stickers { + width: 28px; + height: 28px; + background: url(/img/tgme/Mobile1x.png?1) -2px -70px no-repeat; + background-size: 33px 148px; + } + .tgme_icon_share { + width: 31px; + height: 17px; + background: url(/img/tgme/Mobile1x.png?1) -1px -108px no-repeat; + background-size: 33px 148px; + } + + .tgme_page_additional { + display: block; + } + .tgme_footer { + display: none; + } + + .blog_2images_wrap, + .blog_3images_wrap, + .blog_medium_image_wrap, + .blog_medium_image_wrap img, + .blog_image_wrap, + .blog_image_wrap img { + width: auto; + max-width: 275px; + } + .blog_2images_wrap, + .blog_3images_wrap { + margin: 20px auto 20px; + } + .blog_2images_wrap .blog_image_wrap, + .blog_3images_wrap .blog_image_wrap { + float: none; + margin: 20px 0 20px; + } +} + +@media (max-width: 340px) { + .tl_main_download_image__android { + margin: -109px 0 0 -101px; + background-size: 196px 183px; + width: 205px; + height: 162px; + } + .tl_main_download_image__ios { + margin: -103px 0 0 -101px; + background-size: 300px 183px; + width: 206px; + height: 165px; + } + .tl_main_video_player__android { + margin: -109px 0 0 -101px; + width: 205px; + height: 162px; + } + .tl_main_video_player__ios { + /*margin: -103px 0 0 -101px;*/ + margin: -104px 0 0 -101px; + width: 206px; + height: 165px; + } +} + +@media (max-width: 320px) { + #td_about_tdesktop { + font-size: 14px; + } + #td_open_from_desktop { + font-size: 15px; + padding: 13px 18px; + } +} + +.tl_contest_page_wrap + .pager_wrap { + max-width: 600px; + margin: 0 auto; +} + +@media only screen and (-webkit-min-device-pixel-ratio: 1.5) and (max-width: 480px), only screen and (-o-min-device-pixel-ratio: 3/2) and (max-width: 480px), only screen and (min--moz-device-pixel-ratio: 1.5) and (max-width: 480px), only screen and (min-device-pixel-ratio: 1.5) and (max-width: 480px) { + + .tgme_icon_user, + .tgme_icon_group, + .tgme_icon_stickers, + .tgme_icon_share { + background-image: url(/img/tgme/Mobile2x.png?1); + } +} diff --git a/data/themes.telegram.org/css/themes.css b/data/themes.telegram.org/css/themes.css new file mode 100644 index 0000000000..b0afb81f13 --- /dev/null +++ b/data/themes.telegram.org/css/themes.css @@ -0,0 +1,2001 @@ +body { + font-family: 'Roboto', sans-serif; + font-size: 15px; + color: #000; + margin: 0; + padding: 0; +} + +.btn, +a.btn, +button.btn { + font-size: 13px; + font-weight: 500; + line-height: 18px; + text-transform: uppercase; + border-radius: 5px; + padding: 8px 16px 6px; + border: none; +} +.btn:active { + box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.125); +} +.btn-xs, +a.btn-xs, +button.btn-xs { + font-size: 11px; + line-height: 14px; + padding: 4px 7px 2px; +} +.btn-sm, +a.btn-sm, +button.btn-sm { + padding: 5px 14px 4px; +} +.btn-lg, +a.btn-lg, +button.btn-lg { + padding: 9px 16px 8px; +} +.btn-primary { + background-color: #238fe1; +} +.btn-primary:hover, +.btn-primary:focus, +.btn-primary:active { + background-color: #068cd4; +} +.btn-default { + background-color: transparent; + color: #0086d3; +} +.btn-default:hover, +.btn-default:focus, +.btn-default:active, +.open > .dropdown-toggle.btn-default { + color: #0086d3; + background-color: #e8f3fa; + box-shadow: none; +} +.btn-default.btn-danger { + color: #d14e4e; + background-color: transparent; +} +.btn-default.btn-danger:hover, +.btn-default.btn-danger:focus, +.btn-default.btn-danger:active { + color: #d14e4e; + background-color: #fcdfde; +} +.btn-link:active { + box-shadow: none; +} +.btn-muted { + color: #1a1a1a; + background-color: #f2f2f2; +} + +.click { + cursor: pointer; +} +.click:hover { + text-decoration: underline; +} + +.btn:focus, +.btn:active:focus, +button:focus, +button:active:focus, +input.form-control:focus, +textarea.form-control:focus, +input.form-control, +textarea.form-control { + outline: none; + box-shadow: none; +} +input.form-control[disabled], +textarea.form-control[disabled] { + cursor: auto; + background-color: #fff; +} + +i.emoji { + font-style: normal; + box-sizing: content-box; +} +i.emoji > b { + font-weight: normal; +} +.emoji_default i.emoji { + background: none !important; +} +.emoji_image i.emoji { + width: 1.25em; + vertical-align: top; + display: inline-block; + white-space: nowrap; + overflow: hidden; + background: no-repeat 2px 50%; + background-position-y: calc(50% - 1px); + background-size: 1.25em 1.25em; + text-indent: -10em; + padding: 3px 3px 3px 2px; + margin: -3px -2px; +} +.emoji_image .rtl i.emoji { + padding-left: 3px; + padding-right: 2px; +} +.emoji_image i.emoji > b { + letter-spacing: 12em; + pointer-events: none; +} + +img.emoji { + width: 1.25em; + height: 1.25em; + padding: 0 1px; + vertical-align: top; + vertical-align: text-top; + box-sizing: content-box; + cursor: inherit; +} +a:hover img.emoji { + border-bottom: 1px solid; + padding: 0 2px; + margin: 0 -1px; +} + +.form-control { + font-size: 14px; + padding: 12px 0; +} + +.container, +.container-fluid { + position: relative; + margin-right: auto; + margin-left: auto; + padding-left: 0; + padding-right: 0; + width: auto; + max-width: 920px; + box-sizing: content-box; +} + +.bg-image { + background: #f7f7f7 no-repeat center; + background-size: cover; +} +.strong { + font-weight: 500; +} + +.th-aside { + margin: -5px 15px 0; +} +.th-content { + position: relative; + margin: 0 0 75px; +} + +.th-header, +.th-markdown h3, +.th-markdown h4 { + font-size: 13px; + line-height: 17px; + font-weight: bold; + padding: 2px 0; + margin: 25px 0 7px; + text-transform: uppercase; +} +.th-markdown h5, +.th-markdown h6 { + font-size: 14px; + line-height: 21px; + font-weight: 500; + padding: 0; + margin: 15px 0 4px; +} +li.th-logo:last-child .th-logo-title { + display: inline; +} +.th-content .th-header { + margin-left: 15px; +} + +.th-article { + margin: 15px 0 0; +} +.th-article-date { + display: block; + font-size: 14px; + font-weight: 500; + line-height: 23px; + margin-bottom: 2px; +} +.th-article-text, +.th-markdown p { + font-size: 14px; + line-height: 21px; + margin: 0; +} + +.th-list-empty-wrap { + transition: opacity .2s ease, visibility .2s ease; +} +.th-list-empty-wrap.ohide { + height: 0; +} +.th-list-empty { + font-size: 14px; + line-height: 22px; + color: #70767b; + padding: 32px 0; + text-align: center; +} + +.th-contest { + display: block; + font-size: 14px; + line-height: 22px; + padding: 15px 0; +} +a.th-contest:hover { + text-decoration: none; +} +.th-contest + .th-contest { + border-top: 1px solid #f0f0f0; +} +.th-contest-title { + font-weight: 500; + color: #000; +} +.th-contest-period { + color: #70767b; +} +.th-badge { + font-size: 11px; + line-height: 13px; + padding: 3px 5px 2px; + text-transform: uppercase; + display: inline-block; + vertical-align: 1px; + margin-left: 10px; + border-radius: 3px; + background-color: #70767b; + color: #fff; +} +.th-badge-new { + background-color: #238fe1; +} +.th-header .th-badge { + margin-top: -1px; +} + + +a.th-dl-button { + position: absolute; + top: 0; + left: 0; + right: 0; + display: block; + font-size: 15px; + color: #FFF; + background: #3092e6; + padding: 1px 15px; + height: 42px; + line-height: 41px; + text-align: center; + white-space: nowrap; + z-index: 10; +} +a.th-dl-button:hover, +a.th-dl-button:active { + color: #FFF; + background: #2789DE; + text-decoration: none; +} +.th-dl-button-try { + padding: 4px 11px; + border: 1px solid #fff; + border-radius: 3px; + margin-left: 12px; +} +.th-main { + display: flex; + min-width: 320px; + min-height: 100vh; + align-items: center; + justify-content: center; + flex-wrap: wrap; + padding: 40px 0 0; +} +.th-main-content { + text-align: center; + padding: 40px 10px 50px; + max-width: 360px; +} +.th-main-content h1 { + font-size: 19px; + margin: 30px 0 12px; +} +.th-main-content p { + font-size: 15px; + line-height: 21px; +} +.th-dl-button b, +.th-main-content b { + font-weight: 500; +} +.th-main-icon { + display: inline-block; + width: 100px; + height: 100px; + background: url('data:image/svg+xml,%3Csvg height="100" viewBox="0 0 99 100" width="99" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%230f9ae4" fill-rule="evenodd" transform="translate(1 10)"%3E%3Cpath d="m27.3299021 54.5971404h-18.10461067c-1.43756152 0-2.60293538-1.1653738-2.60293538-2.6029353v-4.6001193c0-1.4375615 1.16537386-2.6029354 2.60293538-2.6029354h44.33143827c1.4375615 0 2.6029354 1.1653739 2.6029354 2.6029354v4.6001193c0 1.4375615-1.1653739 2.6029353-2.6029354 2.6029353h-18.7064012c1.6846715 5.5624133 2.909254 13.7612262 3.8405519 18.6182864 1.5083556 7.8666285-3.3765692 10.8252812-7.5417783 10.8252812-4.1652092 0-9.050134-4.0981559-7.5417784-11.9647845.9094191-4.7429541 2.0985044-12.2582658 3.7225784-17.4787831zm6.318501 23.0116168c1.1715729-1.1715728 1.1715729-3.0710678 0-4.2426407-1.1715728-1.1715728-3.0710678-1.1715728-4.2426406 0-1.1715729 1.1715729-1.1715729 3.0710679 0 4.2426407 1.1715728 1.1715729 3.0710678 1.1715729 4.2426406 0z" transform="matrix(.70710678 .70710678 -.70710678 .70710678 54.743154 -3.329808)"/%3E%3Cpath d="m77.1933507 24.2305175c-.7172516 2.1075474-1.3658738 3.7094858-1.9458666 4.8058152-1.0903132 2.0609607-2.8787787 4.7364008-5.3653967 8.0263201l-.0000567-.0000428c-.1665298.2203272-.1229184.5339368.0974089.7004666.1359339.1027429.3148283.1291989.4746818.0701988 2.214469-.8173353 3.8392008-1.5394142 4.8741954-2.1662369 2.7545174-1.6682153 5.2193283-4.9280761 6.789222-5.748253.0547696-.0286138.1094841-.0570595.1641434-.0853368l3.4642799 3.8146338c1.4658869 1.6141369 1.3689762 4.1049302-.2178938 5.6002917l-19.6429269 18.5101969c-1.5505328 1.4611198-3.9741965 1.4505083-5.5118758-.0241324l-22.7127168-21.7815899c-1.5599561-1.4960042-1.6493731-3.9606385-.2019256-5.5657514 3.4953029-3.876034 6.5445731-8.1539982 9.1478107-12.8338925 2.7821293-5.0014916 4.9920761-10.32968627 6.6298403-15.98458416l-.0000102-.00000297c.251986-.87006109 1.1615848-1.37110997 2.0316459-1.119124.2915046.08442519.5538686.24807467.7578989.47273924z"/%3E%3C/g%3E%3C/svg%3E') no-repeat center; +} +a.th-login-editor-btn { + margin-top: 25px; + display: inline-block; + font-size: 14px; + line-height: 20px; + padding: 11px 25px; + font-weight: 500; + text-transform: uppercase; + border-radius: 4px; + background-color: #3092e6; + color: #fff; + cursor: pointer; +} +a.th-login-editor-btn:hover { + background-color: #2789DE; + text-decoration: none; + color: #fff; +} +.th-login-editor-btn:before { + display: inline-block; + content: ''; + width: 20px; + height: 17px; + margin-right: 15px; + vertical-align: top; + position: relative; + top: 2px; + background: url('data:image/svg+xml,%3Csvg height="17" viewBox="0 0 20 17" width="20" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="m1.375 7.318c5.369-2.399 8.949-3.98 10.74-4.744 5.114-2.182 6.177-2.561 6.87-2.574.152-.003.493.036.713.22.187.155.238.364.262.511.025.147.055.482.031.744-.277 2.987-1.476 10.235-2.086 13.58-.259 1.416-.767 1.89-1.259 1.937-1.069.101-1.882-.725-2.917-1.422-1.621-1.09-1.636-.811-3.174-1.911-1.376-.983-1.084-2.256-.048-3.36.271-.289 3.799-4.174 3.89-4.573.011-.05.138-.698.03-.796-.107-.098-.606-.101-.72-.075-.163.038-2.447 1.6-6.852 4.686-.735.518-1.401.77-1.997.757-.658-.015-1.923-.382-2.863-.695-1.153-.385-2.07-.588-1.99-1.241.041-.34.498-.688 1.37-1.044z" fill="%23fff" fill-rule="evenodd"/%3E%3C/svg%3E') no-repeat; +} + +.th-theme { + display: block; + font-size: 14px; + line-height: 22px; + padding: 16px 15px 16px 30px; + margin: 0 -15px; + position: relative; + min-height: 68px; + transition: all .2s ease; +} +a.th-theme:hover { + text-decoration: none; +} +a.th-theme:focus { + box-shadow: none; + outline: none; +} +.th-theme + .th-theme { + margin-top: 1px; +} +.th-theme + .th-theme:before { + position: absolute; + display: block; + content: ''; + border-top: 1px solid #f0f0f0; + margin: 0 15px; + top: -1px; + left: 90px; + right: 0; +} +.th-theme-photo { + display: inline-block; + vertical-align: top; + width: 44px; + height: 44px; + border-radius: 22px; + background: #efefef; + text-align: center; + overflow: hidden; + margin-right: 12px; + float: left; +} +.th-theme-photo img { + width: 100%; +} +.th-theme-photo .photo-char { + font-size: 20px; + vertical-align: middle; + line-height: 44px; + color: #999; +} +.th-theme-title { + font-size: 15px; + font-weight: 500; + color: #000; +} +.th-theme-label { + color: #808080; +} +.th-theme-thumb { + display: inline-block; + width: 74px; + height: 46px; + float: left; + margin: -1px 16px -1px 0; + border-radius: 5px; + background: #efefef no-repeat center; + background-size: cover; + overflow: hidden; +} +.th-theme-edit-btn { + float: right; + margin: 6px 0 6px 12px; +} + +.th-theme-header { + margin: 30px 0 20px 15px; + transition: all .2s ease; +} +.th-theme-header-body { + max-width: 100%; + padding: 5px 15px 5px 0; + float: left; +} +.th-theme-header .th-theme-thumb { + margin-top: 1px; + margin-bottom: 1px; +} +.th-theme-header .th-theme-title { + font-size: 19px; + line-height: 25px; +} +.th-theme-header .th-theme-label { + margin-top: 5px; +} +.th-theme-header .th-theme-title, +.th-theme-header .th-theme-label { + margin-left: 90px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.th-theme-header .th-theme-buttons { + float: right; + padding: 5px 0; + margin: 4px 15px 4px 18px; + transition: all .2s ease; +} +.th-theme-buttons .btn { + float: right; + padding: 12px 20px 10px; +} +.th-theme-buttons .btn ~ .btn { + margin-right: 10px; +} +.header-btn-wrap .th-theme-buttons { + margin: 2px 15px; +} +.header-btn-wrap .th-theme-buttons .btn { + padding: 9px 18px 7px; +} + +.th-theme-placeholder { + padding: 83px 20px; + text-align: center; + color: #6b6e70; +} + +.th-theme-source-placeholder { + position: absolute; + border: 1px solid #e0e0e0; + background: #fff; + width: 100%; + opacity: 0; + visibility: hidden; + pointer-events: none; +} +.th-theme-ph-icon { + display: inline-block; + width: 100px; + height: 75px; + background: url('data:image/svg+xml,%3Csvg height="100" viewBox="0 0 100 100" width="100" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg transform="translate(3 28)"%3E%3Cellipse cx="15.144928" cy="44.604" fill="%23b0b5b9" rx="2.391304" ry="2.3895"/%3E%3Cg stroke="%23b0b5b9" stroke-width="3"%3E%3Cpath d="m15.3715001 35.7495h-9.00184687c-1.70492762 0-3.08704453-1.3821169-3.08704453-3.0870445v-3.197911c0-1.7049276 1.38211691-3.0870445 3.08704453-3.0870445h27.11576597c1.7049277 0 3.0870446 1.3821169 3.0870446 3.0870445v3.197911c0 1.7049276-1.3821169 3.0870445-3.0870446 3.0870445h-9.3852697c.206947.8758938.4121073 1.8418942.6220916 2.9141213.2731117 1.39457 1.0405032 5.708952 1.1417756 6.2348279.9880491 5.1306323-1.9487771 8.3740508-6.0843967 8.3740508-4.0352661 0-7.0768151-3.9144561-6.0843968-9.0677766.0166922-.0866775.8030719-4.3734735 1.0846051-5.7639316.1991151-.9834052.3944975-1.876227.5916718-2.6912918z" transform="matrix(.70710678 .70710678 -.70710678 .70710678 33.997168 -2.426423)"/%3E%3Cpath d="m20.9827863 20.3419695c2.6373452-2.7862367 4.8531008-5.9254117 6.6491303-9.4213645 1.5944154-3.10351318 2.8204251-6.40139185 3.6782858-9.89607714.3020098-1.23011078 1.5440173-1.98252205 2.7741489-1.68055451.4152612.10193658.7937574.31792949 1.0927589.62359449l19.1544605 19.58133886c1.4837739 1.5168414 1.4741029 3.9441897-.0217103 5.44916l-14.2812632 14.36869-20.1089697-17.9016076z" transform="matrix(.99939083 .0348995 -.0348995 .99939083 .687639 -1.314761)"/%3E%3C/g%3E%3C/g%3E%3Cg fill="%23b0b5b9"%3E%3Ccircle cx="30.75" cy="10.444444" r="3.077904" transform="matrix(.70710678 .70710678 -.70710678 .70710678 64.391804 -5.684427)"/%3E%3Cpath d="m49.5 71c.8284271 0 1.5.6715729 1.5 1.5v6c0 3.5898509 2.9101491 6.5 6.5 6.5h21c4.1421356 0 7.5-3.3578644 7.5-7.5v-54c0-4.1421356-3.3578644-7.5-7.5-7.5h-21.5c-3.3137085 0-6 2.6862915-6 6v4.5c0 .8284271-.6715729 1.5-1.5 1.5-.8284271 0-1.5-.6715729-1.5-1.5v-6c0-4.1421356 3.3578644-7.5 7.5-7.5h23.5c5.5228475 0 10 4.4771525 10 10v55c0 5.5228475-4.4771525 10-10 10h-22.5c-4.6944204 0-8.5-3.8055796-8.5-8.5v-7c0-.8284271.6715729-1.5 1.5-1.5z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E') no-repeat -9px -13px; +} +.th-theme-ph-title { + font-size: 18px; + line-height: 24px; + font-weight: 500; + margin: 10px 0 15px; +} +.th-theme-ph-buttons { + margin: 30px 0 0; +} +.th-no-content .th-theme-buttons, +.th-no-content .th-theme-source-code-wrap, +.th-no-content .th-theme-thumb svg { + opacity: 0; + visibility: hidden; + pointer-events: none; +} +.th-no-content .th-theme-source-code-wrap .CodeMirror { + height: 376px; +} +.th-no-content .th-theme-source-placeholder { + opacity: 1; + visibility: visible; + pointer-events: auto; +} +.th-theme-import-btn { + margin: 4px 0; +} + +.th-theme-content-buttons { + text-align: center; + margin: 30px 0; +} + +.th-theme-thumb svg, +.th-theme-source-placeholder, +.th-theme-source-code-wrap { + transition: all .2s ease; +} +.th-theme-source-code-wrap .CodeMirror { + border: 1px solid #e0e0e0; + min-height: 376px; + height: auto; + border-width: 1px 0; +} +.th-theme-source-code-wrap .CodeMirror pre { + font-size: 14px; + line-height: 18px; + padding: 0 14px; +} +.th-theme-source-code-wrap .CodeMirror-lines { + padding: 7px 0; +} +.th-theme-source-code-wrap .CodeMirror-widget { + display: inline-block; + position: relative; + vertical-align: top; +} +.th-theme-source-code-wrap .codemirror-colorview { + position: absolute; + top: 0; + vertical-align: top; + margin: 2px 7px 2px 0; + border: 1px solid #ededed; + width: 14px; + height: 14px; + border-radius: 7px; +} +.th-theme-source-code-wrap .codemirror-colorview .codemirror-colorview-background { + border-radius: 7px; +} +body .codemirror-colorpicker .colorpicker-body > .colorsets > .menu { + display: none; +} +body .codemirror-colorpicker .colorpicker-body > .colorsets > .color-list { + margin-right: 6px; +} +body .codemirror-colorpicker .colorpicker-body > .colorsets > .color-list .add-color-item { + line-height: 13px; +} +.th-theme-source-code-wrap .codemirror-colorview, +body .codemirror-colorpicker .colorpicker-body > .colorsets > .color-list .color-item .empty, +body .codemirror-colorpicker .colorpicker-body > .control > .opacity > .opacity-container, +body .codemirror-colorpicker .colorpicker-body > .control > .empty, +body .codemirror-colorpicker .colorpicker-body > .colorsets > .color-list .color-item .empty, +body .codemirror-colorpicker .colorpicker-body > .color-chooser .color-chooser-container .colorsets-list .colorsets-item .items .color-item { + vertical-align: top; + background-image: url('data:image/gif;base64,R0lGODlhGAAYAIABAKysrP///yH5BAEAAAEALAAAAAAYABgAAAIyhI8Wy70JgZshJuoswk0fzngKWIlk6Z2iRK6q2cIn6Maprb03LXM1v/P1MD9hkDikrAoAOw=='); + background-size: 12px; + background-position: center; +} +body .codemirror-colorpicker .colorpicker-body > .information > .information-item > .input-field .postfix { + line-height: 19px; + padding-right: 4px; +} +body .codemirror-colorpicker .colorpicker-body > .control > .opacity > .opacity-container > .color-bar { + border-radius: 3px; +} +.th-theme-source-code { + font-family: monospace, 'Courier New'; + font-size: 14px; + line-height: 18px; + padding: 7px 14px; + border: 1px solid #e0e0e0; + color: #000; +} +.cm-keycol, +.cm-valcol { + display: inline-block; + box-sizing: content-box; +} +.cm-valcol, +.cm-val { + padding-left: 21px; +} + +.nav-tabs { + border-bottom: 1px solid #e0e0e0; + margin-bottom: -1px; + position: relative; + z-index: 1; +} +.nav-tabs>li>a { + text-transform: uppercase; + font-weight: 500; + position: relative; + border-radius: 0; + border: none; + color: #999; +} +.nav-tabs>li>a:hover, +.nav-tabs>li>a:focus { + background-color: transparent; +} +.nav-tabs>li.active>a, +.nav-tabs>li.active>a:hover, +.nav-tabs>li.active>a:focus { + color: #0088cc; + border: none; +} +.nav-tabs>li.active>a:after { + content: ''; + position: absolute; + left: 0; + right: 0; + bottom: 0; + height: 4px; + border-radius: 2px 2px 0 0; + background-color: #238fe1; +} + + + + +.th-back { + padding: 18px 19px; + vertical-align: top; + margin: 0 0 0 -15px; + cursor: pointer; +} +.th-back:before { + position: relative; + top: 2px; + content: ''; + display: inline-block; + width: 18px; + height: 16px; + background: url('/img/translations/icons.png?8') no-repeat -5px -105px; +} +@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { + .th-back:before { + background-image: url('/img/translations/icons_2x.png?8'); + background-size: 26px 752px; + } +} + +.th-subheader { + font-size: 16px; + font-weight: 500; + padding: 15px 0; + margin: 0; +} +.th-subheader .th-badge { + font-size: 12px; + line-height: 18px; + padding: 3px 7px 2px; + min-width: 19px; + margin-left: 7px; +} + +.th-section-block { + padding: 20px 15px 0 56px; +} +.th-actions { + display: inline-block; + margin-left: -13px; +} +.th-action-item { + display: block; + position: relative; + padding: 11px 40px 11px 58px; + font-weight: 500; +} +/*.th-action-item:hover { + text-decoration: none; +} +.th-action-item .th-action-label:hover { + text-decoration: underline; +}*/ +.th-action-item:before { + position: absolute; + top: 4px; + left: 6px; + display: inline-block; + width: 32px; + height: 32px; + content: ''; + background: url('/img/translations/icons.png?8') no-repeat -10px -548px; +} +@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { + .th-action-item:before { + background-image: url('/img/translations/icons_2x.png?8'); + background-size: 26px 752px; + } +} +.action-share:before { + background-position: 6px -453px; +} +.action-edit:before { + background-position: 4px -485px; +} +.action-team:before { + background-position: 1px -514px; +} + +.arrow-link { + font-size: 15px; + font-weight: 500; + cursor: pointer; +} +.arrow-link:after { + display: inline-block; + width: 8px; + height: 12px; + content: ''; + background: url('/img/translations/icons.png?8') no-repeat -10px -548px; + margin-left: 7px; + vertical-align: -1px; +} +@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { + .arrow-link:after { + background-image: url('/img/translations/icons_2x.png?8'); + background-size: 26px 752px; + } +} + +.form-group .input { + direction: ltr; + unicode-bidi: isolate; +} +.form-group.rtl { + text-align: right; +} +.form-group.rtl .input { + direction: rtl; +} + +.fill { + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; +} + +.fullname { + font-weight: 500; + border-bottom: 1px solid #de8833; +} +.my.fullname { + border-bottom: 3px double #de8833; +} +a.fullname:hover { + text-decoration: none; + border-bottom-color: inherit; +} + +.close { + position: relative; + width: 22px; + height: 22px; + opacity: 1; +} +.close:hover { + opacity: 1; +} +.close:before, +.close:after { + display: inline-block; + position: absolute; + background: #c0c0c0; + left: 50%; + top: 50%; + content: ''; + width: 16px; + height: 2px; + margin: -1px 0 0 -8px; + border-radius: 1px; + transform: rotateZ(45deg) scaleY(.95); + transition: background-color .2s ease; +} +.close:after { + transform: rotateZ(-45deg) scaleY(.95); +} +.close:hover:before, +.close:hover:after { + background: #a8a8a8; +} + +.arrow-left, +.arrow-right { + display: inline-block; + width: 16px; + height: 14px; + position: relative; + opacity: 0.4; + transition: opacity .2s ease; +} +.arrow-left:before, +.arrow-left:after, +.arrow-right:before, +.arrow-right:after { + display: inline-block; + position: absolute; + content: ''; + left: 0; + top: 50%; +} +.arrow-left:before, +.arrow-right:before { + transform: rotateZ(45deg); + width: 10px; + height: 10px; + border: 2px solid #222; + margin: -5px 0 0 2px; + border-width: 0 0 2px 2px; +} +.arrow-left:after, +.arrow-right:after { + background: #222; + width: 14px; + height: 2px; + margin: -1px 0 0 2px; +} +.arrow-right:before { + margin-left: 4px; + border-width: 2px 2px 0 0; +} +.arrow-right:after { + margin-left: 0; +} + +.binding { + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: 400; + font-size: 92%; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.binding:before { + content: "\e144"; +} + +.ohide { + opacity: 0; + visibility: hidden; + pointer-events: none; +} + +.shide { + opacity: 0; + visibility: hidden; + pointer-events: none; + padding-top: 0 !important; + padding-bottom: 0 !important; + margin-top: 0 !important; + margin-bottom: 0 !important; + height: 0 !important; +} + +.sxhide { + opacity: 0; + visibility: hidden; + pointer-events: none; + padding-left: 0 !important; + padding-right: 0 !important; + margin-left: 0 !important; + margin-right: 0 !important; + width: 0 !important; +} + +.no-transition, +.no-transition * { + transition: none !important; +} + +.nav-pills > li > a { + padding: 10px 15px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-size: 15px; + font-weight: 500; + line-height: 22px; +} +.nav-pills > li.divider { + border-bottom: 1px solid #ededed; + padding-bottom: 7px; + margin-bottom: 7px; +} +.nav-pills > li > a .th-badge { + font-size: 11px; + padding: 2px 5px 0; + margin-top: 2px; + background: #0f9ae4; + float: right; +} +.nav-pills > li.active > a .th-badge { + background: #fff; + color: #0f9ae4; +} +.nav-stacked > li + li { + margin-top: 0; +} + +.popup-buttons .btn-link { + padding: 10px 15px 8px; + border-radius: 2px; +} +.popup-buttons .btn-link + .btn-link { + margin-left: 2px; +} +.popup-buttons .btn-link:hover { + background: #e6f1f7; + text-decoration: none; +} +.popup-buttons .btn-link:active { + background: #d4e6f1; +} +.popup-buttons .btn-link:focus { + text-decoration: none; +} +.btn.disabled, +.btn[disabled], +.popup-buttons .btn-link.disabled, +.popup-buttons .btn-link[disabled] { + color: #b5d1e6; + opacity: 1; +} + +.input { + white-space: pre-wrap; + position: relative; + z-index: 0; +} +.input.empty[data-placeholder] { + position: relative; +} +.input.empty[data-placeholder]:before { + position: absolute; + left: 0; + right: 0; + content: attr(data-placeholder); + transition: color .2s ease; + color: #919699; + font-weight: normal; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + pointer-events: none; + z-index: -1; +} +.input.empty[data-placeholder]:focus:before { + color: #ccc; +} +input.th-form-control, +textarea.th-form-control, +.input.th-form-control { + padding-left: 0; + padding-right: 0; + border: none; + height: auto; + resize: none; + box-shadow: inset 0 -1px 0 #f0f0f0; + transition: box-shadow .2s ease, color .2s ease; +} +input.th-form-control + .th-form-control-underline { + box-shadow: 0 -1px 0 #f0f0f0; + transition: box-shadow .2s ease; + margin-bottom: -2px; + height: 2px; +} +input.th-form-control[readonly], +textarea.th-form-control[readonly], +.input.th-form-control[readonly], +input.th-form-control[disabled], +textarea.th-form-control[disabled], +.input.th-form-control[disabled] { + cursor: auto; + background: #fff; +} +input.th-form-control:focus, +textarea.th-form-control:focus, +.input.th-form-control:focus { + box-shadow: inset 0 -2px 0 #39ade7; +} +input.th-form-control:focus + .th-form-control-underline { + box-shadow: 0 -2px 0 #39ade7; +} +input.th-form-control[readonly]:focus, +textarea.th-form-control[readonly]:focus, +.input.th-form-control[readonly]:focus, +input.th-form-control[disabled]:focus, +textarea.th-form-control[disabled]:focus, +.input.th-form-control[disabled]:focus { + box-shadow: inset 0 -1px 0 #f0f0f0; +} +.input.th-form-control { + overflow: auto; + -webkit-overflow-scrolling: touch; +} +.input.th-form-control::-webkit-scrollbar { + display: none; +} + +.login-popup-container section { + line-height: 23px; + max-width: 600px; +} +.login-popup-container h2 { + font-size: 24px; + margin-top: 15px; + margin-bottom: 15px; +} +.login-popup-container p { + margin-bottom: 18px; +} +.login-popup-container p.help-block { + margin-top: 18px; + margin-bottom: -7px; +} +.login-popup-container .form-control { + max-width: 280px; +} + +.dots-animated:after { + position: absolute; + display: inline-block; + animation: dotty steps(1, end) 1s infinite; + content: '...'; +} + +@-webkit-keyframes dotty { + 0%, 100% { content: ''; } + 25% { content: '.'; } + 50% { content: '..'; } + 75% { content: '...'; } +} +@keyframes dotty { + 0%, 100% { content: ''; } + 25% { content: '.'; } + 50% { content: '..'; } + 75% { content: '...'; } +} + +@-webkit-keyframes upload-circle { + from { transform: rotateZ(-90deg); } + to { transform: rotateZ(270deg); } +} +@keyframes upload-circle { + from { transform: rotateZ(-90deg); } + to { transform: rotateZ(270deg); } +} + +header { + width: 100%; + margin: 0; + position: fixed; + z-index: 100; + background: #fff; +} +header .header-wrap { + padding: 9px 0 8px; + position: relative; + background: #fff; + box-shadow: 0 1px rgba(0, 0, 0, .12); + z-index: 2; +} +header + main { + padding-top: 59px; +} + +header.has-search + main section.th-content { + padding-top: 49px; +} +header.has-message + main { + margin-top: 112px; +} +header .btn-lg { + padding: 11px 12px 10px; +} +.header-panel { + position: relative; + padding: 0 15px; + z-index: 7; +} +.header-panel .header-breadcrumb { + height: 41px; + overflow: hidden; +} +.header-auth { + float: right; + margin-left: 15px; +} +.header-btn-wrap { + float: right; + transition: all .2s ease; + width: 0; +} +.header-btn-oshow .header-btn-wrap { + opacity: 1; + visibility: visible; + pointer-events: auto; + width: auto; +} +.header-btn-wrap, +.header-btn-oshow .th-theme-header { + opacity: 0; + visibility: visible; + pointer-events: auto; +} +.header-auth-item { + display: inline-block; + vertical-align: top; + padding: 11px 0; + font-weight: 500; + white-space: nowrap; +} +.header-auth-item + .header-auth-item { + margin-left: 15px; +} +.header-auth-link { + display: inline-block; + vertical-align: top; +} +.header-auth-photo { + display: inline-block; + vertical-align: top; + width: 32px; + height: 32px; + border-radius: 16px; + background: #efefef; + text-align: center; + overflow: hidden; + margin: -7px 0 -7px 0; +} +.header-auth-photo img { + width: 100%; +} +.header-auth-photo .photo-char { + font-size: 14px; + vertical-align: middle; + line-height: 32px; + color: #999; +} +.header-search-item { + padding-bottom: 18px; + margin-bottom: -18px; + overflow: hidden; +} +.header-auth-name { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + max-width: 190px; + color: #0086d3; +} +.header-auth-name:after { + content: ''; + display: inline-block; + width: 12px; + height: 7px; + background: url('/img/translations/icons.png?8') no-repeat -7px -324px; + margin: 0 0 2px 7px; +} +@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { + .header-auth-name:after { + background-image: url('/img/translations/icons_2x.png?8'); + background-size: 26px 752px; + } +} +.header-auth-name.dropdown-toggle { + cursor: pointer; +} +.header-auth-name + .dropdown-menu { + top: -21px; + left: auto; + right: -4px; +} +@media (min-width: 1420px) { + .header-auth-name + .dropdown-menu { + left: -4px; + right: auto; + } +} + +.header-message { + background: #1e98d4; + text-align: center; + color: #fff; + padding: 13px 15px; +} +.header-message a { + color: #fff; + text-decoration: underline; +} +.header-message .hide-button { + color: #fff; + margin: -11px -12px -10px 12px; + font-weight: normal; + float: right; +} + +header .breadcrumb > .active, +header .breadcrumb > .active a { + color: #222; +} +header .breadcrumb > .placeholder { + color: #999; +} +header .breadcrumb > li { + padding: 11px 0; + font-size: 15px; + line-height: 1.3333333; + font-weight: 500; + position: relative; +} +header .breadcrumb > li > a, +header .breadcrumb > li.active > strong { + display: inline-block; + text-overflow: ellipsis; + vertical-align: top; + overflow: hidden; + max-width: 190px; +} +header .container-fluid .breadcrumb > li > a, +header .container-fluid .breadcrumb > li.active > strong { + max-width: 240px; +} +header .breadcrumb > li.active > a { + overflow: visible; + max-width: none; +} +header .breadcrumb > li:before { + content: ''; +} +header .breadcrumb > li:after { + content: "\00a0/\00a0"; + padding: 0 8px; + color: #d4d4d4; +} +header .breadcrumb > li:last-child:after { + content: ''; +} +header .input-group-addon.breadcrumb > li:last-child:after { + content: "\00a0/\00a0"; +} +header .header-breadcrumb .dropdown { + position: static; +} +header .header-breadcrumb .dropdown-menu { + left: auto; + top: 48px; + margin: 0 0 0 -15px; + min-width: 0; + font-size: 15px; + border: none; + box-shadow: 0 0 2px rgba(0, 0, 0, .15); +} +header .header-breadcrumb .dropdown.open > .dropdown-menu { + display: inline; +} +header .header-breadcrumb .dropdown.open > .dropdown-menu > li { + display: block; +} +header .header-breadcrumb .dropdown.open > .dropdown-menu > li > a { + padding: 10px 35px 10px 15px; + margin: 0; + color: #2e87ca; +} +header .header-breadcrumb .dropdown.open > .dropdown-menu > li > a:hover { + background-color: #f0f6fa; + color: #2e87ca; +} +header .header-breadcrumb .dropdown.open > .dropdown-menu > li.active > a:hover, +header .header-breadcrumb .dropdown.open > .dropdown-menu > li.active > a { + background-color: #1e98d4; + color: #fff; + font-weight: 500; + position: relative; +} +.buttons-wrap { + padding: 15px 0; +} +.buttons-wrap .btn { + margin-left: -15px; +} + +.header-breadcrumb .breadcrumb { + background: none; + border: transparent; + padding: 0; + margin: 0; + overflow: visible; +} +.header-breadcrumb-simple .breadcrumb { + overflow: hidden; +} +.header-breadcrumb-simple .breadcrumb > .active { + display: inline; +} +.header-breadcrumb .input-label { + font-weight: normal; +} +.input-group .input-dropdown { + display: table-cell; + position: relative; +} +.input-dropdown .form-control { + height: auto; + border: transparent; + background: transparent; + color: #222; + overflow: hidden; + text-overflow: ellipsis; + padding: 11px 16px 11px 1px; + margin-left: -1px; + border-radius: 0 !important; + transition: color .2s ease; +} +.form-control::-webkit-input-placeholder { + transition: color .2s ease; + color: #999; +} +.form-control::-moz-placeholder { + transition: color .2s ease; + color: #999; +} +.form-control:-ms-input-placeholder { + transition: color .2s ease; + color: #999; +} +.form-control:focus::-webkit-input-placeholder { + color: #ccc; +} +.form-control:focus::-moz-placeholder { + color: #ccc; +} +.form-control:focus:-ms-input-placeholder { + color: #ccc; +} +.has-section-status .input-dropdown .form-control { + padding-right: 50px; +} + + +.progress-bar { + width: 0; + transition: width .4s linear, box-shadow .3s ease; +} +.progress-bar.no-transition { + transition: none; +} +.progress-bar.no-shown { + box-shadow: inset 0 0 0 #39ade7; +} + +header .progress-bar { + position: absolute; + z-index: 1; + bottom: 0; + height: 3px; + box-shadow: inset 0 -2px 0 #39ade7; +} + +.btn-inactive { + cursor: auto; + pointer-events: none; +} + +.nav-menu { + padding: 10px 0 30px; +} +@media (min-width: 768px) { + .nav-menu.nav-menu-can-fix { + position: fixed; + top: 68px; + bottom: 0; + overflow-y: scroll; + } + header.has-message + main .nav-menu.nav-menu-can-fix { + top: 112px; + } + .nav-menu.nav-menu-can-fix::-webkit-scrollbar { + display: none; + } +} + +.section-header { + position: relative; + overflow: hidden; +} + +.header-labels { + position: absolute; + font-size: 13px; + line-height: 16px; + height: 0; + bottom: 0; + right: 0; +} +.header-labels .help-labels { + position: relative; + white-space: nowrap; +} +.header-labels .help-label { + position: absolute; + padding: 4px 10px; + right: 0; + color: #aaa; +} +.header-labels .help-label a { + color: #555; + cursor: pointer; +} + +section h3 .header-count { + margin-left: 10px; + color: #999; +} + +.popup-form { + margin: 25px 0 0; + overflow: visible !important; +} + +.radio-row { + display: block; + margin: 5px -5px; + padding: 5px; + font-weight: normal; + overflow: hidden; + cursor: pointer; +} +.radio-row .radio { + position: absolute; + left: -5000px; +} +.radio-row .radio + .radio-label { + position: relative; + line-height: 18px; + padding: 0; +} +.radio-row .radio + .radio-label:before { + display: inline-block; + content: ''; + width: 18px; + height: 18px; + border-radius: 9px; + border: 2px solid #999; + vertical-align: top; + margin: 0 12px 0 0; + padding: 0; +} +.radio-row .radio:checked + .radio-label:before { + border-color: #319bd8; +} +.radio-row .radio:checked + .radio-label:after { + display: inline-block; + content: ''; + width: 8px; + height: 8px; + border-radius: 4px; + background: #319bd8; + vertical-align: top; + margin: 5px; + padding: 0; + position: absolute; + left: 0; +} +.radio-row .radio.disabled + .radio-label, +.radio-row .radio[disabled] + .radio-label { + opacity: 0.65; +} + +.radio-item .radio-input + .radio-label, +.checkbox-item .checkbox-input + .checkbox-label { + vertical-align: top; + line-height: 19px; + padding-top: 1px; +} + + +.section-label { + font-size: 15px; + font-weight: normal; + margin: 0 5px 0 12px; + float: right; +} +.section-label-success { + color: #449d44; +} +.section-label-danger { + color: #c9302c; +} +.section-label-info { + color: #31b0d5; +} +.section-btn .glyphicon, +.section-label .glyphicon { + font-size: 17px; + position: static; + vertical-align: middle; +} +.section-btn .label { + padding: 0 4px; +} +.section-label .label { + padding: 0 2px; + vertical-align: middle; +} + +.list-group-item-heading .section-label { + font-size: 13px; +} +.list-group-item-heading .section-label .glyphicon { + font-size: 14px; +} + +#dev_page_content_wrap { + padding: 0 25px 10px; + max-width: none; +} +#dev_page_content, +#dev_page_content p { + font-size: 15px; + line-height: 1.6; +} +#dev_page_content_wrap h1, +#dev_page_content_wrap h2, +#dev_page_content_wrap h3, +#dev_page_content_wrap h4, +.page-content-wrap h3 { + font-weight: 500; + position: relative; +} +#dev_page_content_wrap h1 { + font-size: 21px; + margin: 27px 0 12px; +} +#dev_page_content_wrap h2, +#dev_page_content_wrap h3 { + font-size: 19px; + margin: 27px 0 12px; +} +#dev_page_content_wrap h4, +#dev_page_content_wrap h5 { + font-size: 17px; + margin: 27px 0 10px; +} +#dev_page_content_wrap pre, +#dev_page_content_wrap code { + font-family: monospace, 'Courier New'; + font-size: 87%; +} +#dev_page_content_wrap pre { + line-height: 18px; + word-wrap: break-word; + white-space: pre-wrap; + word-break: normal; + padding: 6px 12px; + border: none; + background: #f4f8fb; +} +#dev_page_content_wrap code { + color: inherit; + background: #ecf3f8; +} +#dev_page_content_wrap blockquote { + border-color: #179cde; + padding: 5px 17px; +} +#dev_page_content_wrap b, +#dev_page_content_wrap strong { + font-weight: 500; +} +#dev_page_content_wrap .dev_page_image { + display: block; + max-width: 100% !important; + margin: 0 auto; + padding: 10px 0px 5px; +} + +#dev_page_content_wrap a.anchor, +.page-content-wrap a.anchor { + position: absolute; + height: 1px; + top: -70px; +} +header.has-message + main #dev_page_content_wrap a.anchor, +header.has-message + main .page-content-wrap a.anchor { + top: -114px; +} +#dev_page_content_wrap a.anchor-link, +.page-content-wrap a.anchor-link { + text-decoration: none; + line-height: 1; + margin-left: -0.7em; + + cursor: default; + display: block; + position: absolute; + top: 0; + left: 0; + bottom: 0; + + border-top: 10px solid transparent; + margin-top: -10px; + outline: 0; +} + +#dev_page_content_wrap a.anchor-link i.anchor-icon, +.page-content-wrap a.anchor-link i.anchor-icon { + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: 400; + font-size: 62%; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + margin-top: 2px; + opacity: 0; + + cursor: pointer; + padding: 0; + position: relative; + z-index: 10; + + -webkit-transition: opacity .2s ease-in-out; + -moz-transition: opacity .2s ease-in-out; + -ms-transition: opacity .2s ease-in-out; + -o-transition: opacity .2s ease-in-out; + transition: opacity .2s ease-in-out; +} +#dev_page_content_wrap a.anchor-link i.anchor-icon:before, +.page-content-wrap a.anchor-link i.anchor-icon:before { + content: "\e144"; +} +@media (min-width: 992px) { + #dev_page_content_wrap a.anchor-link, + .page-content-wrap a.anchor-link { + margin-left: -1.1em; + } + #dev_page_content_wrap a.anchor-link i.anchor-icon, + .page-content-wrap a.anchor-link i.anchor-icon { + font-size: 85%; + } +} + +#dev_page_content_wrap h1 a.anchor-link i.anchor-icon { + margin-top: 4px; +} + +#dev_page_content_wrap h1:hover a.anchor-link i.anchor-icon, +#dev_page_content_wrap h2:hover a.anchor-link i.anchor-icon, +#dev_page_content_wrap h3:hover a.anchor-link i.anchor-icon, +#dev_page_content_wrap h4:hover a.anchor-link i.anchor-icon, +.page-content-wrap h3:hover a.anchor-link i.anchor-icon { + opacity: 0.6; +} +#dev_page_content_wrap i.anchor-icon:hover, +.page-content-wrap i.anchor-icon:hover { + opacity: 1 !important; +} + +#dev_side_nav_cont .dev_side_nav_wrap { + position: relative; + display: none; +} +@media (min-width: 768px) { + #dev_side_nav_cont .dev_side_nav_wrap { + display: block; + } +} +#dev_side_nav_cont .dev_side_nav { + position: static; + width: auto; +} +#dev_side_nav_cont .dev_side_nav > ul { + width: auto; + float: none; + background: none; + padding: 7px 0; +} +#dev_side_nav_cont .dev_side_nav > ul::-webkit-scrollbar { + display: none; +} +#dev_side_nav_cont .dev_side_nav > ul.affix-top, +#dev_side_nav_cont .dev_side_nav > ul.affix, +#dev_side_nav_cont .dev_side_nav > ul.affix-bottom { + position: static; +} +#dev_side_nav_cont .dev_side_nav li { + float: none !important; +} +#dev_side_nav_cont .dev_side_nav li:before { + display: none; +} +#dev_side_nav_cont .dev_side_nav li a { + border-left: 3px solid transparent; + padding: 9px 15px 9px 12px; + font-size: 13px; + font-weight: normal; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + display: block; +} +#dev_side_nav_cont .dev_side_nav li li a { + padding: 6px 15px 6px 22px; + font-size: 12px; + font-weight: 400; +} +#dev_side_nav_cont .dev_side_nav li a:hover { + background: #f0f6fa !important; +} +#dev_side_nav_cont .dev_side_nav li.active > a { + border-left: 3px solid #1e98d4; +} +#dev_side_nav_cont .dev_side_nav li ul { + display: none; +} +#dev_side_nav_cont .dev_side_nav li.active ul { + display: block; +} + +main.intro, +main.docs { + padding-bottom: 43px; +} + +main.docs #dev_page_content_wrap h1#dev_page_title { + font-size: 24px; + margin: 12px 0 12px; +} + +main.intro #dev_page_content_wrap h1#dev_page_title { + padding: 12px 0 12px; + margin: 0; + font-weight: 500; + font-size: 18px; +} + +.popup-container { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + background: rgba(0,0,0,.6); + z-index: 101; + display: -webkit-flex; + display: flex; + justify-content: center; + align-items: center; + overflow: auto; + -webkit-overflow-scrolling: touch; +} +.popup { + max-width: 100%; + word-wrap: break-word; + margin: 15px; + border-radius: 4px; + background: #fff; + box-shadow: 0 0 12px rgba(0, 0, 0, .3); +} +.popup section { + position: relative; + padding-bottom: 60px; +} +.popup h4 { + font-size: 18px; + margin: 5px 0 15px; +} +.popup h4 ~ h4 { + margin-top: 25px; +} +.popup-body { + padding: 20px; +} +.login-popup-container .popup-body { + padding: 15px 25px 25px; +} +@media (min-width: 560px) { + .popup { + margin: 50px; + } + .popup-body { + padding: 30px 35px; + } + .login-popup-container .popup-body { + padding: 50px 60px; + } +} +@media (min-width: 768px) { + .popup { + max-width: 600px; + } +} +.popup .popup-text { + margin: 0; + line-height: 24px; + position: relative; + z-index: 1; +} +.popup .popup-buttons { + margin: -17px -15px -10px; + position: absolute; + right: 0; + bottom: 0; +} + + + +.form-group label, +.popup-text b, +.th-markdown strong { + font-weight: 500; +} +.form-group-buttons { + margin-top: 30px; +} + + +a.th-header-right-btn, +button.th-header-right-btn { + font-size: 12px; + line-height: 14px; + padding: 4px 10px 3px; + margin: 1px 0 1px 7px; + border-radius: 3px; + position: relative; + float: right; + z-index: 1; +} + +.th-filter-wrap { + display: inline-block; + position: relative; + margin: -3px -9px 0 0; + float: right; + z-index: 1; +} +.th-dropdown { + display: inline-block; + font-size: 13px; + line-height: 15px; + padding: 5px 12px; + border-radius: 3px; + color: #0086d3; +} +.th-dropdown.dropdown-toggle { + cursor: pointer; +} +.th-dropdown.dropdown-toggle:hover, +.open .th-dropdown.dropdown-toggle { + background: #f0f4f7; +} +.th-dropdown-wrap span.dropdown-menu { + left: auto; + right: 0; + margin: 7px 0 0; + border: 1px solid rgba(0, 0, 0, .06); + border-radius: 4px; + font-size: 14px; + line-height: 1.42857143; + overflow: hidden; + min-width: 150px; +} +.th-dropdown-wrap span.dropdown-menu > ul.dropdown-menu { + position: static; + display: block; + float: none; + border: none; + box-shadow: none; + border-radius: 0; + min-width: 0; + margin: 0 -20px 0 0; + padding: 7px 20px 7px 0; + max-height: 235px; + overflow: auto; + -webkit-overflow-scrolling: touch; +} +.th-dropdown-wrap ul.dropdown-menu > li > .th-dropdown-item { + display: block; + cursor: pointer; + padding: 6px 36px 6px 15px; + margin: 0; + position: relative; + color: #222; +} +.th-dropdown-wrap ul.dropdown-menu > li > .th-dropdown-item:hover, +.th-dropdown-wrap ul.dropdown-menu > li > .th-dropdown-item:focus { + background-color: #f4f4f4; + color: #222; +} +.th-dropdown-wrap ul.dropdown-menu > li.selected > .th-dropdown-item:after { + content: ''; + display: inline-block; + position: absolute; + pointer-events: none; + bottom: 0; + right: 0; + top: 0; + margin: auto 13px; + width: 15px; + height: 12px; + background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 15 12" width="15" height="12" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M 2 6 L 5.5 9.5 L 13 3" stroke="%23228fe1" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/%3E%3C/svg%3E'); +} +.th-places-wrap { + display: inline-block; + position: relative; + margin: 10px 0 0 4px; + float: right; +} +.th-places-wrap .th-dropdown { + font-weight: 500; + text-align: center; + width: 36px; +} + + + +@media (min-width: 720px) { + .container { + padding-left: 15px; + padding-right: 15px; + } + .th-aside { + width: 308px; + float: right; + margin: -5px 15px 35px; + } + .th-content { + min-width: 308px; + margin-top: -5px; + } + .th-aside + .th-content { + margin-right: 410px; + } + .th-logo-title { + display: inline; + } + .th-aside > a.th-header-right-btn, + .th-aside > button.th-header-right-btn { + margin-top: 26px; + } + .th-dropdown-wrap span.dropdown-menu { + left: 0; + right: auto; + } + .th-theme-header .th-theme-buttons { + margin-right: 0; + } + .th-theme-source-code-wrap .CodeMirror { + border-width: 1px; + } +} diff --git a/data/themes.telegram.org/js/bootstrap.min.js b/data/themes.telegram.org/js/bootstrap.min.js new file mode 100644 index 0000000000..ab0c4b1bf2 --- /dev/null +++ b/data/themes.telegram.org/js/bootstrap.min.js @@ -0,0 +1,11 @@ +/*! + * Bootstrap v3.2.0 (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +/*! + * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=cc2c54fe9eb3aea36d65) + * Config saved to config.json and https://gist.github.com/cc2c54fe9eb3aea36d65 + */ +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(t){"use strict";function e(e){return this.each(function(){var i=t(this),s=i.data("bs.alert");s||i.data("bs.alert",s=new o(this)),"string"==typeof e&&s[e].call(i)})}var i='[data-dismiss="alert"]',o=function(e){t(e).on("click",i,this.close)};o.VERSION="3.2.0",o.prototype.close=function(e){function i(){n.detach().trigger("closed.bs.alert").remove()}var o=t(this),s=o.attr("data-target");s||(s=o.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,""));var n=t(s);e&&e.preventDefault(),n.length||(n=o.hasClass("alert")?o:o.parent()),n.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(n.removeClass("in"),t.support.transition&&n.hasClass("fade")?n.one("bsTransitionEnd",i).emulateTransitionEnd(150):i())};var s=t.fn.alert;t.fn.alert=e,t.fn.alert.Constructor=o,t.fn.alert.noConflict=function(){return t.fn.alert=s,this},t(document).on("click.bs.alert.data-api",i,o.prototype.close)}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),s=o.data("bs.button"),n="object"==typeof e&&e;s||o.data("bs.button",s=new i(this,n)),"toggle"==e?s.toggle():e&&s.setState(e)})}var i=function(e,o){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,o),this.isLoading=!1};i.VERSION="3.2.0",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(e){var i="disabled",o=this.$element,s=o.is("input")?"val":"html",n=o.data();e+="Text",null==n.resetText&&o.data("resetText",o[s]()),o[s](null==n[e]?this.options[e]:n[e]),setTimeout(t.proxy(function(){"loadingText"==e?(this.isLoading=!0,o.addClass(i).attr(i,i)):this.isLoading&&(this.isLoading=!1,o.removeClass(i).removeAttr(i))},this),0)},i.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")&&(i.prop("checked")&&this.$element.hasClass("active")?t=!1:e.find(".active").removeClass("active")),t&&i.prop("checked",!this.$element.hasClass("active")).trigger("change")}t&&this.$element.toggleClass("active")};var o=t.fn.button;t.fn.button=e,t.fn.button.Constructor=i,t.fn.button.noConflict=function(){return t.fn.button=o,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(i){var o=t(i.target);o.hasClass("btn")||(o=o.closest(".btn")),e.call(o,"toggle"),i.preventDefault()})}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),s=o.data("bs.carousel"),n=t.extend({},i.DEFAULTS,o.data(),"object"==typeof e&&e),r="string"==typeof e?e:n.slide;s||o.data("bs.carousel",s=new i(this,n)),"number"==typeof e?s.to(e):r?s[r]():n.interval&&s.pause().cycle()})}var i=function(e,i){this.$element=t(e).on("keydown.bs.carousel",t.proxy(this.keydown,this)),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};i.VERSION="3.2.0",i.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},i.prototype.keydown=function(t){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()},i.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},i.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},i.prototype.to=function(e){var i=this,o=this.getItemIndex(this.$active=this.$element.find(".item.active"));return e>this.$items.length-1||0>e?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){i.to(e)}):o==e?this.pause().cycle():this.slide(e>o?"next":"prev",t(this.$items[e]))},i.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){return this.sliding?void 0:this.slide("next")},i.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},i.prototype.slide=function(e,i){var o=this.$element.find(".item.active"),s=i||o[e](),n=this.interval,r="next"==e?"left":"right",a="next"==e?"first":"last",l=this;if(!s.length){if(!this.options.wrap)return;s=this.$element.find(".item")[a]()}if(s.hasClass("active"))return this.sliding=!1;var h=s[0],p=t.Event("slide.bs.carousel",{relatedTarget:h,direction:r});if(this.$element.trigger(p),!p.isDefaultPrevented()){if(this.sliding=!0,n&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var c=t(this.$indicators.children()[this.getItemIndex(s)]);c&&c.addClass("active")}var d=t.Event("slid.bs.carousel",{relatedTarget:h,direction:r});return t.support.transition&&this.$element.hasClass("slide")?(s.addClass(e),s[0].offsetWidth,o.addClass(r),s.addClass(r),o.one("bsTransitionEnd",function(){s.removeClass([e,r].join(" ")).addClass("active"),o.removeClass(["active",r].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(d)},0)}).emulateTransitionEnd(1e3*o.css("transition-duration").slice(0,-1))):(o.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(d)),n&&this.cycle(),this}};var o=t.fn.carousel;t.fn.carousel=e,t.fn.carousel.Constructor=i,t.fn.carousel.noConflict=function(){return t.fn.carousel=o,this},t(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(i){var o,s=t(this),n=t(s.attr("data-target")||(o=s.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,""));if(n.hasClass("carousel")){var r=t.extend({},n.data(),s.data()),a=s.attr("data-slide-to");a&&(r.interval=!1),e.call(n,r),a&&n.data("bs.carousel").to(a),i.preventDefault()}}),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var i=t(this);e.call(i,i.data())})})}(jQuery),+function(t){"use strict";function e(e){e&&3===e.which||(t(s).remove(),t(n).each(function(){var o=i(t(this)),s={relatedTarget:this};o.hasClass("open")&&(o.trigger(e=t.Event("hide.bs.dropdown",s)),e.isDefaultPrevented()||o.removeClass("open").trigger("hidden.bs.dropdown",s))}))}function i(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var o=i&&t(i);return o&&o.length?o:e.parent()}function o(e){return this.each(function(){var i=t(this),o=i.data("bs.dropdown");o||i.data("bs.dropdown",o=new r(this)),"string"==typeof e&&o[e].call(i)})}var s=".dropdown-backdrop",n='[data-toggle="dropdown"]',r=function(e){t(e).on("click.bs.dropdown",this.toggle)};r.VERSION="3.2.0",r.prototype.toggle=function(o){var s=t(this);if(!s.is(".disabled, :disabled")){var n=i(s),r=n.hasClass("open");if(e(),!r){"ontouchstart"in document.documentElement&&!n.closest(".navbar-nav").length&&t('