diff --git a/data/core.telegram.org/constructor/error.html b/data/core.telegram.org/constructor/error.html new file mode 100644 index 0000000000..50690654a5 --- /dev/null +++ b/data/core.telegram.org/constructor/error.html @@ -0,0 +1,152 @@ + + + + + error + + + + + + + + + + + + + +
+ +
+
+
+ +

error

+ +

Error.

+

+ +
+
error#c4b9f9bb code:int text:string = Error;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
codeintError code
textstringMessage
+

Type

+

Error

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/null.html b/data/core.telegram.org/constructor/null.html new file mode 100644 index 0000000000..3c3bb87d9d --- /dev/null +++ b/data/core.telegram.org/constructor/null.html @@ -0,0 +1,132 @@ + + + + + null + + + + + + + + + + + + + +
+ +
+
+
+ +

null

+ +

Corresponds to an arbitrary empty object.

+

+ +
+
null#56730bcc = Null;

+

Parameters

+

This constructor does not require any parameters.

+

Type

+

Null

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/phoneCall.html b/data/core.telegram.org/constructor/phoneCall.html new file mode 100644 index 0000000000..dcba9dafe1 --- /dev/null +++ b/data/core.telegram.org/constructor/phoneCall.html @@ -0,0 +1,209 @@ + + + + + phoneCall + + + + + + + + + + + + + +
+ +
+
+
+ +

phoneCall

+ +

Phone call

+

+ +
+
phoneCall#967f7c67 flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector<PhoneConnection> start_date:int = PhoneCall;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
p2p_allowedflags.5?trueWhether P2P connection to the other peer is allowed
videoflags.6?trueWhether this is a video call
idlongCall ID
access_hashlongAccess hash
dateintDate of creation of the call
admin_idlongUser ID of the creator of the call
participant_idlongUser ID of the other participant in the call
g_a_or_bbytesParameter for key exchange
key_fingerprintlongKey fingerprint
protocolPhoneCallProtocolCall protocol info to be passed to libtgvoip
connectionsVector<PhoneConnection>List of endpoints the user can connect to to exchange call data
start_dateintWhen was the call actually started
+

Type

+

PhoneCall

+

Related pages

+

End-to-End Encrypted Voice Calls

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/phoneCallAccepted.html b/data/core.telegram.org/constructor/phoneCallAccepted.html new file mode 100644 index 0000000000..86e8ad2759 --- /dev/null +++ b/data/core.telegram.org/constructor/phoneCallAccepted.html @@ -0,0 +1,189 @@ + + + + + phoneCallAccepted + + + + + + + + + + + + + +
+ +
+
+
+ +

phoneCallAccepted

+ +

An accepted phone call

+

+ +
+
phoneCallAccepted#3660c311 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol = PhoneCall;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
videoflags.6?trueWhether this is a video call
idlongID of accepted phone call
access_hashlongAccess hash of phone call
dateintWhen was the call accepted
admin_idlongID of the call creator
participant_idlongID of the other user in the call
g_bbytesB parameter for secure E2E phone call key exchange
protocolPhoneCallProtocolProtocol to use for phone call
+

Type

+

PhoneCall

+

Related pages

+

End-to-End Encrypted Voice Calls

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/phoneCallRequested.html b/data/core.telegram.org/constructor/phoneCallRequested.html new file mode 100644 index 0000000000..34eb4e4dd2 --- /dev/null +++ b/data/core.telegram.org/constructor/phoneCallRequested.html @@ -0,0 +1,189 @@ + + + + + phoneCallRequested + + + + + + + + + + + + + +
+ +
+
+
+ +

phoneCallRequested

+ +

Requested phone call

+

+ +
+
phoneCallRequested#14b0ed0c flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
videoflags.6?trueWhether this is a video call
idlongPhone call ID
access_hashlongAccess hash
dateintWhen was the phone call created
admin_idlongID of the creator of the phone call
participant_idlongID of the other participant of the phone call
g_a_hashbytesParameter for key exchange
protocolPhoneCallProtocolCall protocol info to be passed to libtgvoip
+

Type

+

PhoneCall

+

Related pages

+

End-to-End Encrypted Voice Calls

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/statsURL.html b/data/core.telegram.org/constructor/statsURL.html new file mode 100644 index 0000000000..896601ca9f --- /dev/null +++ b/data/core.telegram.org/constructor/statsURL.html @@ -0,0 +1,147 @@ + + + + + statsURL + + + + + + + + + + + + + +
+ +
+
+
+ +

statsURL

+ +

URL with chat statistics

+

+ +
+
statsURL#47a971e0 url:string = StatsURL;

+

Parameters

+ + + + + + + + + + + + + + + +
NameTypeDescription
urlstringChat statistics
+

Type

+

StatsURL

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/contest300K.html b/data/core.telegram.org/contest300K.html new file mode 100644 index 0000000000..86ddea9c34 --- /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/method/messages.getDhConfig b/data/core.telegram.org/method/messages.getDhConfig new file mode 100644 index 0000000000..b9adc1ca90 --- /dev/null +++ b/data/core.telegram.org/method/messages.getDhConfig @@ -0,0 +1,175 @@ + + + + + messages.getDhConfig + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.getDhConfig

+ +

Returns configuration parameters for Diffie-Hellman key generation. Can also return a random sequence of bytes of required length.

+

+ +
+
messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;
+messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;
+---functions---
+messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
versionintValue of the version parameter from messages.dhConfig, avialable at the client
random_lengthintLength of the required random sequence
+

Result

+

messages.DhConfig

+

Possible errors

+ + + + + + + + + + + + + + + +
CodeTypeDescription
400RANDOM_LENGTH_INVALIDRandom length invalid.
+

Related pages

+

messages.dhConfig

+

New set of configuring parameters.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/method/phone.acceptCall b/data/core.telegram.org/method/phone.acceptCall new file mode 100644 index 0000000000..396248bac2 --- /dev/null +++ b/data/core.telegram.org/method/phone.acceptCall @@ -0,0 +1,193 @@ + + + + + phone.acceptCall + + + + + + + + + + + + + +
+ +
+
+
+ +

phone.acceptCall

+ +

Accept incoming call

+

+ +
+
phone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector<User> = phone.PhoneCall;
+---functions---
+phone.acceptCall#3bd2b4a0 peer:InputPhoneCall g_b:bytes protocol:PhoneCallProtocol = phone.PhoneCall;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
peerInputPhoneCallThe call to accept
g_bbytesParameter for E2E encryption key exchange »
protocolPhoneCallProtocolPhone call settings
+

Result

+

phone.PhoneCall

+

Possible errors

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeTypeDescription
400CALL_ALREADY_ACCEPTEDThe call was already accepted.
400CALL_ALREADY_DECLINEDThe call was already declined.
400CALL_PEER_INVALIDThe provided call peer object is invalid.
400CALL_PROTOCOL_FLAGS_INVALIDCall protocol flags invalid.
+

Related pages

+

End-to-End Encrypted Voice Calls

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/method/phone.requestCall b/data/core.telegram.org/method/phone.requestCall new file mode 100644 index 0000000000..7d8637b743 --- /dev/null +++ b/data/core.telegram.org/method/phone.requestCall @@ -0,0 +1,213 @@ + + + + + phone.requestCall + + + + + + + + + + + + + +
+ +
+
+
+ +

phone.requestCall

+ +

Start a telegram phone call

+

+ +
+
phone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector<User> = phone.PhoneCall;
+---functions---
+phone.requestCall#42ff96ed flags:# video:flags.0?true user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
videoflags.0?trueWhether to start a video call
user_idInputUserDestination of the phone call
random_idintRandom ID to avoid resending the same object
g_a_hashbytesParameter for E2E encryption key exchange »
protocolPhoneCallProtocolPhone call settings
+

Result

+

phone.PhoneCall

+

Possible errors

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeTypeDescription
400CALL_PROTOCOL_FLAGS_INVALIDCall protocol flags invalid.
400PARTICIPANT_VERSION_OUTDATEDThe other participant does not use an up to date telegram client with support for calls.
400USER_ID_INVALIDThe provided user ID is invalid.
403USER_IS_BLOCKEDYou were blocked by this user.
403USER_PRIVACY_RESTRICTEDThe user's privacy settings do not allow you to do this.
+

Related pages

+

End-to-End Encrypted Voice Calls

+ +
+ +
+
+ +
+ + + + + + 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..180cb6991a --- /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..bbf0d1a3b5 --- /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/schema.html b/data/core.telegram.org/schema.html new file mode 100644 index 0000000000..0c7574e3c8 --- /dev/null +++ b/data/core.telegram.org/schema.html @@ -0,0 +1,1800 @@ + + + + + Schema + + + + + + + + + + + + + +
+ +
+
+
+ +

Schema

+ +

Below you will find the current TL-schema. More details on TL »

+

See also the detailed schema in JSON »

+

See also TL-Schema for end-to-end encrypted messages »

+
+ +
+
boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+true#3fedd339 = True;
+
+vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+
+error#c4b9f9bb code:int text:string = Error;
+
+null#56730bcc = Null;
+
+inputPeerEmpty#7f3b18ea = InputPeer;
+inputPeerSelf#7da07ec9 = InputPeer;
+inputPeerChat#35a95cb9 chat_id:long = InputPeer;
+inputPeerUser#dde8a54c user_id:long access_hash:long = InputPeer;
+inputPeerChannel#27bcbbfc channel_id:long access_hash:long = InputPeer;
+inputPeerUserFromMessage#a87b0a1c peer:InputPeer msg_id:int user_id:long = InputPeer;
+inputPeerChannelFromMessage#bd2a0840 peer:InputPeer msg_id:int channel_id:long = InputPeer;
+
+inputUserEmpty#b98886cf = InputUser;
+inputUserSelf#f7c1b13f = InputUser;
+inputUser#f21158c6 user_id:long access_hash:long = InputUser;
+inputUserFromMessage#1da448e2 peer:InputPeer msg_id:int user_id:long = InputUser;
+
+inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+inputMediaEmpty#9664f57f = InputMedia;
+inputMediaUploadedPhoto#1e287d04 flags:# file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
+inputMediaPhoto#b3ba0635 flags:# id:InputPhoto ttl_seconds:flags.0?int = InputMedia;
+inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
+inputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = 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;
+inputMediaDocument#33473058 flags:# id:InputDocument ttl_seconds:flags.0?int query:flags.1?string = InputMedia;
+inputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;
+inputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = InputMedia;
+inputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia;
+inputMediaGame#d33f43f3 id:InputGame = InputMedia;
+inputMediaInvoice#d9799874 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:flags.1?string = InputMedia;
+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;
+inputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector<bytes> solution:flags.1?string solution_entities:flags.1?Vector<MessageEntity> = InputMedia;
+inputMediaDice#e66fbf7b emoticon:string = InputMedia;
+
+inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
+inputChatUploadedPhoto#c642724e flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = InputChatPhoto;
+inputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto;
+
+inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
+inputGeoPoint#48222faf flags:# lat:double long:double accuracy_radius:flags.0?int = InputGeoPoint;
+
+inputPhotoEmpty#1cd7bf0d = InputPhoto;
+inputPhoto#3bb3b94a id:long access_hash:long file_reference:bytes = InputPhoto;
+
+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#37257e99 flags:# big:flags.0?true peer:InputPeer photo_id:long = InputFileLocation;
+inputStickerSetThumb#9d84f3db stickerset:InputStickerSet thumb_version:int = InputFileLocation;
+inputGroupCallStream#598a92a flags:# call:InputGroupCall time_ms:long scale:int video_channel:flags.0?int video_quality:flags.0?int = InputFileLocation;
+
+peerUser#59511722 user_id:long = Peer;
+peerChat#36c6019a chat_id:long = Peer;
+peerChannel#a2a5371e channel_id:long = Peer;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.filePdf#ae1e508d = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+userEmpty#d3bc4b7a id:long = User;
+user#3ff6ecb0 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;
+
+userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
+userProfilePhoto#82d1f706 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto;
+
+userStatusEmpty#9d05049 = UserStatus;
+userStatusOnline#edb93949 expires:int = UserStatus;
+userStatusOffline#8c703f was_online:int = UserStatus;
+userStatusRecently#e26f42f1 = UserStatus;
+userStatusLastWeek#7bf09fc = UserStatus;
+userStatusLastMonth#77ebc742 = UserStatus;
+
+chatEmpty#29562865 id:long = Chat;
+chat#41cbf256 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true noforwards:flags.25?true id:long title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat;
+chatForbidden#6592a1a7 id:long title:string = Chat;
+channel#8261ac61 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;
+channelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat;
+
+chatFull#4dbdc099 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string = ChatFull;
+channelFull#e9b27a17 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string = ChatFull;
+
+chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant;
+chatParticipantCreator#e46bcee4 user_id:long = ChatParticipant;
+chatParticipantAdmin#a0933f5b user_id:long inviter_id:long date:int = ChatParticipant;
+
+chatParticipantsForbidden#8763d3e1 flags:# chat_id:long self_participant:flags.0?ChatParticipant = ChatParticipants;
+chatParticipants#3cbc93f8 chat_id:long participants:Vector<ChatParticipant> version:int = ChatParticipants;
+
+chatPhotoEmpty#37c1011c = ChatPhoto;
+chatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto;
+
+messageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message;
+message#85d6cbe2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;
+messageService#2b085862 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction ttl_period:flags.25?int = Message;
+
+messageMediaEmpty#3ded6320 = MessageMedia;
+messageMediaPhoto#695150d7 flags:# photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia;
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
+messageMediaContact#70322949 phone_number:string first_name:string last_name:string vcard:string user_id:long = MessageMedia;
+messageMediaUnsupported#9f84f49e = MessageMedia;
+messageMediaDocument#9cb070d7 flags:# document:flags.0?Document ttl_seconds:flags.2?int = MessageMedia;
+messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;
+messageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;
+messageMediaGame#fdb19008 game:Game = MessageMedia;
+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;
+messageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia;
+messageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;
+messageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia;
+
+messageActionEmpty#b6aef7b0 = MessageAction;
+messageActionChatCreate#bd47cbad title:string users:Vector<long> = MessageAction;
+messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
+messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
+messageActionChatDeletePhoto#95e3fbef = MessageAction;
+messageActionChatAddUser#15cefd00 users:Vector<long> = MessageAction;
+messageActionChatDeleteUser#a43f30cc user_id:long = MessageAction;
+messageActionChatJoinedByLink#31224c3 inviter_id:long = MessageAction;
+messageActionChannelCreate#95d2ac92 title:string = MessageAction;
+messageActionChatMigrateTo#e1037f92 channel_id:long = MessageAction;
+messageActionChannelMigrateFrom#ea3948e9 title:string chat_id:long = MessageAction;
+messageActionPinMessage#94bd38ed = MessageAction;
+messageActionHistoryClear#9fbab604 = MessageAction;
+messageActionGameScore#92a72876 game_id:long score:int = MessageAction;
+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;
+messageActionPhoneCall#80e11a7f flags:# video:flags.2?true call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction;
+messageActionScreenshotTaken#4792929b = MessageAction;
+messageActionCustomAction#fae69f56 message:string = MessageAction;
+messageActionBotAllowed#abe9affe domain:string = MessageAction;
+messageActionSecureValuesSentMe#1b287353 values:Vector<SecureValue> credentials:SecureCredentialsEncrypted = MessageAction;
+messageActionSecureValuesSent#d95c6154 types:Vector<SecureValueType> = MessageAction;
+messageActionContactSignUp#f3f25f76 = MessageAction;
+messageActionGeoProximityReached#98e0d697 from_id:Peer to_id:Peer distance:int = MessageAction;
+messageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int = MessageAction;
+messageActionInviteToGroupCall#502f92f7 call:InputGroupCall users:Vector<long> = MessageAction;
+messageActionSetMessagesTTL#aa1afbfd period:int = MessageAction;
+messageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;
+messageActionSetChatTheme#aa786345 emoticon:string = MessageAction;
+
+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;
+dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;
+
+photoEmpty#2331b22d id:long = 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;
+
+photoSizeEmpty#e17e23c type:string = PhotoSize;
+photoSize#75c78e60 type:string w:int h:int size:int = PhotoSize;
+photoCachedSize#21e1ad6 type:string w:int h:int bytes:bytes = PhotoSize;
+photoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;
+photoSizeProgressive#fa3efb95 type:string w:int h:int sizes:Vector<int> = PhotoSize;
+photoPathSize#d8214d41 type:string bytes:bytes = PhotoSize;
+
+geoPointEmpty#1117dd5f = GeoPoint;
+geoPoint#b2a2f663 flags:# long:double lat:double access_hash:long accuracy_radius:flags.0?int = GeoPoint;
+
+auth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;
+
+auth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization;
+auth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;
+
+auth.exportedAuthorization#b434e2b8 id:long bytes:bytes = auth.ExportedAuthorization;
+
+inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
+inputNotifyUsers#193b4417 = InputNotifyPeer;
+inputNotifyChats#4a95e84e = InputNotifyPeer;
+inputNotifyBroadcasts#b1db7c7e = InputNotifyPeer;
+
+inputPeerNotifySettings#9c3d198e flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = InputPeerNotifySettings;
+
+peerNotifySettings#af509d20 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = PeerNotifySettings;
+
+peerSettings#733f2961 flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true geo_distance:flags.6?int = PeerSettings;
+
+wallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;
+wallPaperNoFile#e0804116 id:long flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;
+
+inputReportReasonSpam#58dbcab8 = ReportReason;
+inputReportReasonViolence#1e22c78d = ReportReason;
+inputReportReasonPornography#2e59d922 = ReportReason;
+inputReportReasonChildAbuse#adf44ee3 = ReportReason;
+inputReportReasonOther#c1e4a2b1 = ReportReason;
+inputReportReasonCopyright#9b89f93a = ReportReason;
+inputReportReasonGeoIrrelevant#dbd4feed = ReportReason;
+inputReportReasonFake#f5ddd6e7 = ReportReason;
+
+userFull#d697ff05 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string = UserFull;
+
+contact#145ade0b user_id:long mutual:Bool = Contact;
+
+importedContact#c13e3c50 user_id:long client_id:long = ImportedContact;
+
+contactStatus#16d9703b user_id:long status:UserStatus = ContactStatus;
+
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
+contacts.contacts#eae87e42 contacts:Vector<Contact> saved_count:int users:Vector<User> = contacts.Contacts;
+
+contacts.importedContacts#77d01c3b imported:Vector<ImportedContact> popular_invites:Vector<PopularContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;
+
+contacts.blocked#ade1591 blocked:Vector<PeerBlocked> chats:Vector<Chat> users:Vector<User> = contacts.Blocked;
+contacts.blockedSlice#e1664194 count:int blocked:Vector<PeerBlocked> chats:Vector<Chat> users:Vector<User> = contacts.Blocked;
+
+messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+messages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;
+
+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;
+
+messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
+messages.chatsSlice#9cd81144 count:int chats:Vector<Chat> = messages.Chats;
+
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+
+messages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;
+
+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;
+
+updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
+updateMessageID#4e90bfd6 id:int random_id:long = Update;
+updateDeleteMessages#a20db0e5 messages:Vector<int> pts:int pts_count:int = Update;
+updateUserTyping#c01e857f user_id:long action:SendMessageAction = Update;
+updateChatUserTyping#83487af0 chat_id:long from_id:Peer action:SendMessageAction = Update;
+updateChatParticipants#7761198 participants:ChatParticipants = Update;
+updateUserStatus#e5bdf8de user_id:long status:UserStatus = Update;
+updateUserName#c3f202e0 user_id:long first_name:string last_name:string username:string = Update;
+updateUserPhoto#f227868c user_id:long date:int photo:UserProfilePhoto previous:Bool = Update;
+updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;
+updateEncryptedChatTyping#1710f156 chat_id:int = Update;
+updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;
+updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;
+updateChatParticipantAdd#3dda5451 chat_id:long user_id:long inviter_id:long date:int version:int = Update;
+updateChatParticipantDelete#e32f3d77 chat_id:long user_id:long version:int = Update;
+updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;
+updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;
+updateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector<MessageEntity> = Update;
+updatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update;
+updateUserPhone#5492a13 user_id:long phone:string = Update;
+updateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update;
+updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;
+updateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update;
+updateReadMessagesContents#68c13933 messages:Vector<int> pts:int pts_count:int = Update;
+updateChannelTooLong#108d941f flags:# channel_id:long pts:flags.0?int = Update;
+updateChannel#635b4c09 channel_id:long = Update;
+updateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;
+updateReadChannelInbox#922e6e10 flags:# folder_id:flags.0?int channel_id:long max_id:int still_unread_count:int pts:int = Update;
+updateDeleteChannelMessages#c32d5b12 channel_id:long messages:Vector<int> pts:int pts_count:int = Update;
+updateChannelMessageViews#f226ac08 channel_id:long id:int views:int = Update;
+updateChatParticipantAdmin#d7ca61a2 chat_id:long user_id:long is_admin:Bool version:int = Update;
+updateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update;
+updateStickerSetsOrder#bb2d201 flags:# masks:flags.0?true order:Vector<long> = Update;
+updateStickerSets#43ae3dec = Update;
+updateSavedGifs#9375341e = Update;
+updateBotInlineQuery#496f379c flags:# query_id:long user_id:long query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update;
+updateBotInlineSend#12f12a07 flags:# user_id:long query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;
+updateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update;
+updateBotCallbackQuery#b9cfc48d flags:# query_id:long user_id:long peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;
+updateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update;
+updateInlineBotCallbackQuery#691e9052 flags:# query_id:long user_id:long msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;
+updateReadChannelOutbox#b75f99a9 channel_id:long max_id:int = Update;
+updateDraftMessage#ee2bb969 peer:Peer draft:DraftMessage = Update;
+updateReadFeaturedStickers#571d2742 = Update;
+updateRecentStickers#9a422c20 = Update;
+updateConfig#a229dd06 = Update;
+updatePtsChanged#3354678f = Update;
+updateChannelWebPage#2f2ba99f channel_id:long webpage:WebPage pts:int pts_count:int = Update;
+updateDialogPinned#6e6fe51c flags:# pinned:flags.0?true folder_id:flags.1?int peer:DialogPeer = Update;
+updatePinnedDialogs#fa0f3ca2 flags:# folder_id:flags.1?int order:flags.0?Vector<DialogPeer> = Update;
+updateBotWebhookJSON#8317c0c3 data:DataJSON = Update;
+updateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update;
+updateBotShippingQuery#b5aefd7d query_id:long user_id:long payload:bytes shipping_address:PostAddress = Update;
+updateBotPrecheckoutQuery#8caa9a96 flags:# query_id:long user_id:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;
+updatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update;
+updateLangPackTooLong#46560264 lang_code:string = Update;
+updateLangPack#56022f4d difference:LangPackDifference = Update;
+updateFavedStickers#e511996d = Update;
+updateChannelReadMessagesContents#44bdd535 channel_id:long messages:Vector<int> = Update;
+updateContactsReset#7084a7be = Update;
+updateChannelAvailableMessages#b23fc698 channel_id:long available_min_id:int = Update;
+updateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = Update;
+updateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update;
+updateChatDefaultBannedRights#54c01850 peer:Peer default_banned_rights:ChatBannedRights version:int = Update;
+updateFolderPeers#19360dc0 folder_peers:Vector<FolderPeer> pts:int pts_count:int = Update;
+updatePeerSettings#6a7e7366 peer:Peer settings:PeerSettings = Update;
+updatePeerLocated#b4afcfb0 peers:Vector<PeerLocated> = Update;
+updateNewScheduledMessage#39a51dfb message:Message = Update;
+updateDeleteScheduledMessages#90866cee peer:Peer messages:Vector<int> = Update;
+updateTheme#8216fba3 theme:Theme = Update;
+updateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;
+updateLoginToken#564fe691 = Update;
+updateMessagePollVote#106395c9 poll_id:long user_id:long options:Vector<bytes> qts:int = Update;
+updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;
+updateDialogFilterOrder#a5d72105 order:Vector<int> = Update;
+updateDialogFilters#3504914f = Update;
+updatePhoneCallSignalingData#2661bf09 phone_call_id:long data:bytes = Update;
+updateChannelMessageForwards#d29a27f4 channel_id:long id:int forwards:int = Update;
+updateReadChannelDiscussionInbox#d6b19546 flags:# channel_id:long top_msg_id:int read_max_id:int broadcast_id:flags.0?long broadcast_post:flags.0?int = Update;
+updateReadChannelDiscussionOutbox#695c9e7c channel_id:long top_msg_id:int read_max_id:int = Update;
+updatePeerBlocked#246a4b22 peer_id:Peer blocked:Bool = Update;
+updateChannelUserTyping#8c88c923 flags:# channel_id:long top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update;
+updatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vector<int> pts:int pts_count:int = Update;
+updatePinnedChannelMessages#5bb98608 flags:# pinned:flags.0?true channel_id:long messages:Vector<int> pts:int pts_count:int = Update;
+updateChat#f89a6a4e chat_id:long = Update;
+updateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector<GroupCallParticipant> version:int = Update;
+updateGroupCall#14b24500 chat_id:long call:GroupCall = Update;
+updatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;
+updateChatParticipant#d087663a flags:# chat_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
+updateChannelParticipant#985d3abb flags:# channel_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
+updateBotStopped#c4870a49 user_id:long date:int stopped:Bool qts:int = Update;
+updateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;
+updateBotCommands#4d712f2e peer:Peer bot_id:long commands:Vector<BotCommand> = Update;
+
+updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
+
+updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
+updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;
+updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
+updates.differenceTooLong#4afe8f6d pts:int = updates.Difference;
+
+updatesTooLong#e317af7e = Updates;
+updateShortMessage#313bc7f8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
+updateShortChatMessage#4d6deea5 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:long chat_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+updateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
+
+photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
+photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
+
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+
+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;
+
+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;
+
+nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
+
+help.appUpdate#ccbbce30 flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector<MessageEntity> document:flags.1?Document url:flags.2?string sticker:flags.3?Document = help.AppUpdate;
+help.noAppUpdate#c45a6536 = help.AppUpdate;
+
+help.inviteText#18cb9f78 message:string = help.InviteText;
+
+encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
+encryptedChatWaiting#66b25953 id:int access_hash:long date:int admin_id:long participant_id:long = EncryptedChat;
+encryptedChatRequested#48f1d94c flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:long participant_id:long g_a:bytes = EncryptedChat;
+encryptedChat#61f0d4c7 id:int access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
+encryptedChatDiscarded#1e1c7c45 flags:# history_deleted:flags.0?true id:int = EncryptedChat;
+
+inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
+
+encryptedFileEmpty#c21f497e = EncryptedFile;
+encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;
+
+inputEncryptedFileEmpty#1837c364 = InputEncryptedFile;
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
+inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
+
+encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;
+encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;
+
+messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;
+messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;
+
+messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
+messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
+
+inputDocumentEmpty#72f0eaae = InputDocument;
+inputDocument#1abfb575 id:long access_hash:long file_reference:bytes = InputDocument;
+
+documentEmpty#36f8c871 id:long = Document;
+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;
+
+help.support#17c6b5f6 phone_number:string user:User = help.Support;
+
+notifyPeer#9fd40bd8 peer:Peer = NotifyPeer;
+notifyUsers#b4c83b4c = NotifyPeer;
+notifyChats#c007cec3 = NotifyPeer;
+notifyBroadcasts#d612e8ef = NotifyPeer;
+
+sendMessageTypingAction#16bf744e = SendMessageAction;
+sendMessageCancelAction#fd5ec8f5 = SendMessageAction;
+sendMessageRecordVideoAction#a187d66f = SendMessageAction;
+sendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;
+sendMessageRecordAudioAction#d52f73f7 = SendMessageAction;
+sendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;
+sendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction;
+sendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;
+sendMessageGeoLocationAction#176f8ba1 = SendMessageAction;
+sendMessageChooseContactAction#628cbc6f = SendMessageAction;
+sendMessageGamePlayAction#dd6a8f48 = SendMessageAction;
+sendMessageRecordRoundAction#88f27fbc = SendMessageAction;
+sendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction;
+speakingInGroupCallAction#d92c2285 = SendMessageAction;
+sendMessageHistoryImportAction#dbda9246 progress:int = SendMessageAction;
+sendMessageChooseStickerAction#b05ac6b1 = SendMessageAction;
+sendMessageEmojiInteraction#25972bcb emoticon:string msg_id:int interaction:DataJSON = SendMessageAction;
+sendMessageEmojiInteractionSeen#b665902e emoticon:string = SendMessageAction;
+
+contacts.found#b3134d9d my_results:Vector<Peer> results:Vector<Peer> chats:Vector<Chat> users:Vector<User> = contacts.Found;
+
+inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;
+inputPrivacyKeyChatInvite#bdfb0426 = InputPrivacyKey;
+inputPrivacyKeyPhoneCall#fabadc5f = InputPrivacyKey;
+inputPrivacyKeyPhoneP2P#db9e70d2 = InputPrivacyKey;
+inputPrivacyKeyForwards#a4dd4c08 = InputPrivacyKey;
+inputPrivacyKeyProfilePhoto#5719bacc = InputPrivacyKey;
+inputPrivacyKeyPhoneNumber#352dafa = InputPrivacyKey;
+inputPrivacyKeyAddedByPhone#d1219bdd = InputPrivacyKey;
+
+privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;
+privacyKeyChatInvite#500e6dfa = PrivacyKey;
+privacyKeyPhoneCall#3d662b7b = PrivacyKey;
+privacyKeyPhoneP2P#39491cc8 = PrivacyKey;
+privacyKeyForwards#69ec56a3 = PrivacyKey;
+privacyKeyProfilePhoto#96151fed = PrivacyKey;
+privacyKeyPhoneNumber#d19ae46d = PrivacyKey;
+privacyKeyAddedByPhone#42ffd42b = PrivacyKey;
+
+inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;
+inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;
+inputPrivacyValueAllowUsers#131cc67f users:Vector<InputUser> = InputPrivacyRule;
+inputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;
+inputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;
+inputPrivacyValueDisallowUsers#90110467 users:Vector<InputUser> = InputPrivacyRule;
+inputPrivacyValueAllowChatParticipants#840649cf chats:Vector<long> = InputPrivacyRule;
+inputPrivacyValueDisallowChatParticipants#e94f0f86 chats:Vector<long> = InputPrivacyRule;
+
+privacyValueAllowContacts#fffe1bac = PrivacyRule;
+privacyValueAllowAll#65427b82 = PrivacyRule;
+privacyValueAllowUsers#b8905fb2 users:Vector<long> = PrivacyRule;
+privacyValueDisallowContacts#f888fa1a = PrivacyRule;
+privacyValueDisallowAll#8b73e763 = PrivacyRule;
+privacyValueDisallowUsers#e4621141 users:Vector<long> = PrivacyRule;
+privacyValueAllowChatParticipants#6b134e8e chats:Vector<long> = PrivacyRule;
+privacyValueDisallowChatParticipants#41c87565 chats:Vector<long> = PrivacyRule;
+
+account.privacyRules#50a04e45 rules:Vector<PrivacyRule> chats:Vector<Chat> users:Vector<User> = account.PrivacyRules;
+
+accountDaysTTL#b8d0afdf days:int = AccountDaysTTL;
+
+documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
+documentAttributeAnimated#11b58939 = DocumentAttribute;
+documentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;
+documentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true supports_streaming:flags.1?true duration:int w:int h:int = DocumentAttribute;
+documentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;
+documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
+documentAttributeHasStickers#9801d2f7 = DocumentAttribute;
+
+messages.stickersNotModified#f1749a22 = messages.Stickers;
+messages.stickers#30a6ec7e hash:long stickers:Vector<Document> = messages.Stickers;
+
+stickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;
+
+messages.allStickersNotModified#e86602c3 = messages.AllStickers;
+messages.allStickers#cdbbcebb hash:long sets:Vector<StickerSet> = messages.AllStickers;
+
+messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;
+
+webPageEmpty#eb1477e8 id:long = WebPage;
+webPagePending#c586da1c id:long date:int = WebPage;
+webPage#e89c45b2 flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector<WebPageAttribute> = WebPage;
+webPageNotModified#7311ca11 flags:# cached_page_views:flags.0?int = WebPage;
+
+authorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true encrypted_requests_disabled:flags.3?true call_requests_disabled:flags.4?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;
+
+account.authorizations#1250abde authorizations:Vector<Authorization> = account.Authorizations;
+
+account.password#185b184f 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 pending_reset_date:flags.5?int = account.Password;
+
+account.passwordSettings#9a5c33e5 flags:# email:flags.0?string secure_settings:flags.1?SecureSecretSettings = account.PasswordSettings;
+
+account.passwordInputSettings#c23727c9 flags:# new_algo:flags.0?PasswordKdfAlgo new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string new_secure_settings:flags.2?SecureSecretSettings = account.PasswordInputSettings;
+
+auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;
+
+receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;
+
+chatInviteExported#b18105e8 flags:# revoked:flags.0?true permanent:flags.5?true link:string admin_id:long date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int = ExportedChatInvite;
+
+chatInviteAlready#5a686d7c chat:Chat = ChatInvite;
+chatInvite#dfc2f58e flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true title:string photo:Photo participants_count:int participants:flags.4?Vector<User> = ChatInvite;
+chatInvitePeek#61695cb0 chat:Chat expires:int = ChatInvite;
+
+inputStickerSetEmpty#ffb62b95 = InputStickerSet;
+inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;
+inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
+inputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;
+inputStickerSetDice#e67f520e emoticon:string = InputStickerSet;
+inputStickerSetAnimatedEmojiAnimations#cde3739 = InputStickerSet;
+
+stickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true videos:flags.6?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet;
+
+messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
+
+botCommand#c27ac8c7 command:string description:string = BotCommand;
+
+botInfo#1b74b335 user_id:long description:string commands:Vector<BotCommand> = BotInfo;
+
+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#86b40b08 flags:# single_use:flags.1?true selective:flags.2?true placeholder:flags.3?string = ReplyMarkup;
+replyKeyboardMarkup#85dd99d1 flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector<KeyboardButtonRow> placeholder:flags.3?string = ReplyMarkup;
+replyInlineMarkup#48a30254 rows:Vector<KeyboardButtonRow> = ReplyMarkup;
+
+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;
+messageEntityMentionName#dc7b1140 offset:int length:int user_id:long = MessageEntity;
+inputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity;
+messageEntityPhone#9b69e34b offset:int length:int = MessageEntity;
+messageEntityCashtag#4c4e743f offset:int length:int = MessageEntity;
+messageEntityUnderline#9c4e7e8b offset:int length:int = MessageEntity;
+messageEntityStrike#bf0693d4 offset:int length:int = MessageEntity;
+messageEntityBlockquote#20df5d0 offset:int length:int = MessageEntity;
+messageEntityBankCard#761e6af4 offset:int length:int = MessageEntity;
+
+inputChannelEmpty#ee8c1e86 = InputChannel;
+inputChannel#f35aec28 channel_id:long access_hash:long = InputChannel;
+inputChannelFromMessage#5b934f9d peer:InputPeer msg_id:int channel_id:long = InputChannel;
+
+contacts.resolvedPeer#7f077ad9 peer:Peer chats:Vector<Chat> users:Vector<User> = contacts.ResolvedPeer;
+
+messageRange#ae30253 min_id:int max_id:int = MessageRange;
+
+updates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference;
+updates.channelDifferenceTooLong#a4bcc6fe flags:# final:flags.0?true timeout:flags.1?int dialog:Dialog messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;
+updates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:flags.1?int new_messages:Vector<Message> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;
+
+channelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter;
+channelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector<MessageRange> = ChannelMessagesFilter;
+
+channelParticipant#c00c07c0 user_id:long date:int = ChannelParticipant;
+channelParticipantSelf#28a8bc67 user_id:long inviter_id:long date:int = ChannelParticipant;
+channelParticipantCreator#2fe601d3 flags:# user_id:long admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant;
+channelParticipantAdmin#34c3bb53 flags:# can_edit:flags.0?true self:flags.1?true user_id:long inviter_id:flags.1?long promoted_by:long date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant;
+channelParticipantBanned#6df8014e flags:# left:flags.0?true peer:Peer kicked_by:long date:int banned_rights:ChatBannedRights = ChannelParticipant;
+channelParticipantLeft#1b03f006 peer:Peer = ChannelParticipant;
+
+channelParticipantsRecent#de3f3c79 = ChannelParticipantsFilter;
+channelParticipantsAdmins#b4608969 = ChannelParticipantsFilter;
+channelParticipantsKicked#a3b54985 q:string = ChannelParticipantsFilter;
+channelParticipantsBots#b0d1865b = ChannelParticipantsFilter;
+channelParticipantsBanned#1427a5e1 q:string = ChannelParticipantsFilter;
+channelParticipantsSearch#656ac4b q:string = ChannelParticipantsFilter;
+channelParticipantsContacts#bb6ae88d q:string = ChannelParticipantsFilter;
+channelParticipantsMentions#e04b5ceb flags:# q:flags.0?string top_msg_id:flags.1?int = ChannelParticipantsFilter;
+
+channels.channelParticipants#9ab0feaf count:int participants:Vector<ChannelParticipant> chats:Vector<Chat> users:Vector<User> = channels.ChannelParticipants;
+channels.channelParticipantsNotModified#f0173fe9 = channels.ChannelParticipants;
+
+channels.channelParticipant#dfb80317 participant:ChannelParticipant chats:Vector<Chat> users:Vector<User> = channels.ChannelParticipant;
+
+help.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector<MessageEntity> min_age_confirm:flags.1?int = help.TermsOfService;
+
+messages.savedGifsNotModified#e8025ca2 = messages.SavedGifs;
+messages.savedGifs#84a02a0d hash:long gifs:Vector<Document> = messages.SavedGifs;
+
+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;
+inputBotInlineMessageMediaInvoice#d7e78225 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON 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;
+
+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;
+botInlineMessageMediaInvoice#354a9b09 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument currency:string total_amount:long 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;
+
+exportedMessageLink#5dab1af4 link:string html:string = ExportedMessageLink;
+
+messageFwdHeader#5f777dce flags:# imported:flags.7?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader;
+
+auth.codeTypeSms#72a3158c = auth.CodeType;
+auth.codeTypeCall#741cd3e3 = auth.CodeType;
+auth.codeTypeFlashCall#226ccefb = auth.CodeType;
+
+auth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType;
+auth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType;
+auth.sentCodeTypeCall#5353e5a7 length:int = auth.SentCodeType;
+auth.sentCodeTypeFlashCall#ab03c6d9 pattern:string = auth.SentCodeType;
+
+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;
+
+messages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.MessageEditData;
+
+inputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;
+inputBotInlineMessageID64#b6d915d7 dc_id:int owner_id:long id:int access_hash:long = InputBotInlineMessageID;
+
+inlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM;
+
+messages.peerDialogs#3371c354 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> state:updates.State = messages.PeerDialogs;
+
+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;
+
+draftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage;
+draftMessage#fd8e711f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int message:string entities:flags.3?Vector<MessageEntity> date:int = DraftMessage;
+
+messages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers;
+messages.featuredStickers#84c02310 hash:long count:int sets:Vector<StickerSetCovered> unread:Vector<long> = messages.FeaturedStickers;
+
+messages.recentStickersNotModified#b17f890 = messages.RecentStickers;
+messages.recentStickers#88d37c56 hash:long packs:Vector<StickerPack> stickers:Vector<Document> dates:Vector<int> = messages.RecentStickers;
+
+messages.archivedStickers#4fcba9c8 count:int sets:Vector<StickerSetCovered> = messages.ArchivedStickers;
+
+messages.stickerSetInstallResultSuccess#38641628 = messages.StickerSetInstallResult;
+messages.stickerSetInstallResultArchive#35e410a8 sets:Vector<StickerSetCovered> = messages.StickerSetInstallResult;
+
+stickerSetCovered#6410a5d2 set:StickerSet cover:Document = StickerSetCovered;
+stickerSetMultiCovered#3407e51b set:StickerSet covers:Vector<Document> = StickerSetCovered;
+
+maskCoords#aed6dbb2 n:int x:double y:double zoom:double = MaskCoords;
+
+inputStickeredMediaPhoto#4a992157 id:InputPhoto = InputStickeredMedia;
+inputStickeredMediaDocument#438865b id:InputDocument = InputStickeredMedia;
+
+game#bdf9653b flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document = Game;
+
+inputGameID#32c3e77 id:long access_hash:long = InputGame;
+inputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame;
+
+highScore#73a379eb pos:int user_id:long score:int = HighScore;
+
+messages.highScores#9a3bfd99 scores:Vector<HighScore> users:Vector<User> = messages.HighScores;
+
+textEmpty#dc3d824f = RichText;
+textPlain#744694e0 text:string = RichText;
+textBold#6724abc4 text:RichText = RichText;
+textItalic#d912a59c text:RichText = RichText;
+textUnderline#c12622c4 text:RichText = RichText;
+textStrike#9bf8bb95 text:RichText = RichText;
+textFixed#6c3f19b9 text:RichText = RichText;
+textUrl#3c2884c1 text:RichText url:string webpage_id:long = RichText;
+textEmail#de5a0dd6 text:RichText email:string = RichText;
+textConcat#7e6260d7 texts:Vector<RichText> = RichText;
+textSubscript#ed6a8504 text:RichText = RichText;
+textSuperscript#c7fb5e01 text:RichText = RichText;
+textMarked#34b8621 text:RichText = RichText;
+textPhone#1ccb966a text:RichText phone:string = RichText;
+textImage#81ccf4f document_id:long w:int h:int = RichText;
+textAnchor#35553762 text:RichText name:string = RichText;
+
+pageBlockUnsupported#13567e8a = PageBlock;
+pageBlockTitle#70abc3fd text:RichText = PageBlock;
+pageBlockSubtitle#8ffa9a1f text:RichText = PageBlock;
+pageBlockAuthorDate#baafe5e0 author:RichText published_date:int = PageBlock;
+pageBlockHeader#bfd064ec text:RichText = PageBlock;
+pageBlockSubheader#f12bb6e1 text:RichText = PageBlock;
+pageBlockParagraph#467a0766 text:RichText = PageBlock;
+pageBlockPreformatted#c070d93e text:RichText language:string = PageBlock;
+pageBlockFooter#48870999 text:RichText = PageBlock;
+pageBlockDivider#db20b188 = PageBlock;
+pageBlockAnchor#ce0d37b0 name:string = PageBlock;
+pageBlockList#e4e88011 items:Vector<PageListItem> = PageBlock;
+pageBlockBlockquote#263d7c26 text:RichText caption:RichText = PageBlock;
+pageBlockPullquote#4f4456d3 text:RichText caption:RichText = PageBlock;
+pageBlockPhoto#1759c560 flags:# photo_id:long caption:PageCaption url:flags.0?string webpage_id:flags.0?long = PageBlock;
+pageBlockVideo#7c8fe7b6 flags:# autoplay:flags.0?true loop:flags.1?true video_id:long caption:PageCaption = PageBlock;
+pageBlockCover#39f23300 cover:PageBlock = PageBlock;
+pageBlockEmbed#a8718dc5 flags:# full_width:flags.0?true allow_scrolling:flags.3?true url:flags.1?string html:flags.2?string poster_photo_id:flags.4?long w:flags.5?int h:flags.5?int caption:PageCaption = PageBlock;
+pageBlockEmbedPost#f259a80b url:string webpage_id:long author_photo_id:long author:string date:int blocks:Vector<PageBlock> caption:PageCaption = PageBlock;
+pageBlockCollage#65a0fa4d items:Vector<PageBlock> caption:PageCaption = PageBlock;
+pageBlockSlideshow#31f9590 items:Vector<PageBlock> caption:PageCaption = PageBlock;
+pageBlockChannel#ef1751b5 channel:Chat = PageBlock;
+pageBlockAudio#804361ea audio_id:long caption:PageCaption = PageBlock;
+pageBlockKicker#1e148390 text:RichText = PageBlock;
+pageBlockTable#bf4dea82 flags:# bordered:flags.0?true striped:flags.1?true title:RichText rows:Vector<PageTableRow> = PageBlock;
+pageBlockOrderedList#9a8ae1e1 items:Vector<PageListOrderedItem> = PageBlock;
+pageBlockDetails#76768bed flags:# open:flags.0?true blocks:Vector<PageBlock> title:RichText = PageBlock;
+pageBlockRelatedArticles#16115a96 title:RichText articles:Vector<PageRelatedArticle> = PageBlock;
+pageBlockMap#a44f3ef6 geo:GeoPoint zoom:int w:int h:int caption:PageCaption = PageBlock;
+
+phoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason;
+phoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason;
+phoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason;
+phoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason;
+
+dataJSON#7d748d04 data:string = DataJSON;
+
+labeledPrice#cb296bf8 label:string amount:long = LabeledPrice;
+
+invoice#cd886e0 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true currency:string prices:Vector<LabeledPrice> max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector<long> = Invoice;
+
+paymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;
+
+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;
+
+paymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;
+
+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;
+
+inputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = InputWebDocument;
+
+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;
+
+upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;
+
+payments.paymentForm#1694761b flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
+
+payments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = payments.ValidatedRequestedInfo;
+
+payments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;
+payments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult;
+
+payments.paymentReceipt#70c4fe03 flags:# date:int bot_id:long provider_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector<User> = payments.PaymentReceipt;
+
+payments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;
+
+inputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;
+inputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;
+inputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;
+inputPaymentCredentialsGooglePay#8ac32801 payment_token:DataJSON = InputPaymentCredentials;
+
+account.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;
+
+shippingOption#b6213cdf id:string title:string prices:Vector<LabeledPrice> = ShippingOption;
+
+inputStickerSetItem#ffa0a496 flags:# document:InputDocument emoji:string mask_coords:flags.0?MaskCoords = InputStickerSetItem;
+
+inputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall;
+
+phoneCallEmpty#5366c915 id:long = PhoneCall;
+phoneCallWaiting#c5226f17 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;
+phoneCallRequested#14b0ed0c flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;
+phoneCallAccepted#3660c311 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol = PhoneCall;
+phoneCall#967f7c67 flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector<PhoneConnection> start_date:int = PhoneCall;
+phoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;
+
+phoneConnection#9d4c17c0 id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection;
+phoneConnectionWebrtc#635fe375 flags:# turn:flags.0?true stun:flags.1?true id:long ip:string ipv6:string port:int username:string password:string = PhoneConnection;
+
+phoneCallProtocol#fc878fc8 flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int library_versions:Vector<string> = PhoneCallProtocol;
+
+phone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector<User> = phone.PhoneCall;
+
+upload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile;
+upload.cdnFile#a99fca4f bytes:bytes = upload.CdnFile;
+
+cdnPublicKey#c982eaba dc_id:int public_key:string = CdnPublicKey;
+
+cdnConfig#5725e40a public_keys:Vector<CdnPublicKey> = CdnConfig;
+
+langPackString#cad181f6 key:string value:string = LangPackString;
+langPackStringPluralized#6c47ac9f flags:# key:string zero_value:flags.0?string one_value:flags.1?string two_value:flags.2?string few_value:flags.3?string many_value:flags.4?string other_value:string = LangPackString;
+langPackStringDeleted#2979eeb2 key:string = LangPackString;
+
+langPackDifference#f385c1f6 lang_code:string from_version:int version:int strings:Vector<LangPackString> = LangPackDifference;
+
+langPackLanguage#eeca5ce3 flags:# official:flags.0?true rtl:flags.2?true beta:flags.3?true name:string native_name:string lang_code:string base_lang_code:flags.1?string plural_code:string strings_count:int translated_count:int translations_url:string = LangPackLanguage;
+
+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#50c7ac8 prev_value:long new_value:long = ChannelAdminLogEventAction;
+channelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction;
+channelAdminLogEventActionToggleSlowMode#53909779 prev_value:int new_value:int = ChannelAdminLogEventAction;
+channelAdminLogEventActionStartGroupCall#23209745 call:InputGroupCall = ChannelAdminLogEventAction;
+channelAdminLogEventActionDiscardGroupCall#db9f9140 call:InputGroupCall = ChannelAdminLogEventAction;
+channelAdminLogEventActionParticipantMute#f92424d2 participant:GroupCallParticipant = ChannelAdminLogEventAction;
+channelAdminLogEventActionParticipantUnmute#e64429c0 participant:GroupCallParticipant = ChannelAdminLogEventAction;
+channelAdminLogEventActionToggleGroupCallSetting#56d6a247 join_muted:Bool = ChannelAdminLogEventAction;
+channelAdminLogEventActionParticipantJoinByInvite#5cdada77 invite:ExportedChatInvite = ChannelAdminLogEventAction;
+channelAdminLogEventActionExportedInviteDelete#5a50fca4 invite:ExportedChatInvite = ChannelAdminLogEventAction;
+channelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvite = ChannelAdminLogEventAction;
+channelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction;
+channelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction;
+channelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction;
+
+channelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent;
+
+channels.adminLogResults#ed8af74d events:Vector<ChannelAdminLogEvent> chats:Vector<Chat> users:Vector<User> = channels.AdminLogResults;
+
+channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true send:flags.16?true = ChannelAdminLogEventsFilter;
+
+popularContact#5ce14175 client_id:long importers:int = PopularContact;
+
+messages.favedStickersNotModified#9e8fa6d3 = messages.FavedStickers;
+messages.favedStickers#2cb51097 hash:long packs:Vector<StickerPack> stickers:Vector<Document> = messages.FavedStickers;
+
+recentMeUrlUnknown#46e1d13d url:string = RecentMeUrl;
+recentMeUrlUser#b92c09e2 url:string user_id:long = RecentMeUrl;
+recentMeUrlChat#b2da71d2 url:string chat_id:long = RecentMeUrl;
+recentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl;
+recentMeUrlStickerSet#bc0a57dc url:string set:StickerSetCovered = RecentMeUrl;
+
+help.recentMeUrls#e0310d7 urls:Vector<RecentMeUrl> chats:Vector<Chat> users:Vector<User> = help.RecentMeUrls;
+
+inputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector<MessageEntity> = InputSingleMedia;
+
+webAuthorization#a6f8f452 hash:long bot_id:long domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization;
+
+account.webAuthorizations#ed56c9fc authorizations:Vector<WebAuthorization> users:Vector<User> = account.WebAuthorizations;
+
+inputMessageID#a676a322 id:int = InputMessage;
+inputMessageReplyTo#bad88395 id:int = InputMessage;
+inputMessagePinned#86872538 = InputMessage;
+inputMessageCallbackQuery#acfa1a7e id:int query_id:long = InputMessage;
+
+inputDialogPeer#fcaafeb7 peer:InputPeer = InputDialogPeer;
+inputDialogPeerFolder#64600527 folder_id:int = InputDialogPeer;
+
+dialogPeer#e56dbf05 peer:Peer = DialogPeer;
+dialogPeerFolder#514519e2 folder_id:int = DialogPeer;
+
+messages.foundStickerSetsNotModified#d54b65d = messages.FoundStickerSets;
+messages.foundStickerSets#8af09dd2 hash:long sets:Vector<StickerSetCovered> = messages.FoundStickerSets;
+
+fileHash#6242c773 offset:int limit:int hash:bytes = FileHash;
+
+inputClientProxy#75588b3f address:string port:int = InputClientProxy;
+
+help.termsOfServiceUpdateEmpty#e3309f7f expires:int = help.TermsOfServiceUpdate;
+help.termsOfServiceUpdate#28ecf961 expires:int terms_of_service:help.TermsOfService = help.TermsOfServiceUpdate;
+
+inputSecureFileUploaded#3334b0f0 id:long parts:int md5_checksum:string file_hash:bytes secret:bytes = InputSecureFile;
+inputSecureFile#5367e5be id:long access_hash:long = InputSecureFile;
+
+secureFileEmpty#64199744 = SecureFile;
+secureFile#e0277a62 id:long access_hash:long size:int dc_id:int date:int file_hash:bytes secret:bytes = SecureFile;
+
+secureData#8aeabec3 data:bytes data_hash:bytes secret:bytes = SecureData;
+
+securePlainPhone#7d6099dd phone:string = SecurePlainData;
+securePlainEmail#21ec5a5f email:string = SecurePlainData;
+
+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;
+
+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;
+
+secureValueHash#ed1ecdb0 type:SecureValueType hash:bytes = SecureValueHash;
+
+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;
+
+secureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted;
+
+account.authorizationForm#ad2e1cd8 flags:# required_types:Vector<SecureRequiredType> values:Vector<SecureValue> errors:Vector<SecureValueError> users:Vector<User> privacy_policy_url:flags.0?string = account.AuthorizationForm;
+
+account.sentEmailCode#811f854f email_pattern:string length:int = account.SentEmailCode;
+
+help.deepLinkInfoEmpty#66afa166 = help.DeepLinkInfo;
+help.deepLinkInfo#6a4ee832 flags:# update_app:flags.0?true message:string entities:flags.1?Vector<MessageEntity> = help.DeepLinkInfo;
+
+savedPhoneContact#1142bd56 phone:string first_name:string last_name:string date:int = SavedContact;
+
+account.takeout#4dba4501 id:long = account.Takeout;
+
+passwordKdfAlgoUnknown#d45ab096 = PasswordKdfAlgo;
+passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow#3a912d4a salt1:bytes salt2:bytes g:int p:bytes = PasswordKdfAlgo;
+
+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;
+
+inputCheckPasswordEmpty#9880f658 = InputCheckPasswordSRP;
+inputCheckPasswordSRP#d27ff082 srp_id:long A:bytes M1:bytes = InputCheckPasswordSRP;
+
+secureRequiredType#829d99da flags:# native_names:flags.0?true selfie_required:flags.1?true translation_required:flags.2?true type:SecureValueType = SecureRequiredType;
+secureRequiredTypeOneOf#27477b4 types:Vector<SecureRequiredType> = SecureRequiredType;
+
+help.passportConfigNotModified#bfb9f457 = help.PassportConfig;
+help.passportConfig#a098d6af hash:int countries_langs:DataJSON = help.PassportConfig;
+
+inputAppEvent#1d1b1245 time:double type:string peer:long data:JSONValue = InputAppEvent;
+
+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;
+
+pageTableCell#34566b6a flags:# header:flags.0?true align_center:flags.3?true align_right:flags.4?true valign_middle:flags.5?true valign_bottom:flags.6?true text:flags.7?RichText colspan:flags.1?int rowspan:flags.2?int = PageTableCell;
+
+pageTableRow#e0c0c5e5 cells:Vector<PageTableCell> = PageTableRow;
+
+pageCaption#6f747657 text:RichText credit:RichText = PageCaption;
+
+pageListItemText#b92fb6cd text:RichText = PageListItem;
+pageListItemBlocks#25e073fc blocks:Vector<PageBlock> = PageListItem;
+
+pageListOrderedItemText#5e068047 num:string text:RichText = PageListOrderedItem;
+pageListOrderedItemBlocks#98dd8936 num:string blocks:Vector<PageBlock> = PageListOrderedItem;
+
+pageRelatedArticle#b390dc08 flags:# url:string webpage_id:long title:flags.0?string description:flags.1?string photo_id:flags.2?long author:flags.3?string published_date:flags.4?int = PageRelatedArticle;
+
+page#98657f0d flags:# part:flags.0?true rtl:flags.1?true v2:flags.2?true url:string blocks:Vector<PageBlock> photos:Vector<Photo> documents:Vector<Document> views:flags.3?int = Page;
+
+help.supportName#8c05f1c9 name:string = help.SupportName;
+
+help.userInfoEmpty#f3ae2eed = help.UserInfo;
+help.userInfo#1eb3758 message:string entities:Vector<MessageEntity> author:string date:int = help.UserInfo;
+
+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;
+
+pollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters;
+
+pollResults#dcb82ea3 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<long> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults;
+
+chatOnlines#f041e250 onlines:int = ChatOnlines;
+
+statsURL#47a971e0 url:string = StatsURL;
+
+chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true = ChatAdminRights;
+
+chatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true until_date:int = ChatBannedRights;
+
+inputWallPaper#e630b979 id:long access_hash:long = InputWallPaper;
+inputWallPaperSlug#72091c80 slug:string = InputWallPaper;
+inputWallPaperNoFile#967a462e id:long = InputWallPaper;
+
+account.wallPapersNotModified#1c199183 = account.WallPapers;
+account.wallPapers#cdc3858c hash:long wallpapers:Vector<WallPaper> = account.WallPapers;
+
+codeSettings#debebe83 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true = CodeSettings;
+
+wallPaperSettings#1dc1bca4 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int third_background_color:flags.5?int fourth_background_color:flags.6?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings;
+
+autoDownloadSettings#e04232f3 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true photo_size_max:int video_size_max:int file_size_max:int video_upload_maxbitrate:int = AutoDownloadSettings;
+
+account.autoDownloadSettings#63cacf26 low:AutoDownloadSettings medium:AutoDownloadSettings high:AutoDownloadSettings = account.AutoDownloadSettings;
+
+emojiKeyword#d5b3b9f9 keyword:string emoticons:Vector<string> = EmojiKeyword;
+emojiKeywordDeleted#236df622 keyword:string emoticons:Vector<string> = EmojiKeyword;
+
+emojiKeywordsDifference#5cc761bd lang_code:string from_version:int version:int keywords:Vector<EmojiKeyword> = EmojiKeywordsDifference;
+
+emojiURL#a575739d url:string = EmojiURL;
+
+emojiLanguage#b3fb5361 lang_code:string = EmojiLanguage;
+
+folder#ff544e65 flags:# autofill_new_broadcasts:flags.0?true autofill_public_groups:flags.1?true autofill_new_correspondents:flags.2?true id:int title:string photo:flags.3?ChatPhoto = Folder;
+
+inputFolderPeer#fbd2c296 peer:InputPeer folder_id:int = InputFolderPeer;
+
+folderPeer#e9baa668 peer:Peer folder_id:int = FolderPeer;
+
+messages.searchCounter#e844ebff flags:# inexact:flags.1?true filter:MessagesFilter count:int = messages.SearchCounter;
+
+urlAuthResultRequest#92d33a0e flags:# request_write_access:flags.0?true bot:User domain:string = UrlAuthResult;
+urlAuthResultAccepted#8f8c0e4e url:string = UrlAuthResult;
+urlAuthResultDefault#a9d6db1f = UrlAuthResult;
+
+channelLocationEmpty#bfb5ad8b = ChannelLocation;
+channelLocation#209b82db geo_point:GeoPoint address:string = ChannelLocation;
+
+peerLocated#ca461b5d peer:Peer expires:int distance:int = PeerLocated;
+peerSelfLocated#f8ec284b expires:int = PeerLocated;
+
+restrictionReason#d072acb4 platform:string reason:string text:string = RestrictionReason;
+
+inputTheme#3c5693e9 id:long access_hash:long = InputTheme;
+inputThemeSlug#f5890df1 slug:string = InputTheme;
+
+theme#e802b8dc flags:# creator:flags.0?true default:flags.1?true for_chat:flags.5?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?ThemeSettings installs_count:flags.4?int = Theme;
+
+account.themesNotModified#f41eb622 = account.Themes;
+account.themes#9a3d8c6d hash:long themes:Vector<Theme> = account.Themes;
+
+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;
+
+account.contentSettings#57e28221 flags:# sensitive_enabled:flags.0?true sensitive_can_change:flags.1?true = account.ContentSettings;
+
+messages.inactiveChats#a927fec5 dates:Vector<int> chats:Vector<Chat> users:Vector<User> = messages.InactiveChats;
+
+baseThemeClassic#c3a12462 = BaseTheme;
+baseThemeDay#fbd81688 = BaseTheme;
+baseThemeNight#b7b31ea8 = BaseTheme;
+baseThemeTinted#6d5f77ee = BaseTheme;
+baseThemeArctic#5b11125a = BaseTheme;
+
+inputThemeSettings#8fde504f flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector<int> wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings;
+
+themeSettings#fa58b6d4 flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector<int> wallpaper:flags.1?WallPaper = ThemeSettings;
+
+webPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector<Document> settings:flags.1?ThemeSettings = WebPageAttribute;
+
+messageUserVote#34d247b4 user_id:long option:bytes date:int = MessageUserVote;
+messageUserVoteInputOption#3ca5b0ec user_id:long date:int = MessageUserVote;
+messageUserVoteMultiple#8a65e557 user_id:long options:Vector<bytes> date:int = MessageUserVote;
+
+messages.votesList#823f649 flags:# count:int votes:Vector<MessageUserVote> users:Vector<User> next_offset:flags.0?string = messages.VotesList;
+
+bankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl;
+
+payments.bankCardData#3e24e573 title:string open_urls:Vector<BankCardOpenUrl> = payments.BankCardData;
+
+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;
+
+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;
+
+help.promoDataEmpty#98f6ac75 expires:int = help.PromoData;
+help.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector<Chat> users:Vector<User> psa_type:flags.1?string psa_message:flags.2?string = help.PromoData;
+
+videoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize;
+
+statsGroupTopPoster#9d04af9b user_id:long messages:int avg_chars:int = StatsGroupTopPoster;
+
+statsGroupTopAdmin#d7584c87 user_id:long deleted:int kicked:int banned:int = StatsGroupTopAdmin;
+
+statsGroupTopInviter#535f779d user_id:long invitations:int = StatsGroupTopInviter;
+
+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;
+
+globalPrivacySettings#bea2f424 flags:# archive_and_mute_new_noncontact_peers:flags.0?Bool = GlobalPrivacySettings;
+
+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;
+
+messageViews#455b853d flags:# views:flags.0?int forwards:flags.1?int replies:flags.2?MessageReplies = MessageViews;
+
+messages.messageViews#b6c4f543 views:Vector<MessageViews> chats:Vector<Chat> users:Vector<User> = messages.MessageViews;
+
+messages.discussionMessage#a6341782 flags:# messages:Vector<Message> max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int unread_count:int chats:Vector<Chat> users:Vector<User> = messages.DiscussionMessage;
+
+messageReplyHeader#a6d57763 flags:# reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader;
+
+messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;
+
+peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;
+
+stats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats;
+
+groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;
+groupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall;
+
+inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;
+
+groupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant;
+
+phone.groupCall#9e727aad call:GroupCall participants:Vector<GroupCallParticipant> participants_next_offset:string chats:Vector<Chat> users:Vector<User> = phone.GroupCall;
+
+phone.groupParticipants#f47751b6 count:int participants:Vector<GroupCallParticipant> next_offset:string chats:Vector<Chat> users:Vector<User> version:int = phone.GroupParticipants;
+
+inlineQueryPeerTypeSameBotPM#3081ed9d = InlineQueryPeerType;
+inlineQueryPeerTypePM#833c0fac = InlineQueryPeerType;
+inlineQueryPeerTypeChat#d766c50a = InlineQueryPeerType;
+inlineQueryPeerTypeMegagroup#5ec4be43 = InlineQueryPeerType;
+inlineQueryPeerTypeBroadcast#6334ee9a = InlineQueryPeerType;
+
+messages.historyImport#1662af0b id:long = messages.HistoryImport;
+
+messages.historyImportParsed#5e0fb7b9 flags:# pm:flags.0?true group:flags.1?true title:flags.2?string = messages.HistoryImportParsed;
+
+messages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector<int> = messages.AffectedFoundMessages;
+
+chatInviteImporter#b5cd5f4 user_id:long date:int = ChatInviteImporter;
+
+messages.exportedChatInvites#bdc62dcc count:int invites:Vector<ExportedChatInvite> users:Vector<User> = messages.ExportedChatInvites;
+
+messages.exportedChatInvite#1871be50 invite:ExportedChatInvite users:Vector<User> = messages.ExportedChatInvite;
+messages.exportedChatInviteReplaced#222600ef invite:ExportedChatInvite new_invite:ExportedChatInvite users:Vector<User> = messages.ExportedChatInvite;
+
+messages.chatInviteImporters#81b6b00a count:int importers:Vector<ChatInviteImporter> users:Vector<User> = messages.ChatInviteImporters;
+
+chatAdminWithInvites#f2ecef23 admin_id:long invites_count:int revoked_invites_count:int = ChatAdminWithInvites;
+
+messages.chatAdminsWithInvites#b69b72d7 admins:Vector<ChatAdminWithInvites> users:Vector<User> = messages.ChatAdminsWithInvites;
+
+messages.checkedHistoryImportPeer#a24de717 confirm_text:string = messages.CheckedHistoryImportPeer;
+
+phone.joinAsPeers#afe5623f peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = phone.JoinAsPeers;
+
+phone.exportedGroupCallInvite#204bd158 link:string = phone.ExportedGroupCallInvite;
+
+groupCallParticipantVideoSourceGroup#dcb118b7 semantics:string sources:Vector<int> = GroupCallParticipantVideoSourceGroup;
+
+groupCallParticipantVideo#67753ac8 flags:# paused:flags.0?true endpoint:string source_groups:Vector<GroupCallParticipantVideoSourceGroup> audio_source:flags.1?int = GroupCallParticipantVideo;
+
+stickers.suggestedShortName#85fea03f short_name:string = stickers.SuggestedShortName;
+
+botCommandScopeDefault#2f6cb2ab = BotCommandScope;
+botCommandScopeUsers#3c4f04d8 = BotCommandScope;
+botCommandScopeChats#6fe1a881 = BotCommandScope;
+botCommandScopeChatAdmins#b9aa606a = BotCommandScope;
+botCommandScopePeer#db9d897d peer:InputPeer = BotCommandScope;
+botCommandScopePeerAdmins#3fd863d1 peer:InputPeer = BotCommandScope;
+botCommandScopePeerUser#a1321f3 peer:InputPeer user_id:InputUser = BotCommandScope;
+
+account.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordResult;
+account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;
+account.resetPasswordOk#e926d63e = account.ResetPasswordResult;
+
+chatTheme#ed0b5c33 emoticon:string theme:Theme dark_theme:Theme = ChatTheme;
+
+account.chatThemesNotModified#e011e1c4 = account.ChatThemes;
+account.chatThemes#fe4cbebd hash:int themes:Vector<ChatTheme> = account.ChatThemes;
+
+sponsoredMessage#2a3c381f flags:# random_id:bytes from_id:Peer start_param:flags.0?string message:string entities:flags.1?Vector<MessageEntity> = SponsoredMessage;
+
+messages.sponsoredMessages#65a4c7d5 messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages;
+
+---functions---
+
+invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
+invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;
+initConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X;
+invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;
+invokeWithoutUpdates#bf9459b7 {X:Type} query:!X = X;
+invokeWithMessagesRange#365275f2 {X:Type} range:MessageRange query:!X = X;
+invokeWithTakeout#aca9fd2e {X:Type} takeout_id:long query:!X = X;
+
+auth.sendCode#a677244f phone_number:string api_id:int api_hash:string settings:CodeSettings = auth.SentCode;
+auth.signUp#80eee427 phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization;
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
+auth.logOut#5717da40 = Bool;
+auth.resetAuthorizations#9fab0d1a = Bool;
+auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
+auth.importAuthorization#a57a7dad id:long bytes:bytes = auth.Authorization;
+auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;
+auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization;
+auth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization;
+auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;
+auth.recoverPassword#37096c70 flags:# code:string new_settings:flags.0?account.PasswordInputSettings = auth.Authorization;
+auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode;
+auth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;
+auth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector<long> = Bool;
+auth.exportLoginToken#b7e085fe api_id:int api_hash:string except_ids:Vector<long> = auth.LoginToken;
+auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;
+auth.acceptLoginToken#e894ad4d token:bytes = Authorization;
+auth.checkRecoveryPassword#d36bf79 code:string = Bool;
+
+account.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<long> = Bool;
+account.unregisterDevice#6a0d3206 token_type:int token:string other_uids:Vector<long> = Bool;
+account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
+account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
+account.resetNotifySettings#db7e1747 = Bool;
+account.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User;
+account.updateStatus#6628562c offline:Bool = Bool;
+account.getWallPapers#7967d36 hash:long = account.WallPapers;
+account.reportPeer#c5ba3d86 peer:InputPeer reason:ReportReason message:string = Bool;
+account.checkUsername#2714d86c username:string = Bool;
+account.updateUsername#3e0bdd7c username:string = User;
+account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;
+account.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector<InputPrivacyRule> = account.PrivacyRules;
+account.deleteAccount#418d4e0b reason:string = Bool;
+account.getAccountTTL#8fc711d = AccountDaysTTL;
+account.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool;
+account.sendChangePhoneCode#82574ae5 phone_number:string settings:CodeSettings = auth.SentCode;
+account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User;
+account.updateDeviceLocked#38df3532 period:int = Bool;
+account.getAuthorizations#e320c158 = account.Authorizations;
+account.resetAuthorization#df77f3bc hash:long = Bool;
+account.getPassword#548a30f5 = account.Password;
+account.getPasswordSettings#9cd4eaf9 password:InputCheckPasswordSRP = account.PasswordSettings;
+account.updatePasswordSettings#a59b102f password:InputCheckPasswordSRP new_settings:account.PasswordInputSettings = Bool;
+account.sendConfirmPhoneCode#1b3faa88 hash:string settings:CodeSettings = auth.SentCode;
+account.confirmPhone#5f2178c3 phone_code_hash:string phone_code:string = Bool;
+account.getTmpPassword#449e0b51 password:InputCheckPasswordSRP period:int = account.TmpPassword;
+account.getWebAuthorizations#182e6d6f = account.WebAuthorizations;
+account.resetWebAuthorization#2d01b9ef hash:long = Bool;
+account.resetWebAuthorizations#682d2594 = Bool;
+account.getAllSecureValues#b288bc7d = Vector<SecureValue>;
+account.getSecureValue#73665bc2 types:Vector<SecureValueType> = Vector<SecureValue>;
+account.saveSecureValue#899fe31d value:InputSecureValue secure_secret_id:long = SecureValue;
+account.deleteSecureValue#b880bc4b types:Vector<SecureValueType> = Bool;
+account.getAuthorizationForm#a929597a bot_id:long scope:string public_key:string = account.AuthorizationForm;
+account.acceptAuthorization#f3ed4c73 bot_id:long scope:string public_key:string value_hashes:Vector<SecureValueHash> credentials:SecureCredentialsEncrypted = Bool;
+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;
+account.initTakeoutSession#f05b4804 flags:# contacts:flags.0?true message_users:flags.1?true message_chats:flags.2?true message_megagroups:flags.3?true message_channels:flags.4?true files:flags.5?true file_max_size:flags.5?int = account.Takeout;
+account.finishTakeoutSession#1d2652ee flags:# success:flags.0?true = Bool;
+account.confirmPasswordEmail#8fdf1920 code:string = Bool;
+account.resendPasswordEmail#7a7f2a15 = Bool;
+account.cancelPasswordEmail#c1cbd5b6 = Bool;
+account.getContactSignUpNotification#9f07c728 = Bool;
+account.setContactSignUpNotification#cff43f61 silent:Bool = Bool;
+account.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true peer:flags.0?InputNotifyPeer = Updates;
+account.getWallPaper#fc8ddbea wallpaper:InputWallPaper = WallPaper;
+account.uploadWallPaper#dd853661 file:InputFile mime_type:string settings:WallPaperSettings = WallPaper;
+account.saveWallPaper#6c5a5b37 wallpaper:InputWallPaper unsave:Bool settings:WallPaperSettings = Bool;
+account.installWallPaper#feed5769 wallpaper:InputWallPaper settings:WallPaperSettings = Bool;
+account.resetWallPapers#bb3b9804 = Bool;
+account.getAutoDownloadSettings#56da0b3f = account.AutoDownloadSettings;
+account.saveAutoDownloadSettings#76f36233 flags:# low:flags.0?true high:flags.1?true settings:AutoDownloadSettings = Bool;
+account.uploadTheme#1c3db333 flags:# file:InputFile thumb:flags.0?InputFile file_name:string mime_type:string = Document;
+account.createTheme#8432c21f flags:# slug:string title:string document:flags.2?InputDocument settings:flags.3?InputThemeSettings = Theme;
+account.updateTheme#5cb367d5 flags:# format:string theme:InputTheme slug:flags.0?string title:flags.1?string document:flags.2?InputDocument settings:flags.3?InputThemeSettings = Theme;
+account.saveTheme#f257106c theme:InputTheme unsave:Bool = Bool;
+account.installTheme#7ae43737 flags:# dark:flags.0?true format:flags.1?string theme:flags.1?InputTheme = Bool;
+account.getTheme#8d9d742b format:string theme:InputTheme document_id:long = Theme;
+account.getThemes#7206e458 format:string hash:long = account.Themes;
+account.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool;
+account.getContentSettings#8b9b4dae = account.ContentSettings;
+account.getMultiWallPapers#65ad71dc wallpapers:Vector<InputWallPaper> = Vector<WallPaper>;
+account.getGlobalPrivacySettings#eb2b4cf6 = GlobalPrivacySettings;
+account.setGlobalPrivacySettings#1edaaac2 settings:GlobalPrivacySettings = GlobalPrivacySettings;
+account.reportProfilePhoto#fa8cc6f5 peer:InputPeer photo_id:InputPhoto reason:ReportReason message:string = Bool;
+account.resetPassword#9308ce1b = account.ResetPasswordResult;
+account.declinePasswordReset#4c9409f6 = Bool;
+account.getChatThemes#d6d71d7b hash:int = account.ChatThemes;
+
+users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
+users.getFullUser#ca30a5b1 id:InputUser = UserFull;
+users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector<SecureValueError> = Bool;
+
+contacts.getContactIDs#7adc669d hash:long = Vector<int>;
+contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
+contacts.getContacts#5dd69e12 hash:long = contacts.Contacts;
+contacts.importContacts#2c800be5 contacts:Vector<InputContact> = contacts.ImportedContacts;
+contacts.deleteContacts#96a0e00 id:Vector<InputUser> = Updates;
+contacts.deleteByPhones#1013fd9e phones:Vector<string> = Bool;
+contacts.block#68cc1411 id:InputPeer = Bool;
+contacts.unblock#bea65d50 id:InputPeer = Bool;
+contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;
+contacts.search#11f812d8 q:string limit:int = contacts.Found;
+contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;
+contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:long = contacts.TopPeers;
+contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool;
+contacts.resetSaved#879537f1 = Bool;
+contacts.getSaved#82f1e39f = Vector<SavedContact>;
+contacts.toggleTopPeers#8514bdda enabled:Bool = Bool;
+contacts.addContact#e8f463d0 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string = Updates;
+contacts.acceptContact#f831a20f id:InputUser = Updates;
+contacts.getLocated#d348bc44 flags:# background:flags.1?true geo_point:InputGeoPoint self_expires:flags.0?int = Updates;
+contacts.blockFromReplies#29a8962c flags:# delete_message:flags.0?true delete_history:flags.1?true report_spam:flags.2?true msg_id:int = Updates;
+
+messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
+messages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs;
+messages.getHistory#4423e6c5 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
+messages.search#a0fda762 flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
+messages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;
+messages.deleteHistory#1c015b09 flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int = messages.AffectedHistory;
+messages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector<int> = messages.AffectedMessages;
+messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;
+messages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;
+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;
+messages.forwardMessages#d9fee60e flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer schedule_date:flags.10?int = Updates;
+messages.reportSpam#cf1592db peer:InputPeer = Bool;
+messages.getPeerSettings#3672e09c peer:InputPeer = PeerSettings;
+messages.report#8953ab4e peer:InputPeer id:Vector<int> reason:ReportReason message:string = Bool;
+messages.getChats#49e9528f id:Vector<long> = messages.Chats;
+messages.getFullChat#aeb00b34 chat_id:long = messages.ChatFull;
+messages.editChatTitle#73783ffd chat_id:long title:string = Updates;
+messages.editChatPhoto#35ddd674 chat_id:long photo:InputChatPhoto = Updates;
+messages.addChatUser#f24753e3 chat_id:long user_id:InputUser fwd_limit:int = Updates;
+messages.deleteChatUser#a2185cab flags:# revoke_history:flags.0?true chat_id:long user_id:InputUser = Updates;
+messages.createChat#9cb126e users:Vector<InputUser> title:string = Updates;
+messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
+messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
+messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
+messages.discardEncryption#f393aea0 flags:# delete_history:flags.0?true chat_id:int = Bool;
+messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;
+messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;
+messages.sendEncrypted#44fa7a15 flags:# silent:flags.0?true peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.sendEncryptedFile#5559481d flags:# silent:flags.0?true peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
+messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
+messages.reportEncryptedSpam#4b0c8c0f peer:InputEncryptedChat = Bool;
+messages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages;
+messages.getStickers#d5a5d3a1 emoticon:string hash:long = messages.Stickers;
+messages.getAllStickers#b8a0a1a8 hash:long = messages.AllStickers;
+messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector<MessageEntity> = MessageMedia;
+messages.exportChatInvite#14b9bcd7 flags:# legacy_revoke_permanent:flags.2?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int = ExportedChatInvite;
+messages.checkChatInvite#3eadb1bb hash:string = ChatInvite;
+messages.importChatInvite#6c50051c hash:string = Updates;
+messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;
+messages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = messages.StickerSetInstallResult;
+messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;
+messages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_param:string = Updates;
+messages.getMessagesViews#5784d3e1 peer:InputPeer id:Vector<int> increment:Bool = messages.MessageViews;
+messages.editChatAdmin#a85bd1c2 chat_id:long user_id:InputUser is_admin:Bool = Bool;
+messages.migrateChat#a2875319 chat_id:long = Updates;
+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;
+messages.reorderStickerSets#78337739 flags:# masks:flags.0?true order:Vector<long> = Bool;
+messages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document;
+messages.getSavedGifs#5cf09635 hash:long = messages.SavedGifs;
+messages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool;
+messages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults;
+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;
+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;
+messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData;
+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;
+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;
+messages.getBotCallbackAnswer#9342ca07 flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes password:flags.2?InputCheckPasswordSRP = messages.BotCallbackAnswer;
+messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long message:flags.0?string url:flags.2?string cache_time:int = Bool;
+messages.getPeerDialogs#e470bcfd peers:Vector<InputDialogPeer> = messages.PeerDialogs;
+messages.saveDraft#bc39e14b flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> = Bool;
+messages.getAllDrafts#6a3f8d65 = Updates;
+messages.getFeaturedStickers#64780b14 hash:long = messages.FeaturedStickers;
+messages.readFeaturedStickers#5b118126 id:Vector<long> = Bool;
+messages.getRecentStickers#9da9403b flags:# attached:flags.0?true hash:long = messages.RecentStickers;
+messages.saveRecentSticker#392718f8 flags:# attached:flags.0?true id:InputDocument unsave:Bool = Bool;
+messages.clearRecentStickers#8999602d flags:# attached:flags.0?true = Bool;
+messages.getArchivedStickers#57f17692 flags:# masks:flags.0?true offset_id:long limit:int = messages.ArchivedStickers;
+messages.getMaskStickers#640f82b8 hash:long = messages.AllStickers;
+messages.getAttachedStickers#cc5b67cc media:InputStickeredMedia = Vector<StickerSetCovered>;
+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;
+messages.getGameHighScores#e822649d peer:InputPeer id:int user_id:InputUser = messages.HighScores;
+messages.getInlineGameHighScores#f635e1b id:InputBotInlineMessageID user_id:InputUser = messages.HighScores;
+messages.getCommonChats#e40ca104 user_id:InputUser max_id:long limit:int = messages.Chats;
+messages.getAllChats#875f74be except_ids:Vector<long> = messages.Chats;
+messages.getWebPage#32ca8f91 url:string hash:int = WebPage;
+messages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;
+messages.reorderPinnedDialogs#3b1adf37 flags:# force:flags.0?true folder_id:int order:Vector<InputDialogPeer> = Bool;
+messages.getPinnedDialogs#d6b94df2 folder_id:int = messages.PeerDialogs;
+messages.setBotShippingResults#e5f672fa flags:# query_id:long error:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = Bool;
+messages.setBotPrecheckoutResults#9c2dd95 flags:# success:flags.1?true query_id:long error:flags.0?string = Bool;
+messages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia;
+messages.sendScreenshotNotification#c97df020 peer:InputPeer reply_to_msg_id:int random_id:long = Updates;
+messages.getFavedStickers#4f1aaa9 hash:long = messages.FavedStickers;
+messages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool;
+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;
+messages.getRecentLocations#702a40e0 peer:InputPeer limit:int hash:long = messages.Messages;
+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;
+messages.uploadEncryptedFile#5057c497 peer:InputEncryptedChat file:InputEncryptedFile = EncryptedFile;
+messages.searchStickerSets#35705b8a flags:# exclude_featured:flags.0?true q:string hash:long = messages.FoundStickerSets;
+messages.getSplitRanges#1cff7e08 = Vector<MessageRange>;
+messages.markDialogUnread#c286d98f flags:# unread:flags.0?true peer:InputDialogPeer = Bool;
+messages.getDialogUnreadMarks#22e24e22 = Vector<DialogPeer>;
+messages.clearAllDrafts#7e58ee9c = Bool;
+messages.updatePinnedMessage#d2aaf7ec flags:# silent:flags.0?true unpin:flags.1?true pm_oneside:flags.2?true peer:InputPeer id:int = Updates;
+messages.sendVote#10ea6184 peer:InputPeer msg_id:int options:Vector<bytes> = Updates;
+messages.getPollResults#73bb643b peer:InputPeer msg_id:int = Updates;
+messages.getOnlines#6e2be050 peer:InputPeer = ChatOnlines;
+messages.editChatAbout#def60797 peer:InputPeer about:string = Bool;
+messages.editChatDefaultBannedRights#a5866b41 peer:InputPeer banned_rights:ChatBannedRights = Updates;
+messages.getEmojiKeywords#35a0e062 lang_code:string = EmojiKeywordsDifference;
+messages.getEmojiKeywordsDifference#1508b6af lang_code:string from_version:int = EmojiKeywordsDifference;
+messages.getEmojiKeywordsLanguages#4e9963b2 lang_codes:Vector<string> = Vector<EmojiLanguage>;
+messages.getEmojiURL#d5b10c26 lang_code:string = EmojiURL;
+messages.getSearchCounters#732eef00 peer:InputPeer filters:Vector<MessagesFilter> = Vector<messages.SearchCounter>;
+messages.requestUrlAuth#198fb446 flags:# peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult;
+messages.acceptUrlAuth#b12c7125 flags:# write_allowed:flags.0?true peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult;
+messages.hidePeerSettingsBar#4facb138 peer:InputPeer = Bool;
+messages.getScheduledHistory#f516760b peer:InputPeer hash:long = messages.Messages;
+messages.getScheduledMessages#bdbb0464 peer:InputPeer id:Vector<int> = messages.Messages;
+messages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector<int> = Updates;
+messages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector<int> = Updates;
+messages.getPollVotes#b86e380e flags:# peer:InputPeer id:int option:flags.0?bytes offset:flags.1?string limit:int = messages.VotesList;
+messages.toggleStickerSets#b5052fea flags:# uninstall:flags.0?true archive:flags.1?true unarchive:flags.2?true stickersets:Vector<InputStickerSet> = Bool;
+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;
+messages.getOldFeaturedStickers#7ed094a1 offset:int limit:int hash:long = messages.FeaturedStickers;
+messages.getReplies#22ddd30c peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
+messages.getDiscussionMessage#446972fd peer:InputPeer msg_id:int = messages.DiscussionMessage;
+messages.readDiscussion#f731a9f4 peer:InputPeer msg_id:int read_max_id:int = Bool;
+messages.unpinAllMessages#f025bc8b peer:InputPeer = messages.AffectedHistory;
+messages.deleteChat#5bd0ee50 chat_id:long = Bool;
+messages.deletePhoneCallHistory#f9cbe409 flags:# revoke:flags.0?true = messages.AffectedFoundMessages;
+messages.checkHistoryImport#43fe19f3 import_head:string = messages.HistoryImportParsed;
+messages.initHistoryImport#34090c3b peer:InputPeer file:InputFile media_count:int = messages.HistoryImport;
+messages.uploadImportedMedia#2a862092 peer:InputPeer import_id:long file_name:string media:InputMedia = MessageMedia;
+messages.startHistoryImport#b43df344 peer:InputPeer import_id:long = Bool;
+messages.getExportedChatInvites#a2b5a3f6 flags:# revoked:flags.3?true peer:InputPeer admin_id:InputUser offset_date:flags.2?int offset_link:flags.2?string limit:int = messages.ExportedChatInvites;
+messages.getExportedChatInvite#73746f5c peer:InputPeer link:string = messages.ExportedChatInvite;
+messages.editExportedChatInvite#2e4ffbe flags:# revoked:flags.2?true peer:InputPeer link:string expire_date:flags.0?int usage_limit:flags.1?int = messages.ExportedChatInvite;
+messages.deleteRevokedExportedChatInvites#56987bd5 peer:InputPeer admin_id:InputUser = Bool;
+messages.deleteExportedChatInvite#d464a42b peer:InputPeer link:string = Bool;
+messages.getAdminsWithInvites#3920e6ef peer:InputPeer = messages.ChatAdminsWithInvites;
+messages.getChatInviteImporters#26fb7289 peer:InputPeer link:string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters;
+messages.setHistoryTTL#b80e5fe4 peer:InputPeer period:int = Updates;
+messages.checkHistoryImportPeer#5dc60f03 peer:InputPeer = messages.CheckedHistoryImportPeer;
+messages.setChatTheme#e63be13f peer:InputPeer emoticon:string = Updates;
+messages.getMessageReadParticipants#2c6f97b7 peer:InputPeer msg_id:int = Vector<long>;
+
+updates.getState#edd4882a = updates.State;
+updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;
+updates.getChannelDifference#3173d78 flags:# force:flags.0?true channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference;
+
+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;
+photos.deletePhotos#87cf7f2f id:Vector<InputPhoto> = Vector<long>;
+photos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos;
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+upload.getFile#b15a9afc flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:int limit:int = upload.File;
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
+upload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;
+upload.getCdnFile#2000bcc3 file_token:bytes offset:int limit:int = upload.CdnFile;
+upload.reuploadCdnFile#9b2754a8 file_token:bytes request_token:bytes = Vector<FileHash>;
+upload.getCdnFileHashes#4da54231 file_token:bytes offset:int = Vector<FileHash>;
+upload.getFileHashes#c7025931 location:InputFileLocation offset:int = Vector<FileHash>;
+
+help.getConfig#c4f9186b = Config;
+help.getNearestDc#1fb33026 = NearestDc;
+help.getAppUpdate#522d5a7d source:string = help.AppUpdate;
+help.getInviteText#4d392343 = help.InviteText;
+help.getSupport#9cdf08cd = help.Support;
+help.getAppChangelog#9010ef6f prev_app_version:string = Updates;
+help.setBotUpdatesStatus#ec22cfcd pending_updates_count:int message:string = Bool;
+help.getCdnConfig#52029342 = CdnConfig;
+help.getRecentMeUrls#3dc0f114 referer:string = help.RecentMeUrls;
+help.getTermsOfServiceUpdate#2ca51fd1 = help.TermsOfServiceUpdate;
+help.acceptTermsOfService#ee72f79a id:DataJSON = Bool;
+help.getDeepLinkInfo#3fedc75f path:string = help.DeepLinkInfo;
+help.getAppConfig#98914110 = JSONValue;
+help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
+help.getPassportConfig#c661ad08 hash:int = help.PassportConfig;
+help.getSupportName#d360e72c = help.SupportName;
+help.getUserInfo#38a08d3 user_id:InputUser = help.UserInfo;
+help.editUserInfo#66b91b70 user_id:InputUser message:string entities:Vector<MessageEntity> = help.UserInfo;
+help.getPromoData#c0977421 = help.PromoData;
+help.hidePromoData#1e251c95 peer:InputPeer = Bool;
+help.dismissSuggestion#f50dbaa1 peer:InputPeer suggestion:string = Bool;
+help.getCountriesList#735787a8 lang_code:string hash:int = help.CountriesList;
+
+channels.readHistory#cc104937 channel:InputChannel max_id:int = Bool;
+channels.deleteMessages#84c1fd4e channel:InputChannel id:Vector<int> = messages.AffectedMessages;
+channels.deleteUserHistory#d10dd71b channel:InputChannel user_id:InputUser = messages.AffectedHistory;
+channels.reportSpam#fe087810 channel:InputChannel user_id:InputUser id:Vector<int> = Bool;
+channels.getMessages#ad8c9a23 channel:InputChannel id:Vector<InputMessage> = messages.Messages;
+channels.getParticipants#77ced9d0 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:long = channels.ChannelParticipants;
+channels.getParticipant#a0ab6cc6 channel:InputChannel participant:InputPeer = channels.ChannelParticipant;
+channels.getChannels#a7f6bbb id:Vector<InputChannel> = messages.Chats;
+channels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;
+channels.createChannel#3d5fb10f flags:# broadcast:flags.0?true megagroup:flags.1?true for_import:flags.3?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string = Updates;
+channels.editAdmin#d33c8902 channel:InputChannel user_id:InputUser admin_rights:ChatAdminRights rank:string = Updates;
+channels.editTitle#566decd0 channel:InputChannel title:string = Updates;
+channels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;
+channels.checkUsername#10e6bd2c channel:InputChannel username:string = Bool;
+channels.updateUsername#3514b3de channel:InputChannel username:string = Bool;
+channels.joinChannel#24b524c5 channel:InputChannel = Updates;
+channels.leaveChannel#f836aa95 channel:InputChannel = Updates;
+channels.inviteToChannel#199f3a6c channel:InputChannel users:Vector<InputUser> = Updates;
+channels.deleteChannel#c0111fe3 channel:InputChannel = Updates;
+channels.exportMessageLink#e63fadeb flags:# grouped:flags.0?true thread:flags.1?true channel:InputChannel id:int = ExportedMessageLink;
+channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates;
+channels.getAdminedPublicChannels#f8b036af flags:# by_location:flags.0?true check_limit:flags.1?true = messages.Chats;
+channels.editBanned#96e6cd81 channel:InputChannel participant:InputPeer banned_rights:ChatBannedRights = Updates;
+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.setStickers#ea8ca4f9 channel:InputChannel stickerset:InputStickerSet = Bool;
+channels.readMessageContents#eab5dc38 channel:InputChannel id:Vector<int> = Bool;
+channels.deleteHistory#af369d42 channel:InputChannel max_id:int = Bool;
+channels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates;
+channels.getLeftChannels#8341ecc0 offset:int = messages.Chats;
+channels.getGroupsForDiscussion#f5dad378 = messages.Chats;
+channels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool;
+channels.editCreator#8f38cd1f channel:InputChannel user_id:InputUser password:InputCheckPasswordSRP = Updates;
+channels.editLocation#58e63f6d channel:InputChannel geo_point:InputGeoPoint address:string = Bool;
+channels.toggleSlowMode#edd49ef0 channel:InputChannel seconds:int = Updates;
+channels.getInactiveChannels#11e831ee = messages.InactiveChats;
+channels.convertToGigagroup#b290c69 channel:InputChannel = Updates;
+channels.viewSponsoredMessage#beaedb94 channel:InputChannel random_id:bytes = Bool;
+channels.getSponsoredMessages#ec210fbf channel:InputChannel = messages.SponsoredMessages;
+
+bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
+bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
+bots.setBotCommands#517165a scope:BotCommandScope lang_code:string commands:Vector<BotCommand> = Bool;
+bots.resetBotCommands#3d8de0f9 scope:BotCommandScope lang_code:string = Bool;
+bots.getBotCommands#e34c0dd6 scope:BotCommandScope lang_code:string = Vector<BotCommand>;
+
+payments.getPaymentForm#8a333c8d flags:# peer:InputPeer msg_id:int theme_params:flags.0?DataJSON = payments.PaymentForm;
+payments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt;
+payments.validateRequestedInfo#db103170 flags:# save:flags.0?true peer:InputPeer msg_id:int info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;
+payments.sendPaymentForm#30c3bc9d flags:# form_id:long peer:InputPeer msg_id:int requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials tip_amount:flags.2?long = payments.PaymentResult;
+payments.getSavedInfo#227d824b = payments.SavedInfo;
+payments.clearSavedInfo#d83d70c1 flags:# credentials:flags.0?true info:flags.1?true = Bool;
+payments.getBankCardData#2e79d779 number:string = payments.BankCardData;
+
+stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true animated:flags.1?true videos:flags.4?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector<InputStickerSetItem> software:flags.3?string = messages.StickerSet;
+stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet;
+stickers.changeStickerPosition#ffb6d4ca sticker:InputDocument position:int = messages.StickerSet;
+stickers.addStickerToSet#8653febe stickerset:InputStickerSet sticker:InputStickerSetItem = messages.StickerSet;
+stickers.setStickerSetThumb#9a364e30 stickerset:InputStickerSet thumb:InputDocument = messages.StickerSet;
+stickers.checkShortName#284b3639 short_name:string = Bool;
+stickers.suggestShortName#4dafc503 title:string = stickers.SuggestedShortName;
+
+phone.getCallConfig#55451fa9 = DataJSON;
+phone.requestCall#42ff96ed flags:# video:flags.0?true user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall;
+phone.acceptCall#3bd2b4a0 peer:InputPhoneCall g_b:bytes protocol:PhoneCallProtocol = phone.PhoneCall;
+phone.confirmCall#2efe1722 peer:InputPhoneCall g_a:bytes key_fingerprint:long protocol:PhoneCallProtocol = phone.PhoneCall;
+phone.receivedCall#17d54f61 peer:InputPhoneCall = Bool;
+phone.discardCall#b2cbc1c0 flags:# video:flags.0?true peer:InputPhoneCall duration:int reason:PhoneCallDiscardReason connection_id:long = Updates;
+phone.setCallRating#59ead627 flags:# user_initiative:flags.0?true peer:InputPhoneCall rating:int comment:string = Updates;
+phone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool;
+phone.sendSignalingData#ff7a9383 peer:InputPhoneCall data:bytes = Bool;
+phone.createGroupCall#48cdc6d8 flags:# peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates;
+phone.joinGroupCall#b132ff7b flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string params:DataJSON = Updates;
+phone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates;
+phone.inviteToGroupCall#7b393160 call:InputGroupCall users:Vector<InputUser> = Updates;
+phone.discardGroupCall#7a777135 call:InputGroupCall = Updates;
+phone.toggleGroupCallSettings#74bbb43d flags:# reset_invite_hash:flags.1?true call:InputGroupCall join_muted:flags.0?Bool = Updates;
+phone.getGroupCall#41845db call:InputGroupCall limit:int = phone.GroupCall;
+phone.getGroupParticipants#c558d8ab call:InputGroupCall ids:Vector<InputPeer> sources:Vector<int> offset:string limit:int = phone.GroupParticipants;
+phone.checkGroupCall#b59cf977 call:InputGroupCall sources:Vector<int> = Vector<int>;
+phone.toggleGroupCallRecord#f128c708 flags:# start:flags.0?true video:flags.2?true call:InputGroupCall title:flags.1?string video_portrait:flags.2?Bool = Updates;
+phone.editGroupCallParticipant#a5273abf flags:# call:InputGroupCall participant:InputPeer muted:flags.0?Bool volume:flags.1?int raise_hand:flags.2?Bool video_stopped:flags.3?Bool video_paused:flags.4?Bool presentation_paused:flags.5?Bool = Updates;
+phone.editGroupCallTitle#1ca6ac0a call:InputGroupCall title:string = Updates;
+phone.getGroupCallJoinAs#ef7c213a peer:InputPeer = phone.JoinAsPeers;
+phone.exportGroupCallInvite#e6aa647f flags:# can_self_unmute:flags.0?true call:InputGroupCall = phone.ExportedGroupCallInvite;
+phone.toggleGroupCallStartSubscription#219c34e6 call:InputGroupCall subscribed:Bool = Updates;
+phone.startScheduledGroupCall#5680e342 call:InputGroupCall = Updates;
+phone.saveDefaultGroupCallJoinAs#575e1f8c peer:InputPeer join_as:InputPeer = Bool;
+phone.joinGroupCallPresentation#cbea6bc4 call:InputGroupCall params:DataJSON = Updates;
+phone.leaveGroupCallPresentation#1c50d144 call:InputGroupCall = Updates;
+
+langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;
+langpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector<string> = Vector<LangPackString>;
+langpack.getDifference#cd984aa5 lang_pack:string lang_code:string from_version:int = LangPackDifference;
+langpack.getLanguages#42c6978f lang_pack:string = Vector<LangPackLanguage>;
+langpack.getLanguage#6a596502 lang_pack:string lang_code:string = LangPackLanguage;
+
+folders.editPeerFolders#6847d0ab folder_peers:Vector<InputFolderPeer> = Updates;
+folders.deleteFolder#1c295881 folder_id:int = Updates;
+
+stats.getBroadcastStats#ab42441a flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastStats;
+stats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph;
+stats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel = stats.MegagroupStats;
+stats.getMessagePublicForwards#5630281b channel:InputChannel msg_id:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
+stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;
+
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/type/Error.html b/data/core.telegram.org/type/Error.html new file mode 100644 index 0000000000..0bdedb2b31 --- /dev/null +++ b/data/core.telegram.org/type/Error.html @@ -0,0 +1,143 @@ + + + + + Error + + + + + + + + + + + + + +
+ +
+
+
+ +

Error

+ +

An object containing a query error.

+

+ +
+
error#c4b9f9bb code:int text:string = Error;

+

Constructors

+ + + + + + + + + + + + + +
ConstructorDescription
errorError.
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/type/Null.html b/data/core.telegram.org/type/Null.html new file mode 100644 index 0000000000..1c82eb47c0 --- /dev/null +++ b/data/core.telegram.org/type/Null.html @@ -0,0 +1,143 @@ + + + + + Null + + + + + + + + + + + + + +
+ +
+
+
+ +

Null

+ +

Object corresponds to an arbitrary empty object.

+

+ +
+
null#56730bcc = Null;

+

Constructors

+ + + + + + + + + + + + + +
ConstructorDescription
nullCorresponds to an arbitrary empty object.
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/type/StatsURL.html b/data/core.telegram.org/type/StatsURL.html new file mode 100644 index 0000000000..f81ad87e0c --- /dev/null +++ b/data/core.telegram.org/type/StatsURL.html @@ -0,0 +1,143 @@ + + + + + StatsURL + + + + + + + + + + + + + +
+ +
+
+
+ +

StatsURL

+ +

URL with chat statistics

+

+ +
+
statsURL#47a971e0 url:string = StatsURL;

+

Constructors

+ + + + + + + + + + + + + +
ConstructorDescription
statsURLURL with chat statistics
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/api/errors.html b/data/corefork.telegram.org/api/errors.html new file mode 100644 index 0000000000..a7f8aeec7d --- /dev/null +++ b/data/corefork.telegram.org/api/errors.html @@ -0,0 +1,189 @@ + + + + + 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 request that must be completed before processing the current request returned an error
  • +
  • MSG_WAIT_TIMEOUT: A request that must be completed before processing the current request didn't finish processing yet
  • +
+

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/corefork.telegram.org/api/file_reference.html b/data/corefork.telegram.org/api/file_reference.html new file mode 100644 index 0000000000..10f025ba7b --- /dev/null +++ b/data/corefork.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/corefork.telegram.org/api/obtaining_api_id.html b/data/corefork.telegram.org/api/obtaining_api_id.html new file mode 100644 index 0000000000..ed6d7eb7ab --- /dev/null +++ b/data/corefork.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/corefork.telegram.org/api/poll.html b/data/corefork.telegram.org/api/poll.html new file mode 100644 index 0000000000..63d157426f --- /dev/null +++ b/data/corefork.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#dcb82ea3 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<long> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults;
+
+poll#86e18161 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:string answers:Vector<PollAnswer> close_period:flags.4?int close_date:flags.5?int = Poll;
+
+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#dcb82ea3 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<long> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults;
+
+updateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update;
+
+---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#34d247b4 user_id:long option:bytes date:int = MessageUserVote;
+messageUserVoteInputOption#3ca5b0ec user_id:long date:int = MessageUserVote;
+messageUserVoteMultiple#8a65e557 user_id:long options:Vector<bytes> date:int = MessageUserVote;
+
+messages.votesList#823f649 flags:# count:int votes:Vector<MessageUserVote> users:Vector<User> next_offset:flags.0?string = messages.VotesList; 
+
+updateMessagePollVote#106395c9 poll_id:long user_id:long options:Vector<bytes> qts:int = 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/corefork.telegram.org/api/qr-login.html b/data/corefork.telegram.org/api/qr-login.html new file mode 100644 index 0000000000..1371a834c2 --- /dev/null +++ b/data/corefork.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#b7e085fe api_id:int api_hash:string except_ids:Vector<long> = auth.LoginToken;
+auth.acceptLoginToken#e894ad4d token:bytes = Authorization;
+auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;
+

Exporting a login token

+

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/corefork.telegram.org/api/recent-actions.html b/data/corefork.telegram.org/api/recent-actions.html new file mode 100644 index 0000000000..f3ca80fe01 --- /dev/null +++ b/data/corefork.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#50c7ac8 prev_value:long new_value:long = ChannelAdminLogEventAction;
+channelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction;
+channelAdminLogEventActionToggleSlowMode#53909779 prev_value:int new_value:int = ChannelAdminLogEventAction;
+
+channelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent;
+
+channels.adminLogResults#ed8af74d events:Vector<ChannelAdminLogEvent> chats:Vector<Chat> users:Vector<User> = channels.AdminLogResults;
+
+channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?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/corefork.telegram.org/api/terms.html b/data/corefork.telegram.org/api/terms.html new file mode 100644 index 0000000000..a049063beb --- /dev/null +++ b/data/corefork.telegram.org/api/terms.html @@ -0,0 +1,133 @@ + + + + + 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.
3.3. If your app allows accessing content from Telegram channels, you must include support for official sponsored messages in Telegram channels and may not interefere with this functionality.

+

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/corefork.telegram.org/constructor/channel.html b/data/corefork.telegram.org/constructor/channel.html new file mode 100644 index 0000000000..f1a4bd2e91 --- /dev/null +++ b/data/corefork.telegram.org/constructor/channel.html @@ -0,0 +1,289 @@ + + + + + channel + + + + + + + + + + + + + +
+ +
+
+
+ +

channel

+ +

Channel/supergroup info

+

+ +
+
channel#8261ac61 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
creatorflags.0?trueWhether the current user is the creator of this channel
leftflags.2?trueWhether the current user has left this channel
broadcastflags.5?trueIs this a channel?
verifiedflags.7?trueIs this channel verified by telegram?
megagroupflags.8?trueIs this a supergroup?
restrictedflags.9?trueWhether viewing/writing in this channel for a reason (see restriction_reason
signaturesflags.11?trueWhether signatures are enabled (channels)
minflags.12?trueSee min
scamflags.19?trueThis channel/supergroup is probably a scam
has_linkflags.20?trueWhether this channel has a private join link
has_geoflags.21?trueWhether this chanel has a geoposition
slowmode_enabledflags.22?trueWhether slow mode is enabled for groups to prevent flood in chat
call_activeflags.23?trueWhether a group call or livestream is currently active
call_not_emptyflags.24?trueWhether there's anyone in the group call or livestream
fakeflags.25?trueIf set, this supergroup/channel was reported by many users as a fake or scam: be careful when interacting with it.
gigagroupflags.26?trueWhether this supergroup is a gigagroup
idlongID of the channel
access_hashflags.13?longAccess hash
titlestringTitle
usernameflags.6?stringUsername
photoChatPhotoProfile photo
dateintDate when the user joined the supergroup/channel, or if the user isn't a member, its creation date
restriction_reasonflags.9?Vector<RestrictionReason>Contains the reason why access to this channel must be restricted.
admin_rightsflags.14?ChatAdminRightsAdmin rights of the user in this channel (see rights)
banned_rightsflags.15?ChatBannedRightsBanned rights of the user in this channel (see rights)
default_banned_rightsflags.18?ChatBannedRightsDefault chat rights (see rights)
participants_countflags.17?intParticipant count
+

Type

+

Chat

+

Related pages

+

Min constructors

+

In some situations user and channel constructors have reduced set of fields present (although id is always there) and min flag set.

+

Channels

+

How to handle channels, supergroups, groups, and what's the difference between them.

+

Admin, banned, default rights

+

How to handle admin permissions, granular bans and global permissions in channels, groups and supergroups.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/chatFull.html b/data/corefork.telegram.org/constructor/chatFull.html new file mode 100644 index 0000000000..9e961c7abc --- /dev/null +++ b/data/corefork.telegram.org/constructor/chatFull.html @@ -0,0 +1,231 @@ + + + + + chatFull + + + + + + + + + + + + + +
+ +
+
+
+ +

chatFull

+ +

Detailed chat info

+

+ +
+
chatFull#4dbdc099 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string = ChatFull;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
can_set_usernameflags.7?trueCan we change the username of this chat
has_scheduledflags.8?trueWhether scheduled messages are available
idlongID of the chat
aboutstringAbout string for this chat
participantsChatParticipantsParticipant list
chat_photoflags.2?PhotoChat photo
notify_settingsPeerNotifySettingsNotification settings
exported_inviteflags.13?ExportedChatInviteChat invite
bot_infoflags.3?Vector<BotInfo>Info about bots that are in this chat
pinned_msg_idflags.6?intMessage ID of the last pinned message
folder_idflags.11?intPeer folder ID, for more info click here
callflags.12?InputGroupCallGroup call information
ttl_periodflags.14?intTime-To-Live of messages sent by the current user to this chat
groupcall_default_join_asflags.15?PeerWhen using phone.getGroupCallJoinAs to get a list of peers that can be used to join a group call, this field indicates the peer that should be selected by default.
theme_emoticonflags.16?stringEmoji representing a specific chat theme
+

Type

+

ChatFull

+

Related pages

+

Scheduled messages

+

Telegram allows scheduling messages

+

Pinned messages

+

Telegram allows pinning multiple messages on top of a specific chat.

+

Folders

+

Telegram allows placing chats into folders, based on their type, mute status, or other custom criteria, thanks to folder blacklists and whitelists.

+

phone.getGroupCallJoinAs

+

Get a list of peers that can be used to join a group call, presenting yourself as a specific user/channel.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/keyboardButton.html b/data/corefork.telegram.org/constructor/keyboardButton.html new file mode 100644 index 0000000000..e1742a0a4b --- /dev/null +++ b/data/corefork.telegram.org/constructor/keyboardButton.html @@ -0,0 +1,147 @@ + + + + + keyboardButton + + + + + + + + + + + + + +
+ +
+
+
+ +

keyboardButton

+ +

Bot keyboard button

+

+ +
+
keyboardButton#a2fa4880 text:string = KeyboardButton;

+

Parameters

+ + + + + + + + + + + + + + + +
NameTypeDescription
textstringButton text
+

Type

+

KeyboardButton

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/keyboardButtonBuy.html b/data/corefork.telegram.org/constructor/keyboardButtonBuy.html new file mode 100644 index 0000000000..8a1a66c14c --- /dev/null +++ b/data/corefork.telegram.org/constructor/keyboardButtonBuy.html @@ -0,0 +1,147 @@ + + + + + keyboardButtonBuy + + + + + + + + + + + + + +
+ +
+
+
+ +

keyboardButtonBuy

+ +

Button to buy a product

+

+ +
+
keyboardButtonBuy#afd93fbb text:string = KeyboardButton;

+

Parameters

+ + + + + + + + + + + + + + + +
NameTypeDescription
textstringButton text
+

Type

+

KeyboardButton

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/keyboardButtonCallback.html b/data/corefork.telegram.org/constructor/keyboardButtonCallback.html new file mode 100644 index 0000000000..74f6e5662e --- /dev/null +++ b/data/corefork.telegram.org/constructor/keyboardButtonCallback.html @@ -0,0 +1,167 @@ + + + + + keyboardButtonCallback + + + + + + + + + + + + + +
+ +
+
+
+ +

keyboardButtonCallback

+ +

Callback button

+

+ +
+
keyboardButtonCallback#35bbdb6b flags:# requires_password:flags.0?true text:string data:bytes = KeyboardButton;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
requires_passwordflags.0?trueWhether the user should verify his identity by entering his 2FA SRP parameters to the messages.getBotCallbackAnswer method. NOTE: telegram and the bot WILL NOT have access to the plaintext password, thanks to SRP. This button is mainly used by the official @botfather bot, for verifying the user's identity before transferring ownership of a bot to another user.
textstringButton text
databytesCallback data
+

Type

+

KeyboardButton

+

Related pages

+

Two-factor authentication

+

How to login to a user's account if they have enabled 2FA, how to change password.

+

messages.getBotCallbackAnswer

+

Press an inline callback button and get a callback answer from the bot

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/keyboardButtonGame.html b/data/corefork.telegram.org/constructor/keyboardButtonGame.html new file mode 100644 index 0000000000..a4f4acda0f --- /dev/null +++ b/data/corefork.telegram.org/constructor/keyboardButtonGame.html @@ -0,0 +1,147 @@ + + + + + keyboardButtonGame + + + + + + + + + + + + + +
+ +
+
+
+ +

keyboardButtonGame

+ +

Button to start a game

+

+ +
+
keyboardButtonGame#50f41ccf text:string = KeyboardButton;

+

Parameters

+ + + + + + + + + + + + + + + +
NameTypeDescription
textstringButton text
+

Type

+

KeyboardButton

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/keyboardButtonRequestPhone.html b/data/corefork.telegram.org/constructor/keyboardButtonRequestPhone.html new file mode 100644 index 0000000000..f797aae1dd --- /dev/null +++ b/data/corefork.telegram.org/constructor/keyboardButtonRequestPhone.html @@ -0,0 +1,147 @@ + + + + + keyboardButtonRequestPhone + + + + + + + + + + + + + +
+ +
+
+
+ +

keyboardButtonRequestPhone

+ +

Button to request a user's phone number

+

+ +
+
keyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton;

+

Parameters

+ + + + + + + + + + + + + + + +
NameTypeDescription
textstringButton text
+

Type

+

KeyboardButton

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/keyboardButtonSwitchInline.html b/data/corefork.telegram.org/constructor/keyboardButtonSwitchInline.html new file mode 100644 index 0000000000..d2b8b24171 --- /dev/null +++ b/data/corefork.telegram.org/constructor/keyboardButtonSwitchInline.html @@ -0,0 +1,162 @@ + + + + + keyboardButtonSwitchInline + + + + + + + + + + + + + +
+ +
+
+
+ +

keyboardButtonSwitchInline

+ +

Button to force a user to switch to inline mode 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.

+

+ +
+
keyboardButtonSwitchInline#568a748 flags:# same_peer:flags.0?true text:string query:string = KeyboardButton;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
same_peerflags.0?trueIf set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field.
textstringButton label
querystringThe inline query to use
+

Type

+

KeyboardButton

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/keyboardButtonUrl.html b/data/corefork.telegram.org/constructor/keyboardButtonUrl.html new file mode 100644 index 0000000000..e67747a45b --- /dev/null +++ b/data/corefork.telegram.org/constructor/keyboardButtonUrl.html @@ -0,0 +1,152 @@ + + + + + keyboardButtonUrl + + + + + + + + + + + + + +
+ +
+
+
+ +

keyboardButtonUrl

+ +

URL button

+

+ +
+
keyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
textstringButton label
urlstringURL
+

Type

+

KeyboardButton

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/messageMediaGame.html b/data/corefork.telegram.org/constructor/messageMediaGame.html new file mode 100644 index 0000000000..7637a83654 --- /dev/null +++ b/data/corefork.telegram.org/constructor/messageMediaGame.html @@ -0,0 +1,147 @@ + + + + + messageMediaGame + + + + + + + + + + + + + +
+ +
+
+
+ +

messageMediaGame

+ +

Telegram game

+

+ +
+
messageMediaGame#fdb19008 game:Game = MessageMedia;

+

Parameters

+ + + + + + + + + + + + + + + +
NameTypeDescription
gameGameGame
+

Type

+

MessageMedia

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/messages.botCallbackAnswer b/data/corefork.telegram.org/constructor/messages.botCallbackAnswer new file mode 100644 index 0000000000..f266d3a5e9 --- /dev/null +++ b/data/corefork.telegram.org/constructor/messages.botCallbackAnswer @@ -0,0 +1,177 @@ + + + + + messages.botCallbackAnswer + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.botCallbackAnswer

+ +

Callback answer sent by the bot in response to a button press

+

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

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
alertflags.1?trueWhether an alert should be shown to the user instead of a toast notification
has_urlflags.3?trueWhether an URL is present
native_uiflags.4?trueWhether to show games in WebView or in native UI.
messageflags.0?stringAlert to show
urlflags.2?stringURL to open
cache_timeintFor how long should this answer be cached
+

Type

+

messages.BotCallbackAnswer

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/replyKeyboardForceReply.html b/data/corefork.telegram.org/constructor/replyKeyboardForceReply.html new file mode 100644 index 0000000000..2889af6458 --- /dev/null +++ b/data/corefork.telegram.org/constructor/replyKeyboardForceReply.html @@ -0,0 +1,162 @@ + + + + + replyKeyboardForceReply + + + + + + + + + + + + + +
+ +
+
+
+ +

replyKeyboardForceReply

+ +

Force the user to send a reply

+

+ +
+
replyKeyboardForceReply#86b40b08 flags:# single_use:flags.1?true selective:flags.2?true placeholder:flags.3?string = ReplyMarkup;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
single_useflags.1?trueRequests 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.
selectiveflags.2?trueUse 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.
placeholderflags.3?stringThe placeholder to be shown in the input field when the keyboard is active; 1-64 characters.
+

Type

+

ReplyMarkup

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/replyKeyboardHide.html b/data/corefork.telegram.org/constructor/replyKeyboardHide.html new file mode 100644 index 0000000000..cd43360855 --- /dev/null +++ b/data/corefork.telegram.org/constructor/replyKeyboardHide.html @@ -0,0 +1,152 @@ + + + + + replyKeyboardHide + + + + + + + + + + + + + +
+ +
+
+
+ +

replyKeyboardHide

+ +

Hide sent bot keyboard

+

+ +
+
replyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
selectiveflags.2?trueUse this flag 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
+

Type

+

ReplyMarkup

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/updateBotCallbackQuery.html b/data/corefork.telegram.org/constructor/updateBotCallbackQuery.html new file mode 100644 index 0000000000..99bf31279c --- /dev/null +++ b/data/corefork.telegram.org/constructor/updateBotCallbackQuery.html @@ -0,0 +1,182 @@ + + + + + updateBotCallbackQuery + + + + + + + + + + + + + +
+ +
+
+
+ +

updateBotCallbackQuery

+ +

A callback button was pressed, and the button data was sent to the bot that created the button

+

+ +
+
updateBotCallbackQuery#b9cfc48d flags:# query_id:long user_id:long peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
query_idlongQuery ID
user_idlongID of the user that pressed the button
peerPeerChat where the inline keyboard was sent
msg_idintMessage ID
chat_instancelongGlobal identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
dataflags.0?bytesCallback data
game_short_nameflags.1?stringShort name of a Game to be returned, serves as the unique identifier for the game
+

Type

+

Update

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/updateChatParticipantDelete.html b/data/corefork.telegram.org/constructor/updateChatParticipantDelete.html new file mode 100644 index 0000000000..125326d927 --- /dev/null +++ b/data/corefork.telegram.org/constructor/updateChatParticipantDelete.html @@ -0,0 +1,157 @@ + + + + + updateChatParticipantDelete + + + + + + + + + + + + + +
+ +
+
+
+ +

updateChatParticipantDelete

+ +

A member has left the group.

+

+ +
+
updateChatParticipantDelete#e32f3d77 chat_id:long user_id:long version:int = Update;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
chat_idlongGroup ID
user_idlongID of the user
versionintUsed in basic groups to reorder updates and make sure that all of them was received.
+

Type

+

Update

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/method/account.setContentSettings b/data/corefork.telegram.org/method/account.setContentSettings new file mode 100644 index 0000000000..89ff7b5ee6 --- /dev/null +++ b/data/corefork.telegram.org/method/account.setContentSettings @@ -0,0 +1,172 @@ + + + + + account.setContentSettings + + + + + + + + + + + + + +
+ +
+
+
+ +

account.setContentSettings

+ +

Set sensitive content settings (for viewing or hiding NSFW content)

+

+ +
+
boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+---functions---
+account.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
sensitive_enabledflags.0?trueEnable NSFW content
+

Result

+

Bool

+

Possible errors

+ + + + + + + + + + + + + + + +
CodeTypeDescription
403SENSITIVE_CHANGE_FORBIDDENYou can't change your sensitive content settings.
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/method/messages.getBotCallbackAnswer b/data/corefork.telegram.org/method/messages.getBotCallbackAnswer new file mode 100644 index 0000000000..1a5c7def17 --- /dev/null +++ b/data/corefork.telegram.org/method/messages.getBotCallbackAnswer @@ -0,0 +1,226 @@ + + + + + messages.getBotCallbackAnswer + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.getBotCallbackAnswer

+ +

Press an inline callback button and get a callback answer from the bot

+

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

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
gameflags.1?trueWhether this is a "play game" button
peerInputPeerWhere was the inline keyboard sent
msg_idintID of the Message with the inline keyboard
dataflags.0?bytesCallback data
passwordflags.2?InputCheckPasswordSRPFor buttons requiring you to verify your identity with your 2FA password, the SRP payload generated using SRP.
+

Result

+

messages.BotCallbackAnswer

+

Possible errors

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeTypeDescription
400BOT_RESPONSE_TIMEOUTA timeout occurred while fetching data from the bot.
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400DATA_INVALIDEncrypted data invalid.
400MESSAGE_ID_INVALIDThe provided message id is invalid.
400PEER_ID_INVALIDThe provided peer id is invalid.
-503TimeoutTimeout while fetching data.
+

Related pages

+

keyboardButtonCallback

+

Callback button

+

Two-factor authentication

+

How to login to a user's account if they have enabled 2FA, how to change password.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/method/messages.setBotCallbackAnswer b/data/corefork.telegram.org/method/messages.setBotCallbackAnswer new file mode 100644 index 0000000000..a2ede3c25a --- /dev/null +++ b/data/corefork.telegram.org/method/messages.setBotCallbackAnswer @@ -0,0 +1,203 @@ + + + + + messages.setBotCallbackAnswer + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.setBotCallbackAnswer

+ +

Set the callback answer to a user button press (bots only)

+

+ +
+
boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+---functions---
+messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long message:flags.0?string url:flags.2?string cache_time:int = Bool;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
alertflags.1?trueWhether to show the message as a popup instead of a toast notification
query_idlongQuery ID
messageflags.0?stringPopup to show
urlflags.2?stringURL to open
cache_timeintCache validity
+

Result

+

Bool

+

Possible errors

+ + + + + + + + + + + + + + + + + + + + + + + + + +
CodeTypeDescription
400MESSAGE_TOO_LONGThe provided message is too long.
400QUERY_ID_INVALIDThe query ID is invalid.
400URL_INVALIDInvalid URL provided.
+

Bots can use this method

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/method/phone.editGroupCallMember b/data/corefork.telegram.org/method/phone.editGroupCallMember new file mode 100644 index 0000000000..81305b2262 --- /dev/null +++ b/data/corefork.telegram.org/method/phone.editGroupCallMember @@ -0,0 +1,167 @@ + + + + + phone.editGroupCallMember + + + + + + + + + + + + + +
+ +
+
+
+ +

phone.editGroupCallMember

+ +

Edit information about a given group call participant

+

+ +
+
 Method schema is available as of layer 123. Switch »

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + +
flags#Flags, see TL conditional fields
mutedflags.0?trueWhether to mute or unmute the user
callInputGroupCallGroup call
user_idInputUserThe user in question
+

Result

+

Updates

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/method/phone.toggleGroupCallStartSubscription b/data/corefork.telegram.org/method/phone.toggleGroupCallStartSubscription new file mode 100644 index 0000000000..a0b3a23233 --- /dev/null +++ b/data/corefork.telegram.org/method/phone.toggleGroupCallStartSubscription @@ -0,0 +1,160 @@ + + + + + phone.toggleGroupCallStartSubscription + + + + + + + + + + + + + +
+ +
+
+
+ +

phone.toggleGroupCallStartSubscription

+ +

Subscribe or unsubscribe to a scheduled group call

+

+ +
+
updatesTooLong#e317af7e = Updates;
+updateShortMessage#313bc7f8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
+updateShortChatMessage#4d6deea5 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:long chat_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+updateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
+---functions---
+phone.toggleGroupCallStartSubscription#219c34e6 call:InputGroupCall subscribed:Bool = Updates;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callInputGroupCallScheduled group call
subscribedBoolEnable or disable subscription
+

Result

+

Updates

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/type/User.html b/data/corefork.telegram.org/type/User.html new file mode 100644 index 0000000000..72027b32d8 --- /dev/null +++ b/data/corefork.telegram.org/type/User.html @@ -0,0 +1,177 @@ + + + + + User + + + + + + + + + + + + + +
+ +
+
+
+ +

User

+ +

Object defines a user.

+

+ +
+
userEmpty#d3bc4b7a id:long = User;
+user#3ff6ecb0 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;
+
+---functions---
+
+account.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User;
+account.updateUsername#3e0bdd7c username:string = User;
+account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User;

+

Constructors

+ + + + + + + + + + + + + + + + + +
ConstructorDescription
userEmptyEmpty constructor, non-existent user.
userIndicates info about a certain user
+

Methods

+ + + + + + + + + + + + + + + + + + + + + +
MethodDescription
account.updateProfileUpdates user profile.
account.updateUsernameChanges username for the current user.
account.changePhoneChange the phone number of the current account
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/instantview.telegram.org/checklist.html b/data/instantview.telegram.org/checklist.html new file mode 100644 index 0000000000..3c2c26d823 --- /dev/null +++ b/data/instantview.telegram.org/checklist.html @@ -0,0 +1,624 @@ + + + + + Checklist – Instant View + + + + + + + + + + + + + + +
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+
+

A Guide to Good Templates

+ +
+ +
+ +
+ +

This page lists general rules and detailed clarifications for creating good Instant View templates for news articles.

+

For more info on templates, see our Introduction and Sample Templates.

+

General Rules

+

Instant View templates must meet these five basic requirements:

+

1. IVs must only be generated for pages that need them

+

Instant View pages work best with relatively static articles. Dynamic pages (such as the main page of a news site) that are constantly refreshed with new links and media don't need IV.

+

Templates should only generate IV pages for articles and should not affect service areas of websites, as well as any other sections unsuitable for IV. IV pages should not be generated for articles that have content which is not supported in IV since this would result in unacceptable loss of information (e.g., IV pages don't support dynamic maps — if you generate an IV page for a wiki article with a dynamic map, the IV version will be missing a key element).

+

2. All essential content must be preserved

+

IV pages should show the entire text of the article, along with all its formatting, media, and embedded content. This includes headings, subheadings, quotes, captions, photos, videos, links, etc.

+

3. Unnecessary elements must be removed

+

IV pages should display only the source’s content – removing all interface elements, advertisments and irrelevant embedded material.

+

4. Template must process all the pages it covers

+

Pages with irregular elements should be processed correctly. All media, embeds, quotes and separators should be properly displayed.

+

5. No extraneous info may be added

+

Any attempt to add content that is not present on the original page will cause your template to be rejected.

+

You may include the username of websites’ official channels in Instant View templates. The username is assigned to the channel property, and to be considered official, the channel must be labeled as such by the company or person who published it (on its website or social media).

+
+

More detailed criteria and clarifications are available below.

+
+
+

Submitting Templates

+

You can submit your template for review as soon as it covers a sufficient number of articles. Make sure you've enabled Track Changes for at least 10-15 different pages on the target website and that all IV pages are generated correctly.

+

When ready, simply tap Submit Template next to a template in the My Templates section:

+
+ +

Submitting a template from My Templates

+ +

Finding Issues

+

Anyone can check how well Instant View templates process articles on their respective websites, and may submit feedback using the Report Issue button.

+

Click to select and highlight incorrectly parsed blocks in the source page or in the Instant View result and provide a detailed explanation of what is wrong (check the criteria below for ideas). The author of the template will be able to see all issues, fix and resubmit their work.

+
+

Perfect Templates

+

To make it easier to report issues in Instant View templates, we’ve compiled this list of characteristics that make a perfect template. Please use the list below as a reference when looking for issues in templates.

+

1. IV Targets: Must Generate

+

Templates must generate Instant View pages for all relevant pages on the target website.

+

1.1. Pages with static article-like content

+
    +
  • News articles
  • +
  • Blog posts
  • +
  • Guides
  • +
  • Wiki entries
  • +
  • Documentation
  • +
  • Etc.
  • +
+
+

Tip: It may be a good idea to identify a common feature of all the IV-positive pages and add rules so that the template only applies to them. Note that these pages only need IV pages if their essential content is supported in the IV format — otherwise, see 2.3.

+
+

2. IV Targets: Must NOT Generate

+

Templates must not generate Instant View content for pages of the following types:

+

2.1. Pages with dynamic content

+
    +
  • Dynamically updated lists of articles
  • +
  • Catalogs
  • +
  • Forum threads
  • +
  • Search pages and search results
  • +
  • Etc.
  • +
+
+

Tip: IV pages are cached. As articles get older, their cached IV pages update less frequently. Any pages that update content in real time would subsequently display outdated IV pages to users — which is unacceptable.

+
+

2.2. Pages that require significant interaction

+
    +
  • Service areas of websites, such as Contact pages with forms
  • +
  • Store areas of websites, such as pages where users can buy products
  • +
  • Etc.
  • +
+
+

Tip: While it's possible to modify interactive components of a page into simple links, the IV format was primarily designed to allow Telegram users to enjoy web content in a quick and uniform way. Interacting with websites, buying things, writing reviews, etc. are outside of the current scope for IVs.

+
+

2.3. Pages featuring content not supported by the IV format

+
    +
  • Pages with unsupported embedded content that can't be displayed
  • +
  • Any other unsupported content
  • +
+
+

Tip: The rule is simple. If an essential part of an article is not available in the Instant View format, an IV page must not be generated. In most cases, this will happen automatically but template creators can further protect their templates from data loss by marking any unsupported essential content using the @unsupported function. See this section for advice on handling unsupported videos.

+
+

2.4. Inaccessible pages

+
    +
  • Pages that are fully or partially behind a paywall.
  • +
  • Pages that are only accessible after logging in, etc.
  • +
+

3. Essential Content

+

All essential content must be presented on the Instant View page.

+

3.1. General properties

+
    +
  • The title must be shown on the IV page (may need to include the kicker).
  • +
  • The subtitle must be shown on the IV page if a subtitle exists in the source.
  • +
  • The date of publication must be shown on the IV page if the date of publication is mentioned anywhere in the source (including meta tags).
  • +
+

These properties are also essential, but not always present or supported in IV:

+
    +
  • Author name can be shown on the IV page if an author is specified in the source.
  • +
  • Author name on the IV page can link to the author URL if an author URL is specified in the source.
  • +
  • The main image can be shown as a cover on the IV page if a suitable image exists in the source.
  • +
  • NEW Right-To-Left pages (Arabic, Persian, Hebrew, etc.) must have the dir="rtl" attribute set.
  • +
+
+

Important: See our Clarifications below for tips on how to best process cover images, date and time, author names and URLs, and other tricky elements.

+
+

3.2. Link preview

+
    +
  • The link preview must include a photo if a suitable image or document exist in the source.
  • +
  • If the page has a cover but the metadata contains no image or contains the generic site logo, you must use the cover as the photo.
  • +
  • The link preview requires a description.
  • +
  • If a short description exists in the source, it must be used for the link preview (OpenGraph descriptions, lead sections, etc.).
  • +
  • If the description in the metadata (routinely) doesn’t describe the contents of the article, your template must create a description using the subtitle or lead section, first paragraph, etc.
  • +
  • The site_name property must include the name that users see on the main page of the website (examples here).
  • +
  • It is advisable to generate proper link previews even for pages that do not generate an IV.
  • +
+
+

Note: Telegram apps will show site_name in the header of the IV. It must match the name that users see on the main page of the website (see examples) and it must not contain any additional data. For this reason metadata should not be used blindly. If the main page doesn’t display a site name, use the name they use on social networks (Telegram channels have priority).

+
+

3.3. Supported elements

+
    +
  • All important media (images, videos, slideshows, and other content that is relevant to the article) that exists in the source must be formatted accordingly.
  • +
  • Media captions must be included with the corresponding media, provided they exist in the source and can be reliably identified.
  • +
  • Credits in quotes and media captions must be formatted correctly.
  • +
  • Dividers must be converted to simplified dividers on the IV page if dividers exist in the source.
  • +
  • Anchor links must work properly on IV page if anchor links exist in the source.
  • +
+
+

Tip: Check that pages featuring unsupported content do not generate IV pages. In most cases, this will happen automatically, but it is a good idea to confirm this before submitting your template. Mark any unsupported essential content using the @unsupported function. See this section for advice on handling unsupported videos.

+
+

4. Content to be Removed

+

Anything that is not essential to the article in question should be removed from the Instant View page, including:

+
    +
  • Main navigation bars and menus (essential navigation may be adjusted to simple links)
  • +
  • Top bars
  • +
  • Side bars (can potentially be adjusted and appended to bottom of IV page)
  • +
  • Footers
  • +
  • Unsupported widgets (check supported embeds)
  • +
  • Advertisements
  • +
  • Banners
  • +
  • Social media links and buttons, including “Share” and “Like”
  • +
  • Other buttons (if it is essential, it must be simplified into a link)
  • +
  • Etc.
  • +
+

5. Extraneous Content

+

The resulting IV page may not contain any content not present in the original.

+
    +
  • No signatures or information about the template's author
  • +
  • No extra links or ads of any kind
  • +
  • Etc.
  • +
+
+

Tip: You may display the official Telegram channel of the website that published the article at the top of the IV page (by using the channel property). To be considered official, the channel must be labelled as such somewhere on the source website (doesn't have to be on the same page as the original article).

+
+

6. Clarifications

+
+

Below are some clarifications for the trickier aspects of creating perfect Instant View templates.

+
+

GENERAL PROPERTIES

+

6.1.1 Author name

+

Author name is required only if it is presented in the source article in a consistent, clear and identifiable way (in an html block with particular properties), especially if there's a name of an actual person.

+

In less obvious cases, what the user sees when viewing the original article in a browser has priority over invisible meta-information. Names of actual people are always preferable over entity names like 'team' or the name of the website.

+

You may omit the author in cases where no name can be seen by a regular user opening the original article in the browser. You may omit the name when there's no identifiable person, only the website's 'team', 'editors', 'website name' etc.

+

Absent author names for articles in which no author can be easily identified by a regular viewing user are not considered an issue.

+

6.1.2 Date and time

+

The date of publication is obligatory for news publications. It must be obtained by any means possible, including meta tags, etc. If the date is specified correctly, time is optional.

+

If conflicting dates are stored in multiple places on the source page, preference should be given to the time that is visible to an ordinary user who views the page in a browser.

+

The IV editor's 'Preview' section will always show the date/time in UTC format, while the 'Original' section may use a different time zone. It is possible for a perfect template to display a date/time that looks different than the original.

+

Support for time zones is optional, unless the time zone is reliably identifiable from the source, in which case it’s obligatory.

+
+

Tip: If given 'date published' and 'date last edited', use 'date published' for articles. For wiki-like entries 'date last edited' must be used.

+
+

6.1.3 Subtitle

+

A subtitle is a subordinate title of a published work or article giving additional information about its content. If this is present in the original article, a subtitle is required. Here's an example of a subtitle:

+
+ +

A Subtitle

+
+ +

Few publications actually use subtitles. More commonly, short summary sentences are shown below the title (and are called standfirst in the UK). These summary sentences are usually short and are not part of the article's text. It is advisable but not required to represent them as subtitle elements. Here's an example:

+
+ +

A Summary

+ +

6.1.4 Lead paragraph

+

Many publications use a slightly different style for their lead paragraphs. Unlike subtitles and summaries, the lead paragraph is part of the article's text. Even if the lead uses a different style from the rest of the text, it is less desirable to present it as a subtitle — but this is not a critical issue.

+

If the lead paragraph uses a different style, it is recommended to use bold or italic text.

+
+ +

A summary, then lead in bold

+ +

In the example above, the lead paragraph is highlighted in bold: “TAXI giant Uber has reportedly fired over 20 workers following an internal investigation into sexual harassment allegations.”

+

The article then continues: “The company told staff of the layoffs on Tuesday and related claims by law firm Perkins Coie, a person close with the case told Bloomberg.” It would be acceptable to present the “TAXI giant Uber…” paragraph as bold, or italic, or plain text.

+
+

Tip: Generally, it is advisable to avoid setting too much text as the subtitle. If the website publishes summaries that take an entire paragraph or even multiple paragraphs, it's better to use italic/bold text instead of the subtitle element to represent this content in IV.

+
+

6.1.5 Kicker

+

Kickers are separately formatted parts of the title supported in IV 2.0 with the kicker property. The kicker property must be set if a kicker is present and its text is actually a part of the title/story (see 'UBER SEX CLAIMS' on the screenshot above).

+

If the kicker represents a regular section or category into which the article falls, (e.g. 'CRIME: Seventy suitcases stolen from Heathrow airport'), it should be omitted. Missing section/category kickers are not considered an issue.

+

IMAGES AND MEDIA

+

6.2.1 Image quality

+

When several image resolutions are available and can be extracted reliably, the IV page should use better quality images (within reason). The optimal resolution range is 1280px-2560px, using larger images is pointless. Note that images that are too large (>5 MB) will fail to load. We recommend updating your template to IV 2.1 to automatically extract optimal images from the srcset attribute.

+

If for some reason it is only technically possible to obtain low-resolution versions of images (lower than 320px) for a page, but its original web version has high-resolution images, the page should not generate an IV.

+
+

Note: For the Icon type, we highly recommend setting the correct size using the width/height attributes so that they appear the same way in IV as they do in the text. Otherwise, you risk grabbing the 3x version of an emoji and displaying it as a full-blown image.

+
+

See also: Infographics

+

6.2.2 Cover images

+

It is obligatory to use a cover image:

+
    +
  • If the image is present on the page and described in the source as “featured-img”, “cover”, “lead_img”, “main_image”, etc.
  • +
  • When the article has a cover on the source website (above the title or subtitle).
  • +
+

In other cases, cover images are optional:

+
    +
  • We recommend setting a cover If there's a suitable image directly below the title/subtitle.
  • +
  • While it is possible to use GIFs and videos as cover, in most cases, it's better to leave these elements in the body of the article.
  • +
+

Sometimes, a cover is less desirable:

+
    +
  • In single-image, single-video, or single-GIF articles with no significant text.
  • +
  • When text on the cover image repeats the title.
  • +
  • Images from meta-tags are not recommended: they might be suitable, but are usually designed with sharing widgets in mind and don’t work well in the IV environment.
  • +
+

A cover must not be set if:

+
    +
  • The chosen image is clearly inappropriate for the cover.
  • +
  • The chosen image appears several paragraphs into the article and it is possible to reliably identify this.
  • +
  • The cover image is duplicated in the article.
  • +
  • Several images appear in the article one after another. In this case, the template should not break the sequence by extracting one of them as a cover (example).
  • +
+
+

Tip: Cover images can also have captions in IV, don't lose them.

+
+

6.2.3 Galleries and slideshows

+

Slideshows are required only if the source article shows several photos or other media as a slideshow or gallery. If this is the case, do the following:
- Present all images in the IV as a gallery, if possible.
- If that's not possible, keep a link to the full gallery.
- If none of the above are possible, generate no IV for the page.

+

If the source has several ordinary images/videos/GIFs following each other in the source, you may also convert them into a slideshow, but this is purely optional. This makes more sense in cases when images serve as additional content (e.g., a long text about a new car which is followed by ten images of the car).

+

We will not accept issue reports based on presence or absence of slideshows for ordinary images following each other in the source article.

+

EXCEPTION! Slideshows must not be used when:

+
    +
  • The slideshow fetches unrelated images (e.g. an illustration and a disclaimer).
  • +
  • The article consists entirely of a slideshow (and its caption/description) and there's no other content.
  • +
  • The article uses images/videos/GIFs with captions as the main medium (e.g.: travel blogs that show many photos with captions, step-by-step crafting guides, cooking recipes, etc.).
  • +
+

In the cases above, use images with captions (or even plain paragraph text) following one another.

+
+

Tip: Remember that captions should be preserved for all images in the source. If you lose captions for images you've put into a slideshow, it's a valid issue. IV Slideshows support both a caption for the entire slideshows and different captions for each individual element.

+
+

6.2.4 Captions

+

Any captions present in the source article must be preserved. This includes captions for the cover image and captions for all individual elements of slideshows.

+
+ +

All Captions Preserved

+
+ +

If the image has no caption, but has meaningful text in the alt attribute, you may use that text as the caption. This is optional, we will not accept issue reports about alt-text missing from captions.

+
+

Tip: Please don't include meaningless alt-text as captions (e.g., the PlayStation blog always puts the name of the corresponding game in the alt attribute of all screenshots – there's no need to reproduce that on the IV page.)

+
+

6.2.5 Media credits

+

IV 2.0 supports a dedicated <cite> tag for credits in media captions. Credits in captions must be preserved and placed inside the appropriate tag, provided it is possible to reliably identify them.

+

6.2.6 Infographics

+

Tall infographic images are currently unreadable in Telegram apps. If there’s a reliable way to identify them (e.g., consistently used attributes or a specific section on the website that only contains infographics) the IV must add an image link to the full version of the image. If there is no reliable way to identify such images and they are not consistently featured on the website, it is acceptable to leave infographics as ordinary photos.

+

LINKS

+

6.3.1 Image links

+

In IV 2.0, <img> tags support the attribute href to make the image clickable. It must be used to preserve the link behind the image if it leads to some different page or content.

+

Image links are required only if they are meaningful. If the link opens the same image in a higher resolution, it must be removed. Exception: Infographics.

+

6.3.2 Related Articles and other “More” links

+

IV 2.0 supports a dedicated type for RelatedArticles. Related articles are relatively static individual links or blocks of articles which are thematically related to the current one. They don't have to be located on the same domain.

+

It is obligatory to format “Related articles” links using the new <related> tag and/or remove other “More” links, provided all these links can be extracted from the article without endangering essential information.

+

We designed the RelatedArticles block to deliver a better IV-reading experience to users. The IV engine automatically checks whether articles in the <related> block have an IV, you don't need to worry about this.

+
+

If pages have no IV, they will not be displayed. If this results in an empty block, it will not be displayed.

+
+

There are cases when you must not use RelatedArticles:

+

1. Keep but don’t format as Related

+
    +
  • Links that can’t be safely and reliably extracted from the article text.
  • +
  • Links that are part of essential content for the article (without which the article makes no sense).
  • +
  • Navigational links to the other parts of multipart articles.
  • +
+
+

Never put essential links into <related>, they will be lost if the page they are leading to doesn’t have an IV.

+
+

2. Remove

+
    +
  • “More” blocks that show different links each time the page is reloaded.
  • +
  • (Consistently) random unrelated articles.
  • +
  • Dynamic lists of "Latest articles from this category”, “More articles by this author”, “Featured articles”, etc.
  • +
  • Lists of categories (links to dynamic lists).
  • +
  • External links leading to “Partner sites” (e.g., You won't believe what this game does to people!).
  • +
+

6.3.2.1. Formatting Related Articles

+

It is sufficient to put links into <related>. You only need the <a> – the IV engine will handle the rest (title, description, etc.). Your IV may only have one block of related articles at the end of the page. If the source has several blocks, merge them together or choose which one to keep.

+

Headers
Only one header may be present for the block of related articles at the end of the page. We will not accept reports about missing headers on Related blocks (unless the header contains critical information).

+

Note that if a header for a related article is not reliably extractable from the body, you must not use <related> for that link. (Otherwise, if the link gets no IV, the text will have a hanging header).

+

“Inline” blocks
You may leave “inline” related links in the middle the article. If you do, these <related> blocks must not have headers (unless the header contains critical information).

+

6.3.3 Channel links

+

You may display the official channel of the website that published the article on the IV page by using the channel property:

+
+ +

Official Channel Link

+
+ +

This channel link is optional. We will not accept issue reports based on the absence or presence of a channel link, with one exception:

+

If the channel property is set, the channel it is pointing to must be the official channel. To be considered official, the channel must be labelled as such somewhere on the source website (doesn't have to be on the same page as the original article).

+

6.3.4 Source links

+

Some articles include a link to their source. This link could be inserted at the end of the article in the format via <a href="https://example.org">Website Name</a>. A word with a similar meaning could be used instead of 'via' for websites in other languages.

+

6.3.5 Author links

+

Author links are optional. If there's a clearly identifiable author and they have a page on the target website, use that one. In more ambiguous cases, use what the regular viewing user can see in the original article or omit the link altogether.

+
+

Tip: IV only supports one author URL per article. If there are several in the article, it's permissible to choose one or omit them altogether.

+
+

6.3.6 Social media links

+

Sharing buttons and other interface-based links must be removed as per Rule 4.

+

Many articles include something like “check out our Facebook page” at the end of the text. Such links must be removed if they are placed in a reliably identifiable container.

+

6.3.7 Multi-page articles

+

To parse several pages into one IV, update your template to IV 2.1 (which skips canonical redirects by default) and use the inline function. Make sure to check in-app to see if your solution is working. The IV should open correctly when users share a link to any part of the article.

+

If pages can’t be safely assembled into one IV, navigation must be preserved. Please confirm that navigation is working and all further pages open correctly. If navigation can’t be preserved, the article must not generate an IV.

+

Never format links to the other parts of an article as related. This may break navigation if one part of the article fails to generate IV (since related articles without IVs are omitted in the block).

+

UNSUPPORTED CONTENT

+

Pages that display unsupported content (e.g. an interactive map widget) must not generate IVs.

+

Important: We will accept issue reports requesting to generate IVs for pages with content previously deemed unsupported if you include a link to a template that fully supports the content in question. This does not apply to supporting content from popular widgets that are likely to get official support in the future, see the list below.

+

6.4.1 Complex tables

+

IV 2.0 includes support for Tables. IVs can now be generated for articles with simple tables. However, complex tables may not render through existing means, and must be tagged as @unsupported.

+

Important: We will accept issue reports requesting to generate IVs for pages with content previously deemed unsupported if you include a link to a template that fully supports the content in question.

+

6.4.2 Video/Audio from unsupported players

+
    +
  • If the unsupported widget has an iFrame version, make it into an <iframe>. If you do that, the IV page will not be generated due to unsupported content, but things will work out of the box if and when we support that widget.
  • +
  • If it is not possible to represent the widget as an iFrame, but it is possible to get a direct link to the video/audio, use that link to generate a <video> or <audio> with the correct src attribute.
  • +
  • Otherwise, mark the object with the @unsupported function.
  • +
+
+

If an article that is otherwise supported includes a video or an audio track that would cause it to become unsupported, it is acceptable to include a link to the video instead of unsupporting the article. If there’s no other content on the page, it must not generate an IV.

+
+

6.4.3 Auxiliary widgets

+

Some pages include unsupported widgets that are not essential for the understanding of the article. A local news site may show a weather forecast widget on their pages. A business newspaper may show a stock price ticker for the companies covered in the article. Some websites include “And what would you do?” polls at the end of some of their articles to increase user engagement.

+

Such non-essential widgets may be omitted in IV. Warning: Make sure that this dynamic auxiliary data doesn't get added to the static IV page.

+

6.4.4 Popular Widgets

+

Telegram is likely to support the following popular widgets in the future:

+
    +
  • Reddit
  • +
  • Spotify
  • +
  • Getty images
  • +
  • Imgur
  • +
  • Coub
  • +
  • Soundbank
  • +
  • JW Player
  • +
  • Twitter Timeline
  • +
  • Infogram
  • +
  • VK Post
  • +
  • WordPress Embed Post
  • +
  • Yandex.music
  • +
+

Supporting content from these widgets is optional since it will eventually become available through official means.

+

OTHER

+

6.5.1 Subdomains

+

Subdomains that present content in a similar way to the higher-level domain must be supported.

+

If a subdomain looks like a separate website, supporting it is optional. We will accept issue reports if a template generates broken IV pages for any subdomain.

+
+

Note: We will add the necessary redirects so that Telegram apps will show IVs for articles on the main domain when users share links to the mobile version. It is not necessary to support pages from the mobile version.

+
+

6.5.2 Service areas

+

Non-article pages are strictly optional, unless there’s interactive content – in which case they must not generate IVs. This includes Terms of Service, Privacy Policies, About sections, Contacts sections and special “Print” versions of articles.

+

6.5.3 Single-media pages

+

Support for pages that only contain a single media item (photo, GIF, video, etc.) is required if:

+
    +
  • The pages are routinely accessible to users through the main navigation of the website and include other data like title, date, etc.
  • +
  • Such pages are the main medium for the domain in question (e.g. Pikabu.ru)
  • +
+

If the single-media page contains unsupported media, it must not generate an IV. See 6.4.2 Unsupported Video and Audio content.

+

In all other cases, supporting single-media pages is optional.

+

6.5.4 Ancient lore

+

Support for news articles from 2015 and earlier is optional. We won’t accept issue reports on news articles posted before 2016 if the template correctly handles articles published recently.

+

6.5.5 Quotes

+

Quotes must be formatted to match their appearance in the source article, provided it is possible to identify them (and their type) in a reliable way. Line breaks in quotes must be preserved.

+

Quotes support <cite> tags. If a quote includes an author, it must be formatted accordingly (provided the author can be reliably identified in the source).

+
+

7. Checklist Changelog

+

We will be updating this document with further clarifications as new issues arise.

+

Mar 20 2019

+
+

Don’t miss the IV 2.1 update.

+
+

Checklist 2.2:

+

Expanded clarifications

+
    +
  • 3.2, Link Preview: site_name must include the name that users see on the main page of the website; cover photo must be used in preview if metadata is empty or contains site logo; template must generate proper description if metadata is unsuitable
  • +
  • 3.3, Supported Elements: Credits must be supported in media captions and quotes
  • +
  • 6.1.2, Date and Time: Time is optional if the date is set correctly; time zones are optional, unless reliably identifiable in the source
  • +
  • 6.2.1, Image Quality: for issues to be accepted, the difference in image quality must be significant; higher resolution images must be reliably extractable; note
  • +
  • 6.3.1, Image links: Must be preserved if they are meaningful
  • +
  • 6.3.2, Related articles: Details on when RelatedArticles must not be used; Formatting guidelines
  • +
  • 6.4, Unsupported content: Optional to extract content from popular widgets which are scheduled for official Telegram support, even if another template does this
  • +
  • 6.4.2, Unsupported Video/Audio: Possible to include a link to an audio/video instead of unsupporting an otherwise fine article
  • +
  • 6.5.1, Subdomains: Added a note on mobile versions
  • +
+

Added NEW clarifications

+ +
+

Feb 6 2019

+

Checklist 2.1

+
    +
  • Related Articles (6.3.2). Considerably expanded guidelines. Now obligatory to put related links into the new “Related articles” block, provided they are reliably identifiable in the source. Other links should be removed, see full details.
  • +
  • Cover Images (6.2.2). Added conditions when covers are obligatory.
  • +
  • Galleries and Slideshows (6.2.3). Added detailed explanations on gallery usage.
  • +
+
+

Feb 2 2019

+

Checklist 2.0: Changes for the Second Instant View Contest

+

The Clarifications section has been rewritten to better organize the lore we've accumulated during and after the previous contest. These clarifications have been updated:

+
    +
  • Tables are supported (if they are not too complex).
  • +
  • Nested lists (and lists inside tables) are supported.
  • +
  • RTL-support has been introduced and is obligatory for RTL pages.
  • +
  • Related Articles got a dedicated element (UPDATED 6.02, see guidelines!).
  • +
  • Image links are supported.
  • +
  • Added guidelines on image quality.
  • +
  • Updated guidelines for cover images
  • +
  • The new Icon type requires careful handling.
  • +
  • Media credits can be formatted properly (if separable from caption).
  • +
  • Kickers in titles got a dedicated element for certain cases.
  • +
  • Added guidelines for supporting subdomains.
  • +
  • Updated guidelines for social media links
  • +
  • Updated the guidelines for site_name in link previews.
  • +
+

Don't forget to check out what's new in IV 2.0 to know what your templates are now able to support.

+
+ +
+
+
+
+
+ + + + + + + + + + + + + + diff --git a/data/instantview.telegram.org/docs.html b/data/instantview.telegram.org/docs.html new file mode 100644 index 0000000000..51203e87be --- /dev/null +++ b/data/instantview.telegram.org/docs.html @@ -0,0 +1,1527 @@ + + + + + Instant View Manual + + + + + + + + + + + +
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+
+

Instant Views and Where to Find Them

+ +
+ +

This document describes Telegram's Instant View format in stupefying detail. If this is your first time hearing about Instant View, please check out our Introduction and Sample Templates before you dive in.

+

If you're comfortable with the idea of Instant View templates, let's look at what makes them tick. To begin with, this is our in-house artist's idea of how Instant View pages are generated:

+
+ +
+ +

It turns out, he is not entirely wrong. This is how Instant View pages are really generated:

+
    +
  1. Whenever Telegram needs to display a link preview for a URL, it also checks whether an Instant View template exists for that domain.
  2. +
  3. If a template exists, our Instant View Bot obtains the page using the URL (it only processes pages that have the MIME-type text/html).
  4. +
  5. The bot then applies rules from the template that determine the positioning of the key elements on the source page (using XPath 1.0 expressions) and modifies the page content to fit the Instant View format.
  6. +
  7. The edited page is used to create a new Instant View page that will be displayed to the user.
  8. +
+

This document will explore the Instant View Format, the Types of Rules your template can utilize, as well as some useful XPath constructs, conditions, and functions that may help you build better templates.

+

This manual was intended to be used as a reference, so you don't have to read the entire thing to get started. Our sample templates make for a much better entry point. You can check back here whenever something is not clear.

+

Recent changes

+

September 10, 2020

+
    +
  • Added the new ~allowed_origin option
  • +
  • Added the new @load function
  • +
  • The @inline function now supports the silent parameter which ignores errors while fetching a page
  • +
+

March 20, 2019

+

Version 2.1

+
    +
  • Supported the srcset attribute in Image and Icon types. The IV engine will automatically take the highest image resolution available (but not higher than 2560px).
  • +
  • The @match function now returns only nodes which content was matched by regular expression
  • +
  • The @replace function now returns only nodes which content was replaced by regular expression
  • +
  • The @inline function no longer follows canonical redirect links while fetching a page
  • +
+

Also in this update:

+ +

December 10, 2018

+

Instant View 2.0 expands the platform with support for right-to-left languages, new page blocks, useful functions and much more. We recommend using the latest version in your templates. To do this, add the following rule at the beginning of the template:

+
~version: "2.0"
+

Below is a list of changes in version 2.0:

+

New properties:

+
    +
  • kicker
  • +
  • site_name
  • +
+

New types:

+
    +
  • Map
  • +
  • Table
  • +
  • Details
  • +
  • RelatedArticles
  • +
  • Marked
  • +
  • Subscript
  • +
  • Superscript
  • +
  • Icon
  • +
  • PhoneLink
  • +
  • Reference
  • +
+

New types of rules:

+ +

New functions:

+ +

Other features and improvements:

+
    +
  • Xpath query results can be appended into variables using + (see more)
  • +
  • New XPath function ends-with
  • +
  • Lists can contain block elements such as paragraph, nested lists, tables and so on
  • +
  • Support for attribution in media captions (<cite> tag)
  • +
  • Support for image links (href attribute for the Image type)
  • +
  • Unsupported elements (such as an image inside the blockquote) now generate an error instead of moving up
  • +
  • Improved @simplify function for better processing RichText (e.g. saves line breaks formed by block elements)
  • +
+

Instant View Format

+

An Instant View page is an object with the following properties:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
title RequiredRichTextPage title
subtitleRichTextPage subtitle
kicker RichTextKicker
authorStringAuthor name
author_urlUrlAuthor link
published_dateUnixtimeDate published
descriptionStringA short description (used in link preview)
image_urlUrlLink preview photo (used in link preview)
document_urlUrlLink preview document (used in link preview)
site_name StringName of website (used in link preview)
channelStringThe username of the article author's (or the originating website's) channel on Telegram in the format @username
coverMedia (Image/Video/Embed/Map)Page cover
body RequiredArticlePage content
+

RTL support

+

The platform supports right-to-left languages. If <html> tag or tag referenced by body property has the attribute dir="rtl", the page will be marked as RTL. In case this attribute is not set, you can set it manually to display the page in Instant View as RTL using the following rule:

+
  @set_attr(dir, "rtl"): $body   # if body is already defined
+  @set_attr(dir, "rtl"): /html   # alternative way
+

Supported types

+

The IV page object can hold the following types:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeAllowed childrenDescriptionHTML counterpart
ArticleHeader
Subheader
Paragraph
Preformatted
Divider
Anchor
List
Blockquote
Pullquote
Media
Image
Video
Audio
Embed
Slideshow
Table
Details
Footer
RelatedArticles
Page content<article>
HeaderRichTextMajor headingWe use the top-level of the <h1><h4> headings found on the source page
SubheaderRichTextMinor headingWe use the remaining headings <h1><h4> as well as <h5><h6> headings
ParagraphRichTextA paragraph<p>
PreformattedRichTextPreformatted text<pre> with the optional attribute data-language*
AnchorAnchor<anchor> with the attribute name that contains the anchor name
DividerA separator<hr>
ListListItemA list<ul> for a bullet list, <ol> for a numbered list
ListItemversion 1.0:
RichText

version 2.0:
Header
Subheader
Paragraph
Preformatted
Divider
Anchor
List
Blockquote
Pullquote
Media
Image
Video
Audio
Embed
Slideshow
Table
Details
A list item<li>
BlockquoteRichText
QuoteCaption
A block quote<blockquote>
PullquoteRichText
QuoteCaption
A pull quote<aside>
QuoteCaptionRichTextCaption of a quote<cite>
MediaImage
Video
Audio
Embed
Map
MediaCaption
Media content<figure>
ImageAn image<img> with the attribute src and the optional attribute href to make the image clickable. Allowed formats: GIF, JPG, PNG (GIF would be converted into Video type by IV)
As of version 2.1, supports the attribute srcset (srcset has higher priority than src, the same as in a browser; IV gets the highest available resolution under 2560px).
VideoA video<video> with the attribute src, or containing the tag <source type="video/mp4"> with the attribute src
AudioAn audio<audio> with the attribute src, or containing the tag <source> with the attribute src and the attribute type (possible types: audio/ogg, audio/mpeg, audio/mp4)
EmbedAn embedded element<iframe> with the attribute src. List of supported embeds
Map A map<img> or <iframe> with the attribute src referring to Google or Yandex maps
SlideshowMedia (Image/Video)
Image
Video
MediaCaption
A slideshow<slideshow>
MediaCaptionRichTextMedia caption<figcaption>
As of IV 2.0, can contain an additional tag <cite> with attribution (author, creator or source of the media)
Table TableCaption
TableRow
A table<table>
TableCaption RichTextA table caption<caption>
TableRow TableCellA table row<tr> with the optional attributes align, valign, can be wrapped with <thead> or <tbody> or <tfoot> with the optional attributes align, valign
TableCell RichTextA table cell<td> for a standard cell, <th> for a header cell, with the optional attributes align, valign, colspan, rowspan
Details 
(version 2.0+)
DetailsHeader
Header
Subheader
Paragraph
Preformatted
Divider
Anchor
List
Blockquote
Pullquote
Media
Image
Video
Audio
Embed
Slideshow
Table
Details
A collapsible block<details> with the optional attribute open to be opened by default
DetailsHeader 
(version 2.0+)
RichTextA visible heading for the collapsible block<summary>
RelatedArticles Header
Link
Related articles<related> containing one of <h1><h6> tag as header of the block and <a> tags with the attribute href containing a URL of related article. Note: Only articles that have an IV will appear in this block on the IV page.
FooterRichTextThe footer<footer>
RichTextBold
Italic
Underline
Strike
Fixed
Marked
Subscript
Superscript
Icon
Link
EmailLink
PhoneLink
LineBreak
Anchor
Reference
String
Formatted textText elements and supported tags
BoldRichTextBold text<b> or <strong>
ItalicRichTextItalic text<i> or <em>
UnderlineRichTextUnderlined text<u> or <ins>
StrikeRichTextStrikethrough text<s> or <del> or <strike>
FixedRichTextMonospace text<code> or <kbd> or <samp> or <tt>
Marked RichTextMarked text<mark>
Subscript RichTextSubscript text<sub>
Superscript RichTextSuperscript text<sup>
Icon A small image inside the text<pic> with the attribute src, width, height. Can contain the attribute optional if the image is not important and may be ignored. Allowed formats: JPG, PNG.
As of version 2.1, supports the attribute srcset (srcset has higher priority than src, the same as in a browser).
LinkRichTextA link<a> with the attribute href containing a URL
EmailLinkRichTextA link to an email address<a> with the attribute href containing a mailto: link
PhoneLink RichTextA link to a phone number<a> with the attribute href containing a tel: link
Reference RichTextA reference<reference> with the attribute name that contains the reference name
LineBreakLine break<br>
+
Note on code languages
+

Telegram apps currently do not support code highlighting, but they will in the future. For this reason, it is advisable to include the code language attribute (data-language) for large <pre> blocks if it is supplied in the source.

+
+

Types of Rules

+

Instant View rules are instructions that tell our IV bot where to find the meta-elements on the source page and how it should modify the content of the page when an Instant View page is created.

+

Each new line in a template describes a new rule. When the bot renders a page into the Instant View format, it applies rules from the relevant template one after another and ignores any empty lines. You can leave comments by starting a line with #, all following text on that line will be ignored unless enclosed in quote marks. You can use the \ symbol to carry a rule over to the next string, like this:

+
# Comment 
+# You can break up \
+  a long rule into \
+  multiple strings
+

Most rules are based on XPath 1.0 expressions used to locate the required nodes on the source page.

+

A block of rules may have a name. In this case, it can be reused in other rules.

+

We support the following types of rules:

+

Conditions

+

Conditions offer unlimited flexibility for your templates. Rules of this type begin with the symbols ? or ! and use the following format:

+
?condition:  xpath_query   # condition example
+!condition:  regexp        # parameter on the right depends on the type of the condition
+?condition                 # some conditions don't have parameters
+

Groups of conditions that immediately follow one another are interpreted as a block. ?-rules follow the OR logic when joined, while !-rules follow the AND logic. This means that for the bot to apply each block, all !-conditions in the block and at least one of the ?-conditions within it must be met. This also means that each block must have at least one ?-condition.

+

Blocks of conditions split your rule set into groups. Groups of rules that do not have any conditions are always applied. All other groups are only applied if their conditions are met.

+

Examples

+
# If a rule is placed here, it will be applied
+# Same with the one here
+
+?false               # This condition is always false
+# The rule placed here will never be applied, because the condition is not met
+# Very useful indeed
+
+?exists: //article   # This condition is true if the page has an article tag
+# On these lines, a new group of rules is located, and it will be applied if
+# there's an article tag on the page, despite the ?false condition above
+
+?exists: //article
+?exists: //div[@id="article"]
+!exists: //meta[@property="og:title"]
+# The rules below this block will be applied if an <article> tag or a
+# <div id="article"> can be found, this tag must also be present: <meta property="og:title">
+

+ +
+

Check out the Supported Conditions to see what works out of the box »

+
+

Properties

+

Properties are the building blocks for your IV page. Check the Instant View Format for a list of properties that can be used when creating IV pages (you can also define custom properties, but they will not be used anywhere on the resulting IV page). Use this format to fill properties:

+
property: xpath_query
+property: "Some string"
+property: null
+

Properties store the first node that matches the XPath expression xpath_query. By default, if a property already has a value, it will not be overwritten. You can change this behavior by adding ! to the property name – in this case a new non-empty value can be assigned. If you add !! to the property name, even an empty new value can be assigned to the property.

+

You can also assign a string to the property instead of the xpath_query. In this case, the property will contain a text element with the specified text. It is also possible to assign null to discard the property's value (will only work with !!).

+

Examples

+
title:   //article//h1      # Looking for the 'title' in the article heading
+title:   //h1               # If not found, checking for any headings at all
+title:   //head/title       # If no luck either, trying the <title> tag
+?path: /blog/.*             # On pages in the /blog/ section 
+title!:  //div[@id="title"] # we prefer to use <div id="title">, if present
+?path: /news/.*             # On pages in the /news/ section
+title!!: //h3               # title is always in an h3 tag
+
+author:   //article/@author  # Get author name from the author attribute
+?exists:  //article[has-class("anonymous")]    
+author!!: null               # Don't display author for anonymous posts
+
+

Reminder: The title and body properties are required for an IV page to be created.

+
+

Variables

+

Variables are useful for storing and manipulating nodes before assigning them to properties for the final IV page. Variable names begin with the $ symbol. Use this format to initialize them:

+
$variable: xpath_query
+$variable: "Some text"
+$variable: null
+

Variables store a list of nodes that match the Xpath expression xpath_query. If a variable is assigned for the second time, its previous value is overwritten. You can change this behavior by adding ? to the variable name. You can also append a list of nodes to the previous one by adding + to the variable name.

+

You can also assign a string to the variable instead of the xpath_query. In this case, the variable will contain a list with one text element that has the specified text. It is also possible to assign null to discard the variable's value.

+

Examples

+
$images:  //img
+$images:  //img[@src]     # the previous value will be overwritten
+$images?: //article//img  # a new value will only be assigned if the variable is empty
+$medias:  //img
+$medias+: //video         # now $medias contains all img and video tags
+

Options

+

Options affect how the page is processed by the bot. Options begin with the ~ symbol. Use this format to set them:

+
~option: "value"
+~option: true
+

Options can be set with values in JSON format.

+

Examples

+
~version: "2.1"
+

+ +
+

Check out Supported Options to see what else works out of the box.

+
+

Functions

+

Functions are extremely flexible, but you'll probably mostly use them to strip unnecessary nodes from the page and to replace certain elements with others. Function names begin with the @ symbol, you can use the following format:

+
@function:                 xpath_query   # a function without parameters
+@function(param):          xpath_query   # additional parameters are placed in paretheses
+@function(p1 p2):          xpath_query   # a function with two parameters
+@function(p1, "param #2"): xpath_query   # parameters can be separated by commas
+                                         # and enclosed in quote marks when needed
+@function:                 "Some text"   # use string instead of xpath_query if needed
+

The main argument of a function is a list of nodes that match the Xpath expression xpath_query. You can also use a string as the main argument instead of an xpath_query. In this case, the main argument passed to the function will be a list with one text element that has the specified text.

+

Examples

+
@remove:            //header               # removes all <header> tags found on the page
+@replace_tag(<h1>): //div[@class="header"] # replaces all <div class="header"> tags with <h1>
+<h1>:               //div[@class="header"] # an alias for @replace_tag(<h1>)
+

+ +

Note: You may find the @debug function particularly useful when creating XPath expressions.

+
+

Check out Supported Functions to see what else works out of the box.

+
+

Block Functions

+

Block functions manipulate blocks of rules. Block function names also begin with the @ symbol, you can use the following format:

+
@function(xpath_query) {   # opening bracket should be at the end of the line
+  $variable: xpath_query   # some other rules here
+  @function: $@            #   inside the block function
+}                          # closing bracket should be on a separate line
+

A block function can contain another block function so they can be nested. Block function can not contain conditions.

+
+

Please note that block functions that execute a block of rules several times (map, repeat, while, while_not) have a limit on the total number of iterations for the entire template.

+
+

Examples

+
@if( //article ) {    # if <article> exists
+  @append(<p>): $$    #   append paragraph into it
+}
+

+ +
+

Check out Supported Block Functions to see what else works out of the box.

+
+

Include

+
+

Note: This is a service rule, it will not work in your templates. It was included in this reference to give you a better understanding of how the system works. You can see an example of this rule at work in the Processing Pages section.

+
+

Rules of this type begin with the + symbol and use the following format:

+
+ rules
+

This rule inserts a block of rules with the specified name. In most cases, the name corresponds to the domain to which the rules apply.

+

Examples

+
+ core.telegram.org # inserting the block of rules that is used for core.telegram.org
+?not_exists: $body
++ telegram.org      # inserting the block of rules that is used for telegram.org
+

Special variables $$ and $@

+

The special variables work within a group of rules.

+
    +
  • The $$ variable always contains the result of the most recent XPath query.
  • +
  • The $@ variable holds the return of the most recently run function.
  • +
+

These variables come in handy when you're creating chains of rules. If a rule is missing xpath_query, the statement is considered to be equal to $$.

+

Examples

+
# Put a picture into a <figure> tag, then set it as the cover
+@wrap(<figure>): //img[@id="cover"]
+cover:           $@
+
+# Insert a divider before each div.divider that's no longer required
+@before(<hr>):   //div[has-class("divider")]
+@remove          # this is the same as @remove: $$
+

Extended XPath

+

For your convenience, you can use the following constructs in your XPath expressions.

+

Context

+

Regular XPath queries search for nodes in the context of the entire document. To specify the context for a particular expression, you can use variables in the format $context. If a matching variable exists, the query will be made relative to each variable node. If it doesn't and a matching property exists, the query will be made relative to the property node. If no matching variables or properties exist, the query return an empty list.

+

Examples

+
$headers:      //h1              # all <h1> tags on the page
+article:       //article         # the first <article> tag on the page
+$art_headers:  $article//h1      # all <h1> tags inside article
+$header_links: $art_headers//a   # all <a> tags inside each $art_headers node
+

Zeroing in on nodes

+

The result of an XPath query is always a list of matching nodes. If you'd like to narrow the list down to a single node, you can use the following syntax: (xpath_query)[n], where n is the number of the desired node. Numbering starts at 1, you can get the last node by using the last() function. This syntax can only be applied to the entire expression.

+

Examples

+
$headers:    //h1                    # all <h1> tags on the page
+$header2:    (//h1)[2]               # the second <h1> tag on the page
+$header2:    ($headers)[2]           # same
+$last_link:  ($header2//a)[last()]   # the last link inside $header2
+

has-class

+

You will often need to locate nodes that have a certain class. To do this, you can use the has-class("class") function that serves as an alias for the expression contains(concat(" ", normalize-space(@class), " "), " class ").

+

Examples

+
# Transform all div.header elements into h1
+<h1>: //div[contains(concat(" ", normalize-space(@class), " "), " header ")]
+# same idea, but much shorter
+<h1>: //div[has-class("header")]
+

ends-with

+

XPath has a starts-with function that checks whether the first string starts with the second string but does not have ends-with. In IV you can use the ends-with("haystack","needle") function that serves as an alias for the expression (substring("haystack", string-length("haystack") - string-length("needle") + 1) = "needle").

+

Examples

+
# Select all JPG images
+@debug: //img[(substring(@src, string-length(@src) - string-length(".jpg") + 1) = ".jpg")]
+# the same, but much shorter
+@debug: //img[ends-with(@src, ".jpg")]
+

prev-sibling

+

An axis that selects the previous sibling of the current node. Serves as an alias for the expression preceding-sibling::*[1]/self.

+

Examples

+
# Transform all div nodes, that immediately follow img nodes into figcaption
+<figcaption>: //div[./preceding-sibling::*[1]/self::img]
+# the same
+<figcaption>: //div[./prev-sibling::img]
+

next-sibling

+

An axis that selects the next sibling of the current node. Serves as an alias for the expression following-sibling::*[1]/self

+

Examples

+
# Join paragraphs following each other into one, separating them with a line break
+@combine(<br>): //p/following-sibling::*[1]/self::p
+# the same, but shorter
+@combine(<br>): //p/next-sibling::p
+

Supported conditions

+

Below are conditions supported in Instant View rules.

+

domain

+
domain: regexp
+

Checks whether the domain of the current page matches a regular expression. The check is case-insensitive, so the actual expression used will look like this: /^regexp$/i.

+

Examples

+
# Rule for *.subdomain.example.com URLs
+?domain: .+\.subdomain\.example\.com
+

domain_not

+
domain_not: regexp
+

Checks whether the domain of the current page does not match a regular expression. The check is case-insensitive, so the actual expression used will look like this: /^regexp$/i.

+

Examples

+
# Rule for *.subdomain.example.com URLs with an exception for dev.subdomain.example.com
+?domain:     .+\.subdomain\.example\.com
+!domain_not: dev\.subdomain\.example\.com
+

path

+
path: regexp
+

Checks whether the path to the current page matches a regular expression. The check is case-insensitive, so the actual expression used will look like this: /^regexp$/i.

+

Examples

+
# Rule for example.com/news/* links
+?path: /news/.+   # no need to escape the slash
+

path_not

+
path_not: regexp
+

Checks whether the path to the current page does not match a regular expression. The check is case-insensitive, so the actual expression used will look like this: /^regexp$/i.

+

Examples

+
# Rule for example.com/news/* links with an exception for example.com/news/recent
+?path:     /news/.+
+!path_not: /news/recent
+

exists

+
exists: xpath_query
+

Checks whether target nodes exist on the current page.

+

Examples

+
# Apply rule only to pages with an <article> tag
+?exists: //article
+

not_exists

+
not_exists: xpath_query
+

Checks whether target nodes do not exist on the current page.

+

Examples

+
# Apply rule only to pages with an <article> tag, that do not include any quotes.
+?exists:     //article
+!not_exists: //article//blockquote
+

true

+
true
+

A condition that is always true.

+

Examples

+
?path:    /blog/.+
+# Rules for the blog section go here
+?true
+# Rules that go here will be applied to all pages
+

false

+
false
+

A condition that is always false.

+

Examples

+
?path:    /news/.+
+# Rules for the news section go here
+?false
+# Rules that go here will never be applied
+

Supported options

+

Below are options supported in Instant View rules.

+

version

+
~version: "2.1"
+

Sets the version of IV used in the template. The behavior of some IV functions may change according to the version provided (see the manual of corresponding function).
The value must be one of "1.0", "2.0" or "2.1". We recommend using the latest version, 2.1.

+

Examples

+
~version: "2.1"
+# Now you can use new features from IV 2.1
+
+

Please note that version should be set at the beginning of the template before any other rules.

+
+

allowed_origin NEW

+
~allowed_origin: "https://example.com"
+~allowed_origin: ["https://example.com", "https://subdomain.example.com"]
+

Sets the origin (or the list of origins) from which content can be loaded using the @load and @inline functions.
The value should be String or Array of String.

+

Examples

+
~allowed_origin: "https://api.example.com"
+# Now you can load content from https://api.example.com regardless of the origin of current page
+@load: "https://api.example.com/get/article"
+

Supported functions

+

The general format for a function is the following:

+
@function: xpath_query
+

Each function accepts the list of nodes returned by the XPath statement as the main parameter. You may omit xpath_query, in which case $$, the result of the previous XPath query, will be passed into the function. The function then processes each element in the list and returns a list of transformed nodes which are stored in the $@ variable.

+

Below is a list of functions that are supported in Instant View rules.

+

debug

+
@debug: xpath_query
+

Logs the elements passed into the function, these elements will be displayed in the status line at the bottom of the screen in the Instant View Editor. Returns the elements passed. Consider combining with $$ and $@.

+

Example

+
@debug: //article//a     # displays all links from the page in the log
+@debug                   # displays all links again
+

+ +

Look for debug output at the bottom of your Editor:

+
+ +
+ + +

remove

+
@remove: xpath_query
+

Removes target nodes from the page, returns an empty list.

+

Examples

+
@remove: //div[has-class("related")] # remove article div.related
+@debug                               # empty list
+

append

+
@append("Some text"): xpath_query
+@append(@attr):       xpath_query
+@append(<tag>):       xpath_query
+@append(<tag>, attr, value[, attr, value[, ...]]): xpath_query
+

Inserts content, specified by the parameter, to the end of each target node.

+
    +
  • If the first parameter is in angle brackets, a new <tag> node will be created. The following two parameters then specify the name and value of an attribute for that node. If value has the format @attr, the value of the attribute attr in the target node will be used as the value. value can be an XPath expression that begins with ., in this case the query will be executed relative to the relevant node, and the text value of the returned elements will be used as the attribute's value. Otherwise, value will be used as the attribute's value.
  • +
  • If the first parameter has the format @attr, a new text element with value of the attribute attr of the targeted node will be created.
  • +
  • Otherwise, a text element with the text specified in the first parameter will be created.
  • +
+

Returns a list of the newly created nodes.

+

Examples

+
# <div class="a"><em>1</em></div>
+@append(<p>): //div
+# <div class="a"><em>1</em><p></p></div>
+

prepend

+
@prepend("Some text"): xpath_query
+@prepend(@attr):       xpath_query
+@prepend(<tag>):       xpath_query
+@prepend(<tag>, attr, value[, attr, value[, ...]]): xpath_query
+

Inserts content, specified by the parameter, to the beginning of each target node.

+
    +
  • If the first parameter is in angle brackets, a new <tag> node will be created. The following two parameters then specify the name and value of an attribute for that node. If value has the format @attr, the value of the attribute attr in the target node will be used as the value. value can be an XPath expression that begins with ., in this case the query will be executed relative to the relevant node, and the text value of the returned elements will be used as the attribute's value. Otherwise, value will be used as the attribute's value.
  • +
  • If the first parameter has the format @attr, a new text element with value of the attribute attr of the targeted node will be created.
  • +
  • Otherwise, a text element with the text specified in the first parameter will be created.
  • +
+

Returns a list of the newly created nodes.

+

Examples

+
# <div class="a"><em>1</em></div>
+@prepend(<p>, data-class, @class): //div
+# <div class="a"><p data-class="a"></p><em>1</em></div>
+

after

+
@after("Some text"): xpath_query
+@after(@attr):       xpath_query
+@after(<tag>):       xpath_query
+@after(<tag>, attr, value[, attr, value[, ...]]): xpath_query
+

Inserts content, specified by the parameter, after each target node.

+
    +
  • If the first parameter is in angle brackets, a new <tag> node will be created. The following two parameters then specify the name and value of an attribute for that node. If value has the format @attr, the value of the attribute attr in the target node will be used as the value. value can be an XPath expression that begins with ., in this case the query will be executed relative to the relevant node, and the text value of the returned elements will be used as the attribute's value. Otherwise, value will be used as the attribute's value.
  • +
  • If the first parameter has the format @attr, a new text element with value of the attribute attr of the targeted node will be created.
  • +
  • Otherwise, a text element with the text specified in the first parameter will be created.
  • +
+

Returns a list of the newly created nodes.

+

Examples

+
# <div class="a"><em>1</em><em>2</em></div>
+@after("!"): //div/em
+# <div class="a"><em>1</em>!<em>2</em>!</div>
+

before

+
@before("Some text"): xpath_query
+@before(@attr):       xpath_query
+@before(<tag>):       xpath_query
+@before(<tag>, attr, value[, attr, value[, ...]]): xpath_query
+

Inserts content, specified by the parameter, before each target node.

+
    +
  • If the first parameter is in angle brackets, a new <tag> node will be created. The following two parameters then specify the name and value of an attribute for that node. If value has the format @attr, the value of the attribute attr in the target node will be used as the value. value can be an XPath expression that begins with ., in this case the query will be executed relative to the relevant node, and the text value of the returned elements will be used as the attribute's value. Otherwise, value will be used as the attribute's value.
  • +
  • If the first parameter has the format @attr, a new text element with value of the attribute attr of the targeted node will be created.
  • +
  • Otherwise, a text element with the text specified in the first parameter will be created.
  • +
+

Returns a list of the newly created nodes.

+

Examples

+
# <div class="a"><em>1</em></div>
+@before("@"): //div/em
+# <div class="a">@<em>1</em></div>
+

append_to

+
@append_to(xpath_query): xpath_query
+@append_to($var):        xpath_query
+

Inserts each target node to the end of the base node.

+

The first parameter specifies the base node. You can pass an XPath expression that begins with ., in this case the query will be executed relative to the relevant node. The first relevant node will be used as the base node. You can also pass a variable name. If such a variable exists, the first relevant node will be used as the base node. If the variable doesn't exist or is empty, the property with a matching name will be used as the base node.

+

Returns a list of target nodes.

+

Examples

+
$div:             //div
+# <div class="a"><em></em></div><p>Text</p>
+@append_to($div): //p
+# <div class="a"><em></em><p>Text</p></div>
+

prepend_to

+
@prepend_to(xpath_query): xpath_query
+@prepend_to($var):        xpath_query
+

Inserts each target node to the beginning of the base node.

+

The first parameter specifies the base node. You can pass an XPath expression that begins with ., in this case the query will be executed relative to the relevant node. The first relevant node will be used as the base node. You can also pass a variable name. If such a variable exists, the first relevant node will be used as the base node. If the variable doesn't exist or is empty, the property with a matching name will be used as the base node.

+

Returns a list of target nodes.

+

Examples

+
$div:              //div
+# <div class="a"><em></em></div><p>Text</p>
+@prepend_to($div): //p
+# <div class="a"><p>Text</p><em></em></div>
+

after_el

+
@after_el(xpath_query): xpath_query
+@after_el($var):        xpath_query
+

Inserts each target node after the base node.

+

The first parameter specifies the base node. You can pass an XPath expression that begins with ., in this case the query will be executed relative to the relevant node. The first relevant node will be used as the base node. You can also pass a variable name. If such a variable exists, the first relevant node will be used as the base node. If the variable doesn't exist or is empty, the property with a matching name will be used as the base node.

+

Returns a list of target nodes.

+

Examples

+
$div:                        //div
+# <div class="a"><p>Text</p><em></em></div>
+@after_el("./../self::div"): //p
+# <div class="a"><em></em></div><p>Text</p>
+

before_el

+
@before_el(xpath_query): xpath_query
+@before_el($var):        xpath_query
+

Inserts each target node before the base node.

+

The first parameter specifies the base node. You can pass an XPath expression that begins with ., in this case the query will be executed relative to the relevant node. The first relevant node will be used as the base node. You can also pass a variable name. If such a variable exists, the first relevant node will be used as the base node. If the variable doesn't exist or is empty, the property with a matching name will be used as the base node.

+

Returns a list of target nodes.

+

Examples

+
$div:                        //div
+# <div class="a"><p>Text</p><em></em></div>
+@before_el("./../self::div"): //p
+# <p>Text</p><div class="a"><em></em></div>
+

replace_tag

+
@replace_tag(<tag>):     xpath_query
+<tag>:                   xpath_query
+

Changes the name of the tag. The new name for the tag should be passed as the first parameter. Returns target nodes.

+

Examples

+
# <div class="list unordered"><div class="item"></div><div class="item"></div></div>
+@replace_tag(<li>): //div[has-class("item")]
+<ul>:               //div[has-class("list")]
+# <ul class="list unordered"><li class="item"></li><li class="item"></li></ul>
+

wrap

+
@wrap(<tag>): xpath_query
+

Wrap each target node in the <tag> tag. Returns a list of the new <tag> elements.

+

Examples

+
# <em>1</em><em>2</em>
+@wrap(<b>): //em
+# <b><em>1</em></b><b><em>2</em></b>
+@wrap(<u>)
+# <b><u><em>1</em></u></b><b><u><em>2</em></u></b>
+@wrap(<p>): $@
+# <b><p><u><em>1</em></u></p></b><b><p><u><em>2</em></u></p></b>
+

wrap_inner

+
@wrap_inner(<tag>): xpath_query
+

Wrap an HTML structure around the content of each target node in the <tag> tag. Returns a list of new <tag> elements.

+

Examples

+
# <p>H<sub>2</sub>0</p>
+@wrap_inner(<b>): //p
+# <p><b>H<sub>2</sub>0</b></p>
+

clone

+
@clone: xpath_query
+

Creates a copy of each target node. Returns a list of the newly created nodes.

+

Examples

+
# <p class="text">Paragraph</p>
+@clone: //p
+# <p class="text">Paragraph</p><p class="text">Paragraph</p>
+

detach

+
@detach: xpath_query
+

Separates the target node from the rest in the parent tag. Creates a copy of the parent tag and wraps the target node into this new instance. Returns a list of parent tags that contain target nodes.

+

Examples

+
# <a href="#1">
+#   <b>1</b>
+#   <p>Link #1</p>
+# </a>
+# <a href="#2">
+#   <b>2</b>
+#   <p>Link #2</p>
+# </a>
+
+@detach: //a/b
+
+# <a href="#1">
+#   <b>1</b>
+# </a>
+# <a href="#1">
+#   <p>Link #1</p>
+# </a>
+# <a href="#2">
+#   <b>2</b>
+# </a>
+# <a href="#2">
+#   <p>Link #2</p>
+# </a>
+
+@after(<br>): $@
+
+# <a href="#1">
+#   <b>1</b>
+# </a><br>
+# <a href="#1">
+#   <p>Link #1</p>
+# </a>
+# <a href="#2">
+#   <b>2</b>
+# </a><br>
+# <a href="#2">
+#   <p>Link #2</p>
+# </a>
+

split_parent

+
@split_parent: xpath_query
+

Splits the parent tag by the target node. Places preceding siblings wrapped into parent element before the target node. Places following siblings wrapped into parent element placed after target node.

+

Returns a list of target nodes.

+

Examples

+
# <p class="text">
+#   <b>First</b> line
+#   <figure><img src="photo.jpg"></figure>
+#   <i>Second</i> line
+# </p>
+@split_parent: //p/figure
+# <p class="text">
+#   <b>First</b> line
+# </p>
+# <figure><img src="photo.jpg"></figure>
+# <p class="text">
+#   <i>Second</i> line
+# </p>
+

pre

+
@pre: xpath_query
+

Specifies that the text inside the target node is already formatted. Returns a list of matching nodes.

+

Examples

+
# <p>     Some          text  , </p>
+# <p>  Some  another      text  </p>
+@pre: (//p)[1]
+# Result in the Instant View page:
+#      Some          text  , 
+# Some another text
+

set_attr

+
@set_attr(attr, value):       xpath_query
+@set_attr(attr, @attr):       xpath_query
+@set_attr(attr, "Some text"): xpath_query
+@set_attr(attr, "Some text", @from-attr, ...): xpath_query
+

Sets an attribute in each matching node. The name of the attribute is passed in the first parameter. The value of the attribute is the rest of the parameters concatenated.

+

If value has the format @attr, the value of the attribute attr of the target node will be used as the value. value can be an XPath expression that begins with ., in this case the query will be executed relative to the relevant node, and the text value of the returned elements will be used as the attribute's value. Otherwise, value will be used as the attribute's value.

+

Returns a list of attribute nodes.

+

Examples

+
# <p class="a"></p>
+@set_attr(data-class, @class)
+# <p class="a" data-class="a"></p>
+@set_attr(id, @class, "_", ./@data-class)
+# <p class="a" data-class="a" id="a_a"></p>
+

set_attrs

+
@set_attrs(attr, value): xpath_query
+@set_attrs(attr, value[, attr, value[, ...]]): xpath_query
+

Sets multiple attributes for each of the target nodes. Each two parameters specify the name and value for the new attributes.

+

If value has the format @attr, the value of the attribute attr of the target node will be used as the value. value can be an XPath expression that begins with ., in this case the query will be executed relative to the relevant node, and the text value of the returned elements will be used as the attribute's value. Otherwise, value will be used as the attribute's value.

+

Returns a list of the matching nodes.

+

Examples

+
# <p class="a"></p>
+@set_attrs(data-class, @class, id, "a_a"): //p
+# <p class="a" data-class="a" id="a_a"></p>
+

match

+
@match(regexp):                         xpath_query
+@match(regexp, match_index):            xpath_query
+@match(regexp, match_index, modifiers): xpath_query
+

Performs a search based on a regular expression. Replaces the content of the target node with the search result. The second parameter specifies the number of the captured parenthesized subpattern. If this is not specified, the text that matched the full pattern will be used. You can specify modifiers for the regular expression using the optional parameter (ims modifiers are supported).

+

Returns a list of target nodes. As of IV 2.1, returns a list of target nodes the content of which matched the regular expression.

+

Examples

+
# <p class="plainText">Hello, world!</p>
+@match("[a-z]+!"): //p
+# <p class="plainText">world!</p>
+@match("([a-z]+)!", 1): //p/text()
+# <p class="plainText">world</p>
+@match("..t", 0, "i"): //p/@class
+# <p class="inT">Bye, world!</p>
+
+# <ul><li>a1</li><li>a</li><li>21b</li><li>.</li></ul>
+@match("[0-9]+"): //ul/li
+# <ul><li>1</li><li></li><li>21</li><li></li></ul>
+@debug: $@
+# Debug 2 nodes:
+#   [0]: <li>1</li>
+#   [1]: <li>21</li>
+

replace

+
@replace(regexp, replacement):            xpath_query
+@replace(regexp, replacement, modifiers): xpath_query
+

Performs a search and replace operation using the regular expression. You can specify modifiers for the regular expression using the optional parameter (ims modifiers are supported).

+

Returns a list of target nodes. As of IV 2.1, returns a list of target nodes the content of which was replaced by the regular expression.

+

Examples

+
# <p class="text">Hello, world!</p>
+@replace("Hello", "Goodbye"): //p/text()
+# <p class="text">Goodbye, world!</p>
+@replace(".t$", "mp"): //p/@class
+# <p class="temp">Goodbye, world!</p>
+@replace("goodb", "B", "i"): //p/text()
+# <p class="temp">Bye, world!</p>
+
+# <ul><li>a1</li><li>a</li><li>21b</li><li>.</li></ul>
+@replace("[0-9]+", "($0)"): //ul/li
+# <ul><li>a(1)</li><li>a</li><li>(21)b</li><li>.</li></ul>
+@debug: $@
+# Debug 2 nodes:
+#   [0]: <li>a(1)</li>
+#   [1]: <li>(21)b</li>
+

urlencode

+
@urlencode: xpath_query
+

Encodes the content of the target node as per RFC 3986. Returns target nodes.

+

Examples

+
# <a href="https://telegram.org">link</a>
+$a: //a
+@urlencode: $a/@href
+# <a href="https%3A%2F%2Ftelegram.org">link</a>
+@set_attr(href, "/?url=", @href): $a
+# <a href="/?url=https%3A%2F%2Ftelegram.org">link</a>
+

urldecode

+
@urldecode: xpath_query
+

Decodes the content of the target node as per RFC 3986. Returns target nodes.

+

Examples

+
# <a href="/?url=https%3A%2F%2Ftelegram.org">link</a>
+$a: //a
+@match("^/\?url=(.+)$", 1): $a/@href
+# <a href="https%3A%2F%2Ftelegram.org">link</a>
+@urldecode
+# <a href="https://telegram.org">link</a>
+

htmlencode

+
@htmlencode: xpath_query
+

Convert special characters in the target node to HTML entities. Returns the target nodes.

+

Examples

+
# <p>&lt;b&gt;Some text&lt;\b&gt;</p>
+@htmlencode: //p
+# <p>&amp;lt;b&amp;gt;Some text&amp;lt;\b&amp;gt;</p>
+

htmldecode

+
@htmldecode: xpath_query
+

Convert special HTML entities in the target node back to characters. Returns the target nodes.

+

Examples

+
# <p>&amp;lt;b&amp;gt;Some text&amp;lt;\b&amp;gt;</p>
+@htmldecode: //p
+# <p>&lt;b&gt;Some text&lt;\b&gt;</p>
+

style_to_attrs

+
@style_to_attrs(css_prop, attr): xpath_query
+@style_to_attrs(css_prop, attr[, css_prop, attr[, ...]]): xpath_query
+

Gets a value of a CSS property from the style attribute and sets it into an attribute for each of the target nodes. Each two parameters specify the name for the new attribute and the name of CSS property. Returns a list of matching nodes.

+

Examples

+
# <img style="width: 20px; height: 20px">
+@style_to_attrs(width, data-width, height, data-height): //img
+# <img style="width: 20px; height: 20px" data-width="20" data-height="20">
+

background_to_image

+
@background_to_image: xpath_query
+

Transforms the target node with a background picture into an <img> tag with an src attribute. The target node must contain a style attribute with the background. Returns a list of transformed nodes.

+

Examples

+
# <div class="bg_image" style="background-image:url(image.jpg)"></div>
+@background_to_image: //div[has-class("bg_image")]
+# <img src="image.jpg">
+

json_to_xml

+
@json_to_xml: xpath_query
+

Transforms the content of the target node to the XML format. The contents must be in valid JSON format. The resulting XML tree will be inserted into the document. Returns the root element of the XML tree.

+

Examples

+
# <div data-var='{"a":1,"b":[1,2],"c":{"p":"Hello!"}}'></div>
+@json_to_xml: //div/@data-var
+@debug: $@
+# <xml><a>1</a><b><item>1</item><item>2</item></b><c><p>Hello!</p></c></xml>
+

html_to_dom

+
@html_to_dom: xpath_query
+

Parse the content of the target node in HTML format and insert it into the document. Returns the root element of the inserted HTML tree.

+

Examples

+
# <div data-content="&lt;b&gt;Some text&lt;\b&gt;"></div>
+@html_to_dom: //div/@data-content
+@debug: $@
+# <dom><b>Some text</b></dom>
+

combine

+
@combine:                        xpath_query
+@combine(" - "):                 xpath_query
+@combine(<tag>):                 xpath_query
+@combine(<tag>[, " - "[, ...]]): xpath_query
+

Combines each target node with its preceding node if such a node exists. You can use parameters to specify nodes to be inserted above the target node. If the parameter is in angular brackets, a new <tag> node will be created. Otherwise a text element with the text specified by the parameter will be used.

+

Returns a list of nodes, preceding the target nodes.

+

Examples

+
# <pre>1 2 3</pre>
+# <pre> 4 5 </pre>
+# <pre>6 7 8</pre>
+@combine:             //pre/following-sibling::*[1]/self::pre
+# <pre>1 2 3 4 5 6 7 8</pre>
+
+# <p>first</p>
+# <p>second</p>
+@combine(<br>, <br>): //p/following-sibling::*[1]/self::p
+# <p>first<br><br>second</p>
+
+# <h1>Title</h1>
+# <strong>Subtitle</strong>
+@combine(<br>, "\n"): //h1/following-sibling::*[1]/self::strong
+# <h1>Title<br>
+# Subtitle</h1>
+

datetime

+
@datetime(-2): xpath_query
+@datetime(-2, "en-US", "yyyy-MM-dd"): xpath_query
+

Transforms the date and time from the text of the target node into a unixtime timestamp. The parameter specifies the timezone of the original date and time.

+

You can also pass a locale and a pattern to parse the date and time in more complicated cases. If a non-gregorian calendar is used, this needs to be specified in the locale. For example, "fa-IR@calendar=persian". Available patterns are documented here.

+

On success, returns a text element with the unixtime timestamp. Otherwise, returns the target element.

+

Examples

+
# <div id="date">1 January 2017, 15:04</div>
+@datetime(-2):  //div[@id="date"]
+published_date: $@   # the property published_date will hold a unixtime timestamp
+
+# <time>دوشنبه, ۲۳ اسفند ۱۳۹۵</time>
+@datetime(0, "fa-IR@calendar=persian", "EEEE, dd MMMM yyyy"): //time
+published_date: $@   # the property published_date will hold a unixtime timestamp
+

simplify

+
+

Note: This is a service function. There is no reason for you to use it in your templates. It was included in this reference to give you a better understanding of how the system works (see the ..after block).

+
+
@simplify: xpath_query
+

Processes the target nodes according to the Instant View format. Returns the target nodes.

+

Examples

+
# <p><span><b>S</b>ome</span> <em>important</em> text!</p>
+@simplify: //p
+# <p><b>S</b>ome <em>important</em> text!</p>
+

inline

+
@inline:         xpath_query
+@inline(silent): xpath_query
+

If the target element is an <iframe> with the attribute src, the content of the iframe will be loaded. The target element will be replaced with the content of the iframe.

+

If the target node is an HTML-comment, a <comment> element with the content of the comment will be created. The comment will be replaced by the newly created node.

+

You can use silent parameter to ignore errors while processing this function. You will still see an error in the debug console, but the rules that come after will continue to execute.

+

Returns a list of replaced nodes.

+
+

Note: The @inline function adheres to the same-origin policy. This means that the target and the inlined pages should have the same origin. You can specify additional allowed origins using the option ~allowed_origin

+
+

Examples

+
# <p><iframe src="/subpage.html"></iframe></p>
+# /subpage.html:
+#   <html><body><p>Hello!</p></body></html>
+@inline: //p/iframe
+# <p><html><body><p>Hello!</p></body></html></p>
+@debug
+# <html><body><p>Hello!</p></body></html>
+
+# <p><!--<b>Hello!</b>, world!--></p>
+@inline: //p/comment()
+# <p><comment><b>Hello!</b>, world!</comment></p>
+@debug
+# <comment><b>Hello!</b>, world!</comment>
+

load NEW

+
@load:         "https://example.com"
+@load(silent): xpath_query
+

Loads the content of the URL. The URL can be specified as a string or be the content of the target node.

+

You can use silent parameter to ignore errors while processing this function. You will still see an error in the debug console, but the rules that come after will continue to execute.

+

Returns the newly created node with loaded content.

+
+

Note: The @load function adheres to the same-origin policy. This means that the target and the loaded pages should have the same origin. You can specify additional allowed origins using the option ~allowed_origin

+
+

Examples

+
@append(<iframe> src "/subpage.html"): /html/body
+$iframe: $@
+@remove
+@inline: $iframe
+# the same, but much shorter
+@load: "/subpage.html"
+
+@load(silent): //meta[@property="api:url"]/@content
+# trying to load content from api:url
+@if ( $@ ) {
+  # Do something with content
+}
+

unsupported

+
@unsupported: xpath_query
+

Specifies that the target node contains essential content that can't be represented in the Instant View format. Returns the target nodes.

+

Examples

+
# <p>See the graph below:</p>
+# <canvas class="article_graph" width="600" height="400"></canvas>
+@unsupported: //canvas[has-class("article_graph")]
+
+

Tip: It is important to identify that a page contains essential unsupported content — no IV page will be generated to ensure that the user never gets incomplete info from an article. The system will take care of the most popular cases in the ..after block, but your template must cover everything that the system doesn't catch.

+
+

Supported block functions

+

The general format for a block function is the following:

+
@function(xpath_query) {
+  # block of rules
+}
+

Block functions usually accept the list of nodes returned by the XPath statement as a parameter. Depending on the function and its parameters, rules inside the block can be run several times or never. Block functions can contain any type of rules except conditions.

+

Below is a list of block functions that are supported in Instant View rules.

+

if

+
@if(xpath_query) {
+  # block of rules
+}
+

Executes the block of rules if target nodes exist on the current page. If target nodes do not exist, the block of rules will be skipped. The $$ and $@ variables contain target nodes found by the XPath query.

+

Example

+
@if( //div[has-class("blockquote")] ) { # if div.blockquote exists
+  <blockquote>: $@                      #   change tag name to blockquote
+  <cite>: $@//div[has-class("author")]  #   and mark div.author as a caption
+}
+

if_not

+
@if_not(xpath_query) {
+  # block of rules
+}
+

Executes a block of rules if target nodes do not exist on the current page. If such nodes exist, the block of rules will be skipped. The $$ and $@ variables contain target nodes found by the XPath query.

+

Example

+
@if_not( $body//footer ) {     # if footer does not exist
+  @append(<footer>): $body     #   append it into body
+}
+

map

+
@map(xpath_query) {
+  # block of rules
+}
+

Executes a block of rules once per each target node found by the XPath query. At the beginning of each iteration, the following variables will be set:

+
    +
  • $$ will contain the target nodes found by XPath query;
  • +
  • $@ will contain the current target node;
  • +
  • $index will contain the index of the current target node (starts with 1);
  • +
  • $first will contain <true> if the current target node is the first in the list and an empty list otherwise;
  • +
  • $middle will contain <true> if the current target node is between the first and the last in the list, empty list otherwise;
  • +
  • $last would contain <true> if the current target node is the last one in the list, empty list otherwise.
  • +
+

Example

+
@map( //div[@id="list"]/p ) {   # for each paragraph in list
+  $p: $@                        #   store the current paragraph in $p variable
+  @prepend_to($p): ". "         #   and
+  @prepend_to($p): $index       #   number them starting with 1
+}
+
+

Please note that the @map function should be used only if it is impossible to use regular functions with xpath queries (for example you need to use $index). Otherwise, regular functions are faster because they process several nodes at once.

+
+

Example

+
# Bad way:
+@map( //div[has-class("image")] ) {
+  $image: $@
+  <cite>:       $image//p/span
+  <figcaption>: $image//p
+  <figure>:     $image
+}
+# The same result, but faster:
+$image:       //div[has-class("image")]
+<cite>:       $image//p/span
+<figcaption>: $image//p
+<figure>:     $image
+

repeat

+
@repeat(n) {
+  # block of rules
+}
+

Executes a block of rules n times. At the beginning of each iteration, the following variables will be set:

+
    +
  • $$ and $@ will contain the previous value of $$;
  • +
  • $index will contain the index of the current iteration (starts with 1);
  • +
  • $first will contain <true> if this is the first iteration, an empty list otherwise;
  • +
  • $middle will contain <true> if the current iteration is between the first and last, empty list otherwise;
  • +
  • $last will contain <true> if this is the last iteration, empty list otherwise.
  • +
+

Example

+
# appends "1, 2, 3, 4, 5" to $body
+@repeat( 5 ) {
+  @append_to($body): $index
+  @if_not( $last ) {
+    @append_to($body): ", "
+  }
+}
+

while

+
@while(xpath_query) {
+  # block of rules
+}
+

Executes a block of rules while target nodes exist on the current page. At the beginning of each iteration the following variables will be set:

+
    +
  • $$ and $@ will contain target nodes found by XPath query;
  • +
  • $index will contain the index of the current iteration (starts with 1);
  • +
  • $first will contain <true> if it is the first iteration, an empty list otherwise.
  • +
+

Example

+
@while( //iframe ) {
+  @inline: $@          # inline all nested iframes
+}
+

while_not

+
@while_not(xpath_query) {
+  # block of rules
+}
+

Executes a block of rules while target nodes do not exist on the current page. At the beginning of each iteration the following variables will be set:

+
    +
  • $$ and $@ will contain target nodes found by XPath query;
  • +
  • $index will contain the index of the current iteration (starts with 1);
  • +
  • $first will contain <true> if this is the first iteration, an empty list otherwise.
  • +
+

Example

+
@while_not( //video ) {   # if no video exists on the current page
+  @inline: //iframe       #   try to inline iframes, maybe video is inside the frame
+}
+

Embedded elements

+

Instant View supports widgets from popular services. We display them as embedded elements or specially formatted quotes. The Instant View bot analyzes all iframes in the document body and generates a widget if the service is supported.

+
+

Some popular widgets do not use iframes. Note that the ..after block of rules contains rules to transform such widgets to an Instant View compatible format.

+
+

We currently support the following services:

+
    +
  • Youtube
  • +
  • Vimeo
  • +
  • Tweets & Twitter Videos
  • +
  • Facebook Posts & Videos
  • +
  • Instagram
  • +
  • Giphy
  • +
  • SoundCloud
  • +
  • GithubGist
  • +
  • Aparat
  • +
  • VK.com Videos
  • +
+

Processing pages

+

All pages are processed according to the following rules:

+
# Url: http://example.com/some_page.html
++ example.com
+?true
++ ..after
+

If a page is on a third-level domain and above, the following rules are applied:

+
# Url: http://some.subdomain.example.com/some_page.html
++ some.subdomain.example.com
+?not_exists: $body
++ subdomain.example.com
+?not_exists: $body
++ example.com
+?true
++ ..after
+

In other words, at first the bot attempts to use a block of rules that features the full domain name. If such a block does not exist, the bot checks for the next level up to the second-level domain.

+

..after is a special block of rules that is applied to all pages irrespective of the domain name.

+

Working with subdomains

+

If the page is on a third-level domain or higher, you need to manually select the domain level to which your template will apply. Use this menu in the top left corner of the page:

+
+
+
+ +

Choose a level that hosts pages with the same structure, so that your rules are relevant to all the matching pages on this domain.

+
+

For example, use wikipedia.org to create an IV page for https://en.wikipedia.org/wiki/Domain_name because the page structure doesn't depend on language in Wikipedia.

+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + diff --git a/data/instantview.telegram.org/js/jquery-ex.js b/data/instantview.telegram.org/js/jquery-ex.js new file mode 100644 index 0000000000..7f1950aaff --- /dev/null +++ b/data/instantview.telegram.org/js/jquery-ex.js @@ -0,0 +1,1749 @@ +(function($) { + $.fn.redraw = function() { + return this.map(function(){ this.offsetTop; return this; }); + }; + $.fn.prepareSlideX = function(callback) { + return this.map(function(){ + $(this).css({width: this.scrollWidth, overflow: 'hidden'}); + return this; + }).one('transitionend', function(){ + $(this).css({width: '', overflow: ''}); + callback && callback.call(this); + }).redraw(); + }; + $.fn.prepareSlideY = function(callback) { + return this.map(function(){ + $(this).css({height: this.scrollHeight, overflow: 'hidden'}); + return this; + }).one('transitionend', function(){ + $(this).css({height: '', overflow: ''}); + callback && callback.call(this); + }).redraw(); + }; + $.fn.animOff = function(this_el) { + if (this_el) { + return this.css('transition', 'none').redraw(); + } + return this.addClass('no-transition').redraw(); + }; + $.fn.animOn = function(this_el) { + if (this_el) { + return this.redraw().css('transition', ''); + } + return this.redraw().removeClass('no-transition'); + }; + $.fn.fadeShow = function(callback) { + return this.fadeToggle(true, callback); + }; + $.fn.fadeHide = function(callback) { + return this.fadeToggle(false, callback); + }; + $.fn.isFadeHidden = function() { + return this.hasClass('ohide'); + }; + $.fn.isFixed = function() { + return this.parents().map(function(){ return $(this).css('position'); }).get().indexOf('fixed') != -1; + }; + $.fn.focusField = function() { + var field = this.get(0); + if (field && field instanceof RadioNodeList) { + if (field[0]) { + field[0].focus(); + } + } else { + field.focus(); + } + return this; + }; + $.fn.focusAndSelect = function(select_all) { + var field = this.get(0), len = this.value().length; + if (field) { + this.focusField(); + if (len > 0) { + if (this.is('[contenteditable]')) { + var range = document.createRange(), sel; + range.selectNodeContents(field); + if (!select_all) { + range.collapse(); + } + sel = window.getSelection(); + sel.removeAllRanges(); + sel.addRange(range); + } else if (field.setSelectionRange) { + if (select_all) { + field.setSelectionRange(0, len); + } else { + field.setSelectionRange(len, len); + } + } + } + } + return this; + }; + $.fn.focusAndSelectAll = function() { + return this.focusAndSelect(true); + }; + $.fn.fadeToggle = function(state, callback) { + if (state === true || state === false) { + state = !state; + } + if (callback == 'remove') { + callback = function(){ $(this).remove(); }; + } + if (callback) { + this.one('transitionend', callback); + } + return this.toggleClass('ohide', state); + }; + $.fn.slideShow = function(callback) { + return this.prepareSlideY(callback).removeClass('shide'); + }; + $.fn.slideHide = function(callback) { + if (callback == 'remove') { + callback = function(){ $(this).remove(); }; + } + return this.prepareSlideY(callback).addClass('shide'); + }; + $.fn.slideXShow = function(callback) { + return this.prepareSlideX(callback).removeClass('sxhide'); + }; + $.fn.slideXHide = function(callback) { + if (callback == 'remove') { + callback = function(){ $(this).remove(); }; + } + return this.prepareSlideX(callback).addClass('sxhide'); + }; + $.fn.isSlideHidden = function() { + return this.hasClass('shide'); + }; + $.fn.slideToggle = function(state, callback) { + if (state === true || state === false) { + state = !state; + } + return this.prepareSlideY(callback).toggleClass('shide', state); + }; + $.fn.highlight = function(delay) { + var $this = this; + $this.addClass('highlight'); + setTimeout(function() { $this.removeClass('highlight'); }, delay); + return $this; + }; + $.fn.scrollIntoView = function(options) { + options = options || {}; + return this.first().each(function() { + var position = options.position || 'auto', + padding = options.padding || 0, + duration = options.duration || 0; + var $item = $(this), + $cont = $item.scrollParent(), + scrollTop = $cont.scrollTop(), + positionTop = 0, + paddingTop = 0, + itemHeight = $item.outerHeight(), + isBody = false; + if ($cont.get(0) === document) { + isBody = true; + $cont = $(window); + positionTop = $item.offset().top; + paddingTop = $('header').height() + 1; + } else { + positionTop = $item.offset().top - $cont.offset().top + scrollTop; + } + if (options.slidedEl) { + if (options.slidedEl === 'this') { + options.slidedEl = this; + } + $(options.slidedEl, this).each(function() { + itemHeight += (this.scrollHeight - this.clientHeight); + }); + } + var itemTop = positionTop, + itemBottom = itemTop + itemHeight, + contHeight = $cont.height(), + contTop = scrollTop + padding + paddingTop, + contBottom = scrollTop + contHeight - padding, + scrollTo = null; + if (position == 'auto') { + if (itemTop < contTop) { + scrollTo = itemTop - padding - paddingTop; + } else if (itemBottom > contBottom) { + if (itemHeight > contHeight - padding - padding) { + scrollTo = itemTop - padding - paddingTop; + } else { + scrollTo = itemBottom - contHeight + padding; + } + } + } else if (position == 'top' || position == 'center') { + if (position == 'center' && + contHeight > itemHeight) { + padding = (contHeight - paddingTop - itemHeight) / 2; + } + scrollTo = itemTop - padding - paddingTop; + } else if (position == 'bottom') { + if (itemHeight > contHeight - padding - padding) { + scrollTo = itemTop - padding - paddingTop; + } else { + scrollTo = itemBottom - contHeight + padding; + } + } + if (scrollTo) { + if (duration) { + if (isBody) { + $cont = $('html'); + } + $cont.stop().animate({scrollTop: scrollTo}, duration); + } else { + $cont.scrollTop(scrollTo); + } + } + }); + }; + $.fn.initSearch = function(options) { + return this.map(function(){ + var $field = $(this); + var curValue = $field.value(); + var curSelectedIndex = false; + var curResult = []; + var curRenderedIndex = 0; + var dataWaiting = false; + var keyUpTimeout = null; + var blurTimeout = null; + var isFocused = false; + options = options || {}; + if (!options.searchEnabled) { + options.searchEnabled = function(){ return true; }; + } + if (!options.enterEnabled) { + options.enterEnabled = function(){ return true; }; + } + if (!options.prepareQuery) { + options.prepareQuery = function(str){ return str.toLowerCase(); }; + } + $field.data('searchOptions', options); + + function onKeyDown(e) { + switch (e.which) { + case Keys.ESC: + $field.blur(); + break; + case Keys.RETURN: + select(curSelectedIndex); + break; + case Keys.UP: + var index; + if (!curSelectedIndex) { + if (options.enterEnabled()) { + index = false; + } else { + break; + } + } else { + index = curSelectedIndex - 1; + } + hover(index, true); + break; + case Keys.DOWN: + var index; + if (curSelectedIndex === false) { + index = 0; + } else { + index = curSelectedIndex + 1; + } + if (index > curResult.length - 1) { + break; + } + hover(index, true); + break; + default: + return; + } + e.stopImmediatePropagation(); + e.preventDefault(); + } + + function onKeyUp(e) { + clearTimeout(blurTimeout); + var value = $field.value(); + clearTimeout(keyUpTimeout); + if (curValue !== value) { + // if (e.type == 'keyup') { + // keyUpTimeout = setTimeout(function() { + // valueChange(); + // }, 50); + // } else { + options.onInputBeforeChange && options.onInputBeforeChange(value); + valueChange(); + options.onInput && options.onInput(value); + open(); + // } + } + } + + function onClick(e) { + open(); + } + + function check(item, queryLower) { + if (!queryLower.length) { + return 0; + } + for (var j = 0; j < item._values.length; j++) { + var valueLower = item._values[j]; + if (valueLower == queryLower) { + item._fullmatch = true; + return valueLower.length; + } + } + for (var j = 0; j < item._values.length; j++) { + var valueLower = item._values[j]; + var index = valueLower.indexOf(queryLower); + var found = options.prefixOnly ? index === 0 : index !== -1; + if (found) { + return valueLower.length; + } + } + return false; + } + + function search(data, query) { + var result = []; + result.fullMatchIndex = null; + if (!options.emptyQueryEnabled && !query.length) { + return result; + } + var time = +(new Date); + var queryLower = options.prepareQuery(query); + for (var i = 0; i < data.length; i++) { + var item = data[i]; + var valueScore = check(item, queryLower); + if (valueScore !== false) { + item._score = valueScore; + if (item._top) item._score -= 10000000; + else if (item._bottom) item._score += 10000000; + item._i = i; + result.push(item); + } + } + result.sort(function(item1, item2) { + return (item1._score - item2._score) || (item1._i - item2._i); + }); + for (i = 0; i < result.length; i++) { + var item = result[i]; + if (item._fullmatch) { + delete item._fullmatch; + if (result.fullMatchIndex === null) { + result.fullMatchIndex = i; + } + } + delete item._score; + delete item._i; + } + console.log('search: ' + (((new Date) - time) / 1000) + 's'); + return result; + } + + function render(result, query, from_index) { + if (from_index && from_index >= result.length) { + return; + } + var time = +(new Date); + var queryLower = options.prepareQuery(query); + from_index = from_index || 0; + var html = ''; + var render_limit = options.renderLimit || 50; + if (result.length > 0) { + for (var i = from_index, j = 0; i < result.length && j < render_limit; i++, j++) { + var item = result[i]; + var tagName = options.itemTagName || 'div'; + var className = 'search-item' + (options.itemClass ? ' ' + options.itemClass : '') + (item.className ? ' ' + item.className : ''); + var item_html = '<' + tagName + ' class="' + className + '" data-i="' + i + '">' + options.renderItem(item, query) + ''; + html += item_html; + } + curRenderedIndex = i; + } else { + html = options.renderNoItems ? options.renderNoItems(query) : ''; + curRenderedIndex = 0; + } + if (curRenderedIndex >= result.length) { + html += options.appendToItems ? options.appendToItems(query) : ''; + } + if (!result.length && html == '') { + options.$results.fadeHide(function() { + if (options.$results.isFadeHidden()) { + options.$results.html(html); + } + }); + } else { + if (options.$results.isFadeHidden()) { + options.$results.fadeShow(); + } + if (!from_index) { + options.$results.html(html); + } else if (html) { + options.$results.append(html); + } + } + updateScrollState(); + console.log('render: from ' + from_index + ', ' + j + ' lines, ' + (((new Date) - time) / 1000) + 's'); + } + + function renderLoading() { + curRenderedIndex = 0; + options.$results.html(options.renderLoading ? options.renderLoading() : ''); + updateScrollState(); + } + + function renderEmpty() { + curRenderedIndex = 0; + options.$results.html(''); + updateScrollState(); + } + + function close(no_anim) { + console.log(+new Date, 'close', no_anim); + clearTimeout(keyUpTimeout); + if (!options.$results.hasClass('collapsed')) { + if (options.$enter && options.enterEnabled()) { + options.$enter.removeClass('selected'); + } + if (no_anim) { + options.$results.animOff(); + } + options.$results.addClass('collapsed'); + options.onClose && options.onClose(); + if (no_anim) { + options.$results.animOn(); + } + } + } + + function open() { + if ($field.data('disabled')) { + return false; + } + clearTimeout(blurTimeout); + hover(curSelectedIndex, true); + if (options.$results.hasClass('collapsed')) { + options.$results.removeClass('collapsed'); + options.onOpen && options.onOpen(); + } + } + + function onFocus() { + isFocused = true; + var value = $field.value(); + if (curValue != value || + options.searchEnabled() && options.getData() === false) { + valueChange(); + } + open(); + } + + function onBlur() { + if (!isFocused) return; + console.log(+new Date, 'onblur'); + isFocused = false; + clearTimeout(blurTimeout); + blurTimeout = setTimeout(close, 100, false); + options.onBlur && options.onBlur(curValue); + } + + function valueChange() { + clearTimeout(blurTimeout); + clearTimeout(keyUpTimeout); + var value = $field.value(); + curValue = value; + console.log('valueChange', options.searchEnabled()); + if (options.searchEnabled()) { + var data = options.getData(); + if (data === false) { + if (!dataWaiting) { + dataWaiting = true; + $field.one('dataready.search', function() { + dataWaiting = false; + valueChange(); + }); + } + if (curValue.length || options.emptyQueryEnabled) { + renderLoading(); + } else { + renderEmpty(); + } + return; + } + curResult = search(data, curValue); + var index = false; + var $scrollableEl = options.resultsNotScrollable ? $(window) : options.$results; + $scrollableEl.scrollTop(0); + if (curValue.length || options.emptyQueryEnabled) { + render(curResult, curValue); + if (curResult.length && (!options.enterEnabled())) { + index = 0; + } + if (options.selectFullMatch && curResult.fullMatchIndex !== null) { + index = curResult.fullMatchIndex; + } + } else { + renderEmpty(); + } + } else { + curResult = []; + var index = false; + renderEmpty(); + } + hover(index, true); + } + + function hover(i, adjust_scroll, middle) { + $('.search-item.selected', options.$results).removeClass('selected'); + curSelectedIndex = i; + if (curSelectedIndex !== false) { + var selectedEl = $('.search-item', options.$results).get(curSelectedIndex); + if (!selectedEl) { + curSelectedIndex = false; + } else { + $(selectedEl).addClass('selected'); + if (adjust_scroll) { + adjustScroll($(selectedEl), middle); + } + if (Math.abs(curSelectedIndex - curRenderedIndex) < 5) { + render(curResult, curValue, curRenderedIndex); + } + } + } + if (options.$enter && options.enterEnabled()) { + options.$enter.toggleClass('selected', curSelectedIndex === false); + } + } + + function select(i) { + if (i === false) { + if (options.enterEnabled()) { + if (!options.noCloseOnEnter) { + $field.blur(); + } + options.onEnter && options.onEnter(curValue); + if (!options.noCloseOnEnter) { + close(true); + } + } + return; + } + if (!options.noCloseOnSelect) { + $field.blur(); + } + options.onSelect && options.onSelect(curResult[i]); + if (!options.noCloseOnSelect) { + close(true); + } + } + + function onItemHover() { + hover($(this).data('i'), true, true); + } + + function onItemMouseOver() { + hover($(this).data('i')); + } + + function updateScrollState() { + var results = options.$results.get(0); + if (results) { + options.$results.toggleClass('topscroll', results.scrollTop > 0); + options.$results.toggleClass('bottomscroll', results.scrollTop < results.scrollHeight - results.clientHeight); + } + } + + function onResultsScroll(e) { + updateScrollState(); + if (options.resultsNotScrollable) { + var bottom = options.$results.offset().top + options.$results.height() - $(window).scrollTop(); + if (bottom < $(window).height() * 2) { + render(curResult, curValue, curRenderedIndex); + } + } else { + if (this.scrollTop > this.scrollHeight - this.clientHeight - 1000) { + render(curResult, curValue, curRenderedIndex); + } + } + } + + function onItemClick(e) { + if (e.metaKey || e.ctrlKey) return true; + clearTimeout(blurTimeout); + e.stopImmediatePropagation(); + e.preventDefault(); + select($(this).data('i')); + } + + function adjustScroll($itemEl, middle) { + var scrollTop = options.$results.scrollTop(), + itemTop = $itemEl.position().top + scrollTop, + itemHeight = $itemEl.outerHeight(), + itemBottom = itemTop + itemHeight, + contHeight = options.$results.height() || 300; + + if (middle) { + options.$results.scrollTop(itemTop - (contHeight - itemHeight) / 2); + } else if (itemTop < scrollTop) { + options.$results.scrollTop(itemTop); + } else if (itemBottom > scrollTop + contHeight) { + options.$results.scrollTop(itemBottom - contHeight); + } + } + + if (options.$enter && options.enterEnabled()) { + options.$enter.on('mouseover.search', onItemMouseOver); + options.$enter.on('mousedown.search', onItemClick); + options.$enter.data('i', false); + } + options.$results.on('hover.search', '.search-item', onItemHover); + options.$results.on('mouseover.search', '.search-item', onItemMouseOver); + options.$results.on('mousedown.search', '.search-item', onItemClick); + if (options.resultsNotScrollable) { + $(window).on('scroll.search', onResultsScroll); + } else { + options.$results.on('scroll.search', onResultsScroll); + if (options.$results.isFixed()) { + options.$results.blockBodyScroll(); + } + } + if (options.initTextarea) { + $field.initTextarea(options.initTextarea); + } + $field.on('keydown.search', onKeyDown); + $field.on('keyup.search', onKeyUp); + $field.on('focus.search', onFocus); + $field.on('blur.search', onBlur); + $field.on('input.search', onKeyUp); + $field.on('click.search', onClick); + + $field.on('disable.search', function(e, disable) { + $field.data('disabled', disable); + $field.attr('contenteditable', disable ? 'false' : 'true'); + close(true); + }); + $field.on('datachange.search', function() { + valueChange(); + }); + $field.on('contentchange.search', function() { + if (options.resultsNotScrollable) { + var scrolltop = $(window).scrollTop(); + } else { + var scrolltop = options.$results.scrollTop(); + } + var limit = options.renderLimit; + options.renderLimit = curRenderedIndex; + valueChange(); + options.renderLimit = limit; + if (options.resultsNotScrollable) { + $(window).scrollTop(scrolltop); + } else { + options.$results.scrollTop(scrolltop); + } + }); + + options.$results.addClass('collapsed'); + + if (options.updateOnInit) { + valueChange(); + } + return this; + }); + }; + $.fn.destroySearch = function() { + return this.map(function() { + var $field = $(this); + var options = $field.data('searchOptions'); + if (options) { + if (options.$enter && options.enterEnabled()) { + options.$enter.off('.search'); + } + options.$results.off('.search'); + if (options.resultsNotScrollable) { + $(window).off('.search'); + } + if (options.initTextarea) { + $field.destroyTextarea(); + } + } + $field.off('.search'); + return this; + }); + }; + $.fn.initSelect = function(options) { + return this.map(function() { + var $select = $(this); + var $field = $('.form-control', $select); + var $selected = $('.selected-items', $select); + var $results = $('.items-list', $select); + var selectedVal = [], selectedMap = {}; + + $select.data('options', options); + + function getValue(full) { + if (options.multiSelect) { + return full ? $.extend({}, selectedMap) : [].concat(selectedVal); + } else { + return selectedVal.length > 0 ? (full ? selectedMap[selectedVal[0]] : selectedVal[0]) : (full ? false : ''); + } + } + function setValue() { + var selValue = getValue(), selValueFull = getValue(true); + $select.data('value', selValue); + $select.data('valueFull', selValueFull); + options.onChange && options.onChange(selValue, selValueFull); + } + + function toggleDD(open) { + $select.toggleClass('open', open); + } + function addSelected(item, noupdate) { + var val = (item.prefix || '') + item.val; + if (!selectedMap[val]) { + if (!options.multiSelect) { + for (var i = 0; i < selectedVal.length; i++) { + delete selectedMap[selectedVal[i]]; + } + selectedVal = []; + } + else if (item.group) { + for (var i = selectedVal.length - 1; i >= 0; i--) { + if (selectedMap[selectedVal[i]].group == item.group) { + delete selectedMap[selectedVal[i]]; + selectedVal.splice(i, 1); + } + } + } + selectedVal.push(val); + selectedMap[val] = item; + if (!noupdate) { + setValue(); + updateSelected(); + } + } + } + function delSelected(val) { + if (selectedMap[val]) { + delete selectedMap[val]; + for (var i = 0; i < selectedVal.length; i++) { + if (selectedVal[i] == val) { + selectedVal.splice(i, 1); + break; + } + } + setValue(); + updateSelected(); + } + } + function clearSelected() { + for (var i = 0; i < selectedVal.length; i++) { + var val = selectedVal[i]; + delete selectedMap[val]; + } + selectedVal = []; + setValue(); + updateSelected(); + } + function updateSelected() { + var html = ''; + for (var i = 0; i < selectedVal.length; i++) { + var val = selectedVal[i]; + var item = selectedMap[val]; + html += options.renderSelectedItem ? options.renderSelectedItem(val, item) : '
' + item.name + '
'; + } + $('.selected-item', $selected).remove(); + $selected.prepend(html); + options.onUpdate && options.onUpdate(getValue(), getValue(true)); + } + + var initTextarea = null; + var isContentEditable = $field.is('[contenteditable]'); + if (isContentEditable) { + initTextarea = options.noSearch ? { + singleLine: true, + checkText: function() { return ''; } + } : { + singleLine: true + }; + } + $field.initSearch($.extend({ + $results: $results, + emptyQueryEnabled: true, + noCloseOnSelect: options.multiSelect, + updateOnInit: true, + renderItem: function(item) { + return '
' + item.name + '
'; + }, + prepareQuery: function(str) { + str = str.toLowerCase(); + if (options.searchByLastWord) { + str = str.split(/\s+/).pop(); + } + return str; + }, + onOpen: function() { + toggleDD(true); + }, + onClose: function() { + toggleDD(false); + } + }, options, { + getData: function() { + var data = options.getData(); + if (data === false) { + return false; + } + var filtered_data = []; + for (var i = 0; i < data.length; i++) { + if (data[i].hidden) continue; + var val = (data[i].prefix || '') + data[i].val; + if (!selectedMap[val] || !options.multiSelect) { + filtered_data.push(data[i]); + } + } + return filtered_data; + }, + onSelect: function(item) { + var newValue = ''; + if (options.searchByLastWord) { + var oldValue = $field.value(); + var lastWord = oldValue.split(/\s+/).pop(); + newValue = oldValue; + if (lastWord.length > 0) { + newValue = oldValue.substr(0, oldValue.length - lastWord.length); + } + newValue = newValue.replace(/^\s+/, ''); + } + $field.value(newValue); + addSelected(item); + if (options.multiSelect) { + $field.trigger('contentchange').focusAndSelect(); + } + }, + initTextarea: initTextarea + })); + if (options.noSearch) { + $select.addClass('no-search'); + } + if (!isContentEditable) { + $field.on('keydown.select', function(e) { + if (!e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey && + (e.which == Keys.BACKSPACE) && + this.selectionStart == this.selectionEnd && + !this.selectionStart) { + $(this).trigger('backspaceonleft'); + } + }); + } + var defValue = $select.defaultValue(); + var defSelected = defValue.length ? defValue.split(';') : [], dataMap = {}; + if (defSelected.length) { + var data = options.getData(); + if (data !== false) { + for (var i = 0; i < data.length; i++) { + var val = (data[i].prefix || '') + data[i].val; + dataMap[val] = data[i]; + } + } + for (var i = 0, item; i < defSelected.length; i++) { + if (item = dataMap[defSelected[i]]) { + addSelected(item, true); + } + } + } + $select.data('value', getValue()); + $select.data('valueFull', getValue(true)); + $select.on('selectval.select', function(e, val, clear) { + addSelected(val); + if (clear) { + $field.value(''); + } + $field.trigger('datachange'); + }); + $select.on('deselectval.select', function(e, val) { + delSelected(val); + $field.trigger('datachange'); + }); + $select.on('disableselect.select', function(e, disable) { + $select.toggleClass('select-disabled', disable); + $field.trigger('disable', [disable]); + }); + $select.on('reset.select', function(e) { + $('.selected-item', $selected).each(function() { + var val = $(this).attr('data-val'); + delSelected(val); + }); + $field.trigger('datachange'); + }); + $select.on('datachange', function(e) { + if (e.target === this) { + $field.trigger('datachange'); + } + }); + $field.on('backspaceonleft.select', function(e) { + if (options.focusSelectedBeforeDelete) { + var $focused = $('.selected-item.focused', $selected); + if ($focused.size() > 0) { + var val = $focused.eq(-1).attr('data-val'); + delSelected(val); + $field.trigger('datachange'); + } else { + $('.selected-item', $selected).eq(-1).addClass('focused'); + } + } else { + var $items = $('.selected-item', $selected); + if ($items.size() > 0) { + var val = $items.eq(-1).attr('data-val'); + delSelected(val); + $field.trigger('datachange'); + } + } + }); + $field.on('focus.select', function() { + $('.selected-item.focused', $selected).removeClass('focused'); + }); + $selected.on('click.select', '.selected-item', function(e) { + $('.selected-item.focused', $selected).removeClass('focused'); + $(this).addClass('focused'); + e.stopImmediatePropagation(); + }); + $selected.on('click.select', '.selected-item .close', function(e) { + var val = $(this).parents('.selected-item').attr('data-val'); + delSelected(val); + if (options.multiSelect) { + $field.trigger('datachange').focusAndSelectAll(); + } + e.stopImmediatePropagation(); + }); + $select.on('click.select', '.select-clear', function(e) { + if ($field.value().length > 0) { + $field.value('').trigger('input').focus(); + options.onClear && options.onClear(); + } else { + clearSelected(); + $field.focus(); + } + e.stopImmediatePropagation(); + }); + $select.on('click.select', function(e) { + if ($(e.target).is('.select')) { + $field.focus(); + } + }); + if ($select.hasClass('select-disabled')) { + $select.trigger('disableselect', [true]); + } + if (selectedVal.length) { + updateSelected(); + $field.trigger('datachange'); + } + $select.data('inited', true); + return this; + }); + }; + $.fn.destroySelect = function() { + return this.map(function() { + var $select = $(this); + var $field = $('.form-control', $select); + var $selected = $('.selected-items', $select); + $field.destroySearch(); + $field.off('.select'); + $selected.off('.select'); + return this; + }); + } + $.fn.hasField = function(name) { + return this.first().map(function() { + if (this.tagName == 'FORM') { + if (this[name]) { + return true; + } + return $('.input[data-name]', this).filter(function() { + return ($(this).attr('data-name') == name); + }).size() > 0; + } + return false; + }).get(0) || false; + }; + $.fn.field = function(name) { + return this.first().map(function() { + if (this.tagName == 'FORM') { + if (this[name]) { + return this[name]; + } + return $('.input[data-name],.select[data-name]', this).filter(function() { + return ($(this).attr('data-name') == name); + }).get(0); + } + }); + }; + $.fn.fieldEl = function(name) { + var result = []; + this.each(function() { + $(this).each(function() { + result.push(this); + }); + }); + return $(result); + }; + $.fn.fields = function() { + return this.first().map(function() { + if (this.tagName == 'FORM') { + var fields = {}; + for (var i = 0; i < this.elements.length; i++) { + var elem = this.elements[i]; + fields[elem.name] = elem.value; + } + return fields; + } + }).get(0) || {}; + }; + $.fn.reset = function(val) { + return this.each(function() { + if (this.tagName == 'FORM') { + this.reset(); + $('.input[data-name]', this).each(function() { + $(this).text($(this).attr('data-value')).trigger('input'); + }); + $('.select[data-name]', this).each(function() { + $(this).trigger('reset'); + }); + } + }); + }; + $.fn.scrollHeight = function() { + return this.first().map(function() { + return this.scrollHeight; + }).get(0) || ''; + }; + $.fn.defaultValue = function(val) { + if (typeof val !== 'undefined') { + return this.each(function() { + if (this.tagName == 'TEXTAREA' || this.tagName == 'INPUT') { + this.defaultValue = val; + } else { + $(this).attr('data-value', val); + } + }); + } + return this.first().map(function() { + if (this.tagName == 'TEXTAREA' || this.tagName == 'INPUT') { + return this.defaultValue || ''; + } else { + return $(this).attr('data-value') || ''; + } + }).get(0) || ''; + }; + $.fn.value = function(val) { + if (typeof val !== 'undefined') { + return this.each(function() { + if (this.tagName == 'TEXTAREA' || this.tagName == 'INPUT' || this instanceof RadioNodeList) { + this.value = val; + } else { + $(this).text(val).trigger('input'); + } + }); + } + return this.first().map(function() { + if (this.tagName == 'TEXTAREA' || this.tagName == 'INPUT' || this instanceof RadioNodeList) { + return this.value || ''; + } else { + return $(this).text() || ''; + } + }).get(0) || ''; + }; + $.fn.values = function(val) { + if (typeof val !== 'undefined') { + return this.value(val); + } + return this.map(function() { + if (this.tagName == 'TEXTAREA' || this.tagName == 'INPUT') { + return this.value || ''; + } else { + return $(this).text() || ''; + } + }).get() || []; + }; + + $.fn.initTextarea = function(options) { + options = options || {}; + + function getRangeText(range) { + var div = document.createElement('DIV'); + div.appendChild(range.cloneContents()); + return getText(div, true); + } + function isBlockEl(el) { + var blockTags = {ADDRESS: 1, ARTICLE: 1, ASIDE: 1, AUDIO: 1, BLOCKQUOTE: 1, CANVAS: 1, DD: 1, DIV: 1, DL: 1, FIELDSET: 1, FIGCAPTION: 1, FIGURE: 1, FIGURE: 1, FIGCAPTION: 1, FOOTER: 1, FORM: 1, H1: 1, H2: 1, H3: 1, H4: 1, H5: 1, H6: 1, HEADER: 1, HGROUP: 1, HR: 1, LI: 1, MAIN: 1, NAV: 1, NOSCRIPT: 1, OL: 1, OUTPUT: 1, P: 1, PRE: 1, SECTION: 1, TABLE: 1, TFOOT: 1, UL: 1, VIDEO: 1}; + // return (el.nodeType == el.ELEMENT_NODE && blockTags[el.tagName]); + if (el.nodeType == el.ELEMENT_NODE) { + var display = $(el).css('display'); + if (!display) return blockTags[el.tagName]; + return (display == 'block' || display == 'table' || display == 'table-row'); + } + return false; + } + function isMetadataEl(el) { + var metadataTags = {HEAD: 1, TITLE: 1, BASE: 1, LINK: 1, META: 1, STYLE: 1, SCRIPT: 1}; + return (el.nodeType == el.ELEMENT_NODE && metadataTags[el.tagName]); + } + function getText(el, safe_last_br) { + var child = el.firstChild, blocks = [], block = ''; + while (child) { + if (child.nodeType == child.TEXT_NODE) { + block += child.nodeValue; + } else if (child.nodeType == child.ELEMENT_NODE && !isMetadataEl(child)) { + if (child.tagName == 'BR') { + block += '\n'; + } else if (child.tagName == 'IMG') { + block += child.getAttribute('alt') || ''; + } else if (!isBlockEl(child)) { + block += getText(child); + } else { + if (block.length > 0) { + if (block.substr(-1) == '\n') { + block = block.slice(0, -1); + } + blocks.push(block); + block = ''; + } + blocks.push(getText(child, safe_last_br)); + } + } + child = child.nextSibling; + } + if (block.length > 0) { + if (!safe_last_br && block.substr(-1) == '\n') { + block = block.slice(0, -1); + } + blocks.push(block); + } + return blocks.join('\n'); + } + function getTextNodesIn(node) { + var textNodes = []; + if (node.nodeType == node.TEXT_NODE) { + textNodes.push(node); + } else { + for (var i = 0, len = node.childNodes.length; i < len; ++i) { + textNodes.push.apply(textNodes, getTextNodesIn(node.childNodes[i])); + } + } + return textNodes; + } + function editableClosest(el) { + while (el) { + if (el.nodeType == el.ELEMENT_NODE && + el.getAttribute('contenteditable') == 'true') { + return el; + } + el = el.parentNode; + } + return null; + } + function nonEditableClosest(el) { + while (el) { + if (el.tagName == 'MARK' && + el.getAttribute('contenteditable') == 'false') { + return el; + } + el = el.parentNode; + } + return null; + } + function setSelectionRange(el, start, end) { + var sel = window.getSelection(); + sel.removeAllRanges(); + var textNodes = getTextNodesIn(el); + var charCount = 0, endCharCount, i, textNode, node, offset, nonEditEl; + for (i = 0, charCount = 0; textNode = textNodes[i++]; ) { + endCharCount = charCount + textNode.length; + if (start >= charCount && (start < endCharCount || + (start == endCharCount && i <= textNodes.length))) { + if (nonEditEl = nonEditableClosest(textNode)) { + var range = document.createRange(); + if (start < end) range.setStartBefore(nonEditEl); + else range.setStartAfter(nonEditEl); + node = range.startContainer; + offset = range.startOffset; + } else { + node = textNode; + offset = start - charCount; + } + sel.collapse(node, offset); + break; + } + charCount = endCharCount; + } + if (start != end) { + for (i = 0, charCount = 0; textNode = textNodes[i++]; ) { + endCharCount = charCount + textNode.length; + if (end >= charCount && (end < endCharCount || + (end == endCharCount && i <= textNodes.length))) { + if (nonEditEl = nonEditableClosest(textNode)) { + var range = document.createRange(); + if (start < end) range.setStartAfter(nonEditEl); + else range.setStartBefore(nonEditEl); + node = range.startContainer; + offset = range.startOffset; + } else { + node = textNode; + offset = end - charCount; + } + sel.extend(node, offset); + break; + } + charCount = endCharCount; + } + } + } + function onKeyDown(e) { + if ((e.metaKey || e.ctrlKey) && !e.altKey && + e.which == 90) { // Z + e.preventDefault(); + if (e.shiftKey) { + redo(this); + } else { + undo(this); + } + } + else if ((e.metaKey || e.ctrlKey) && !e.shiftKey && !e.altKey && + e.which == 89) { // Y + e.preventDefault(); + redo(this); + } + else if (!e.shiftKey && !e.altKey && e.which == 13) { // Enter + if ((e.metaKey || e.ctrlKey) || $(this).data('textOptions').singleLine) { + e.preventDefault(); + $(this).parents('form').submit(); + } + } + else if ((e.metaKey || e.ctrlKey) && + !e.shiftKey && !e.altKey && e.which == 73 && + $(this).data('textOptions').allowTokens) { // I + e.preventDefault(); + $(this).data('$tokens').filter(':not(.used)').eq(0).trigger('click'); + } + else if (!e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey && + (e.which == Keys.LEFT || e.which == Keys.RIGHT || e.which == Keys.BACKSPACE)) { + var isLeft = e.which == Keys.LEFT || e.which == Keys.BACKSPACE; + var isBackspace = e.which == Keys.BACKSPACE; + var sel = window.getSelection(); + if (sel.isCollapsed && sel.focusNode) { + if (sel.focusNode.nodeType == sel.focusNode.TEXT_NODE) { + var newOffset = sel.focusOffset + (isLeft ? -1 : 1); + if (newOffset < 0) { + var prevNode = sel.focusNode.previousSibling; + if (prevNode && prevNode.nodeType == prevNode.ELEMENT_NODE) { + var range = document.createRange(); + range.setStartBefore(prevNode); + if (isBackspace) { + range.setEnd(sel.focusNode, sel.focusOffset); + range.deleteContents(); + $(sel.focusNode).closest('.input').trigger('input'); + } else { + sel.collapse(range.startContainer, range.startOffset); + } + e.preventDefault(); + } else { + if (isBackspace) { + $(sel.focusNode).closest('.input').trigger('backspaceonleft'); + } + } + } else if (newOffset > sel.focusNode.nodeValue.length) { + var nextNode = sel.focusNode.nextSibling; + if (nextNode.nodeType == nextNode.ELEMENT_NODE && nextNode.tagName != 'BR') { + var range = document.createRange(); + range.setStartAfter(nextNode); + if (!isBackspace) { + sel.collapse(range.startContainer, range.startOffset); + } + e.preventDefault(); + } + } + } + else if (sel.focusNode.nodeType == sel.focusNode.ELEMENT_NODE) { + var curNode = sel.focusNode.childNodes[sel.focusOffset]; + if (isLeft) { + var prevNode = curNode ? curNode.previousSibling : sel.focusNode.lastChild; + while (prevNode && + prevNode.nodeType == prevNode.TEXT_NODE && + !prevNode.nodeValue.length) { + prevNode = prevNode.previousSibling; + } + if (prevNode && prevNode.nodeType == prevNode.ELEMENT_NODE) { + if (isBackspace) { + var range = document.createRange(); + range.selectNode(prevNode); + range.deleteContents(); + $(sel.focusNode).closest('.input').trigger('input'); + } else { + sel.collapse(sel.focusNode, sel.focusOffset - 1); + } + e.preventDefault(); + } else if (prevNode && prevNode.nodeType == prevNode.TEXT_NODE) { + if (isBackspace) { + var range = document.createRange(); + range.setStart(prevNode, prevNode.nodeValue.length - 1); + range.setEnd(prevNode, prevNode.nodeValue.length); + range.deleteContents(); + $(sel.focusNode).closest('.input').trigger('input'); + } else { + sel.collapse(prevNode, prevNode.nodeValue.length - 1); + } + e.preventDefault(); + } else { + if (isBackspace) { + $(sel.focusNode).closest('.input').trigger('backspaceonleft'); + } + } + } else { + if (curNode && curNode.nodeType == curNode.ELEMENT_NODE && curNode.tagName != 'BR') { + sel.collapse(sel.focusNode, sel.focusOffset + 1); + e.preventDefault(); + } else if (curNode && curNode.nodeType == curNode.TEXT_NODE) { + sel.collapse(curNode, 1); + e.preventDefault(); + } + } + } + } + } + } + function getFieldRange(field) { + var sel = window.getSelection(); + if (sel.anchorNode && sel.focusNode) { + var rng = document.createRange(); + rng.setStart(field, 0); + rng.setEnd(sel.anchorNode, sel.anchorOffset); + var startOffset = getRangeText(rng).length; + rng.setEnd(sel.focusNode, sel.focusOffset); + var endOffset = getRangeText(rng).length; + return {startOffset: startOffset, endOffset: endOffset}; + } + var offset = field.childNodes.length; + if (field.lastChild && field.lastChild.tagName == 'BR') { + offset--; + } + return {startOffset: offset, endOffset: offset}; + } + function setFieldRange(field, fieldRange) { + if (fieldRange) { + setSelectionRange(field, fieldRange.startOffset, fieldRange.endOffset); + } + } + function onSetFocus() { + setFieldRange(this, $(this).data('prevSelRange')); + } + function update(field, text, fieldRange) { + var $field = $(field); + var tokens = $field.data('tokens'); + var options = $field.data('textOptions'); + if (options.checkText) { + text = options.checkText(text); + } + var html = cleanHTML(text), fhtml; + if (options.allowTokens) { + var avail_tokens = []; + $.each(tokens, function(i, value) { + avail_tokens[i] = cleanHTML(value); + }); + var avail_count = tokens.length; + var $tokens = $field.data('$tokens'); + if (avail_count > 0) { + html = html.replace(TOKEN_REGEX, function(s) { + var i = avail_tokens.indexOf(s); + if (i >= 0) { + avail_tokens[i] = null; + avail_count--; + var $token = $tokens.eq(i); + if (!$token.hasClass('used')) { + $token.prepareSlideX().addClass('used'); + } + return '' + s + ''; + } else { + return s; + } + }); + $tokens.each(function(i) { + if (avail_tokens[i] !== null) { + var $token = $(this); + if ($token.hasClass('used')) { + $token.prepareSlideX().removeClass('used'); + } + } + }); + } + $tokens.parents('.key-add-tokens-wrap').toggleClass('empty', !avail_count) + } + if (options.allowEmoji && options.emojiRE) { + html = html.replace(options.emojiRE, function(s) { + return '' + EmojiSearch.emojiHtml(s) + ''; + }); + } + html = html.split(getBR()).join('\n'); + if (options.singleLine) { + html = html.replace(/^\n+|\n+$/g, '').replace(/\n+/g, ' '); + } + fhtml = $field.html(); + if (fhtml === html) { + $field.append('
').toggleClass('empty', !$field.text().length); + return; + } + if (fhtml === html + getBR()) { + $field.toggleClass('empty', !$field.text().length); + return; + } + + fieldRange = fieldRange || getFieldRange(field); + $field.html(html + getBR()).toggleClass('empty', !$field.text().length); + setFieldRange(field, fieldRange); + } + function onInput() { + var field = this; + var $field = $(this); + var text = getText(field); + update(field, text); + + var history = $field.data('history'); + var fieldRange = getFieldRange(field); + var prevSelRange = $field.data('prevSelRange'); + var time = +(new Date); + history.list = history.index >= 0 ? history.list.slice(0, history.index + 1) : []; + if (history.index >= 0 && history.list[history.index]) { + var entry = history.list[history.index]; + if (entry.text == text) { + return; + } + if (time - entry.time < 1000 && + entry.redoSel.startOffset == entry.redoSel.endOffset && + (entry.text.length - entry.redoSel.endOffset) == + (text.length - fieldRange.endOffset)) { + entry.text = text; + entry.redoSel = fieldRange; + return; + } + entry.undoSel = prevSelRange; + } + history.list.push({text: text, redoSel: fieldRange, time: time}); + history.index++; + } + function undo(field) { + var $field = $(field); + var history = $field.data('history'); + if (history.index > 0) { + history.index--; + var entry = history.list[history.index]; + update(field, entry.text, entry.undoSel); + } + } + function redo(field) { + var $field = $(field); + var history = $field.data('history'); + if (history.index < history.list.length - 1) { + history.index++; + var entry = history.list[history.index]; + update(field, entry.text, entry.redoSel); + } + } + function onSelectionChange() { + $(this).data('prevSelRange', getFieldRange(this)); + var sel = window.getSelection(); + if (sel.isCollapsed) { + var nonEditEl; + if (nonEditEl = nonEditableClosest(sel.focusNode)) { + var range = document.createRange(); + if (sel.focusOffset < $(nonEditEl).text().length / 2) { + range.setStartBefore(nonEditEl); + } else { + range.setStartAfter(nonEditEl); + } + sel.collapse(range.startContainer, range.startOffset); + } + else if (sel.focusNode === this && sel.focusOffset == this.childNodes.length && this.lastChild && this.lastChild.nodeType == 'BR') { + sel.collapse(this, this.childNodes.length - 1); + } + else if (sel.focusNode.nodeType == sel.focusNode.TEXT_NODE && sel.focusOffset == sel.focusNode.nodeValue.length) { + var range = document.createRange(); + range.setStartAfter(sel.focusNode); + sel.collapse(range.startContainer, range.startOffset); + } + } + } + + if (!$(document).data('selectionchange_inited')) { + $(document).data('selectionchange_inited', true); + document.execCommand('autoUrlDetect', false, false); + $(document).on('selectionchange', function() { + var sel = window.getSelection(); + var anchorField, focusField; + var field, offset; + if (sel.anchorNode && (anchorField = editableClosest(sel.anchorNode))) { + $(anchorField).triggerHandler('selectionchange'); + } + if (sel.focusNode && (focusField = editableClosest(sel.focusNode)) && + anchorField != focusField) { + $(focusField).triggerHandler('selectionchange'); + } + if (!sel.focusNode && + document.activeElement && + document.activeElement.getAttribute('contenteditable') == 'true') { + field = document.activeElement; + offset = field.childNodes.length; + if (field.lastChild.tagName == 'BR') { + offset--; + } + sel.collapse(field, offset); + } + }); + } + + return this.each(function() { + var field = this; + var $field = $(field); + var textOptions = $.extend({}, options); + if ($field.data('inited')) { + return; + } + $field.attr('contenteditable', 'true'); + $field.data('textOptions', textOptions); + + function insertTag(e) { + e.preventDefault(); + document.execCommand('insertText', false, $(this).attr('data-token')); + $field.focus(); + } + + $field.data('history', {list: [], index: -1}); + + if (options.allowTokens) { + var tokens_attr = $field.attr('data-tokens'); + var tokens = tokens_attr ? tokens_attr.split(' ') : []; + + var $tokensBtns = $('
'); + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i] = tokens[i].replace('\xa0', ' '); + var $token = $(''); + $token.attr('data-token', token).appendTo($tokensBtns); + } + var ua = navigator.userAgent || '', + is_mac = ua.indexOf('Mac') >= 0 || + ua.indexOf('AppleWebKit') >= 0 && + /Mobile\/\w+/.test(ua); + var shortcut = is_mac ? '⌘I' : 'Ctrl+I'; + $tokensBtns.attr('data-shortcut', shortcut).wrap('
').parent().wrap('
').parent().toggleClass('empty', !tokens.length).insertAfter($field); + var $tokens = $('.field-ins-btn', $tokensBtns); + $tokens.on('click.tr-textarea', insertTag); + $field.data('$tokens', $tokens); + $field.data('tokens', tokens); + } + if ($field.is('[data-single-line]')) { + textOptions.singleLine = true; + } + if ($field.is('[data-value]')) { + $field.value($field.defaultValue()); + } else { + $field.defaultValue($field.value()); + } + + $field.on('selectionchange.tr-textarea', onSelectionChange); + $field.on('keydown.tr-textarea', onKeyDown); + $field.on('input.tr-textarea', onInput); + $field.on('setfocus.tr-textarea', onSetFocus); + $field.trigger('input'); + $field.data('inited', true); + }); + + }; + $.fn.destroyTextarea = function() { + return this.off('.tr-textarea').each(function() { + $(this).data('inited', false); + var $tokens = $(this).data('$tokens'); + if ($tokens) { + $tokens.off('.tr-textarea'); + } + }); + }; + + $.fn.blockBodyScroll = function() { + function onResultsMouseWheel(e) { + var d = e.originalEvent.wheelDelta; + if((this.scrollTop === (this.scrollHeight - this.clientHeight) && d < 0) || + (this.scrollTop === 0 && d > 0)) { + e.preventDefault(); + } + } + return this.on('mousewheel', onResultsMouseWheel); + }; + + $.fn.initAutosize = function() { + return this.map(function(){ autosize(this); return this; }); + }; + + $.fn.updateAutosize = function() { + return this.map(function(){ autosize.update(this); return this; }); + }; + + $.fn.destroyAutosize = function() { + return this.map(function(){ autosize.destroy(this); return this; }); + }; + +})(jQuery); + +function getBR() { + if (window._brHTML) return window._brHTML; + return window._brHTML = $('

').html(); +} + +function cleanHTML(value) { + return value.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/\n/g, getBR()); +} +function uncleanHTML(value) { + return $('
').html(value).text(); +} +function cleanRE(value) { + return value.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&"); +} +function wrapHighlight(value, highlight, wrap_tag, prefix_only) { + value = cleanHTML(value); + if (highlight) { + var pattern = cleanRE(cleanHTML(highlight)); + if (prefix_only) { + pattern = '^' + pattern; + } + value = value.replace(new RegExp(pattern, 'gi'), '$&<\/strong>'); + } + if (wrap_tag) { + value = value.replace(TOKEN_REGEX, '$&'); + } + return value; +} +function wrapSize(size) { + if (size < 1024) { + return size + ' B'; + } else if (size < 1048576) { + return (Math.round(size * 10 / 1024.0) / 10) + ' KB'; + } else if (size < 1073741824) { + return (Math.round(size * 10 / 1048576.0) / 10) + ' MB'; + } else { + return (Math.round(size * 10 / 1073741824.0) / 10) + ' GB'; + } +} +function dataUrlToBlob(url) { + try { + var match = null; + if (match = url.match(/^data:(image\/gif|image\/jpe?g|image\/png|video\/mp4);base64,(.*)$/)) { + var type = match[1], b64 = match[2]; + var binary = atob(b64); + var array = []; + for(var i = 0; i < binary.length; i++) { + array.push(binary.charCodeAt(i)); + } + return new Blob([new Uint8Array(array)], {type: type}); + } + } catch (e) {} + return false; +} +function copyToClipboard(str) { + var $text = $(' +
+
+ + +
+
+ + +
+
+ +
+
+ +
+ + + + + + + + + + + + + + diff --git a/data/translations.telegram.org.html b/data/translations.telegram.org.html new file mode 100644 index 0000000000..1f73469799 --- /dev/null +++ b/data/translations.telegram.org.html @@ -0,0 +1,297 @@ + + + + + Translations + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+

Translating Telegram

+ +
+ +
+ +

We've worked hard to make Telegram's English version as smooth as possible in terms of language. Now we're looking for equally smooth translations into the rest of the world's languages. If you're a linguist, pro translator or language geek and would like to help us get closer to perfection, you've come to the right place.

+

Start Translating

+ +

The Interface

+

To get started, simply log in, find a phrase in your language that you can improve and suggest a new translation – or vote for an existing suggestion. As soon as your suggestions are reviewed and accepted, the new phrases become immediately available in Telegram apps, no updates required.

+

Official Translations

+

We're gradually expanding the list of languages available to all users from the “Language” menu in their apps. If you would like to help us maintain the official translation to your language on a continuous basis, see this page.

+
+

Style Guide

+

We think a good translation should be:

+
1. Consistent
+

The same things need to have the same names everywhere. Not just within one app, but also on all platforms. Telegram features should have the same names on Android, iOS, Windows and macOS – unless they have to do with platform defaults. For system features, we should always use platform defaults (unless they are truly ugly or don't fit).

+
2. Natural
+

You don't have to always stick to the English original. Sometimes it makes more sense to simply describe what the app does in your own language.

+

But please don't get carried away:

+
3. Default
+

It's no longer 2001 and our users have seen many other apps. It will be much easier for them to use Telegram if familiar concepts have familiar names here. Whenever you're looking for a word, focus on those that people are used to seeing in relevant context. What does Apple use in this case? What does Google use? What do Telegram's main competitors in your region use?

+
4. Beautiful
+

Use good language that would make the app look as if it was built in your region. Respect your language's grammar and style where possible. Avoid abbreviations. Try to find ways around gender problems instead of going for things like o(a), unless the workaround looks even more awkward. In most cases it's possible to find a way of saying anything without hurting the language.

+
5. And it MUST FIT
+

This last one is never easy. Sometimes you need to look to the surrounding phrases and change them for the problematic phrase to fit and work.

+
+

An example: the German team couldn't make the secret chats description fit into the lines on an empty chat page. The English text says: 'A user has invited you to a secret chat. Secret chats:' then comes a list that has this item: 'use end-to-end encryption'. The maximum length for the list items is 25 characters. The problem with German is that the term for end-to-end encryption is 'Ende-zu-Ende Verschlüsselung' and is 28 characters long even without the 'use'. An anglicized version would have been 'End-to-end Verschlüsselung' — but it's still too long at 26 characters.

+

The German team found a workaround. They went and changed the first phrase, so that it now says 'A user has invited you to an end-to-end encrypted secret chat. Secret chats:' and then they came up with a new list item to replace the E2E encryption one, which was moved to the top - where there was enough room.

+
+
+

Typography

+

What we're looking for is not just linguistic, but also typographic and aesthetic correctness. The text is inseparable from design. Text is design and we need to make sure it works. So approach the text as a magazine editor would:

+
    +
  1. Everything must fit into its allotted space. So always check in-app after editing. Words and phrases that are too long will be automatically cut (Like thi…) or contracted (Li…is) — we can't allow this to happen. In other cases the text may flow over into the next line.
  2. +
  3. The text should ideally be kept from spreading over two lines where the original only has one line.
  4. +
  5. Same with double lines, try to avoid letting them spread into triple lines. Although this is a less strict requirement — it isn't too bad if you let the double-line descriptions in Settings become triple lined.
  6. +
  7. We need to avoid hanging words when there's just one or two words left on a new line.
  8. +
  9. We need to avoid gaps in the text, for example when the top right space is empty before the line break. A good way of avoiding this is to use shorter words, so that they wrap more easily. When short words are not an option, put your long ones at the beginning of the line, then add short words as padding.
  10. +
  11. There will be times when making things fit will seem impossible. Our experience shows that it never is. Several determined people focusing on a word and the phrases around it will always find a solution after a few weeks, or even earlier. After all, it's just words.
  12. +
+

This takes some effort, but it really makes you feel proud when you're done.

+
+

Applied Typography

+

On the whole, we've worked hard to make the English version as typographically sound as possible. So as a rule of thumb, if your phrase is the same length as the English one, it will fit well. If it is shorter — not too much of a problem, but beware of hanging words and gaps.

+

Note for iPhone Plus users: When checking strings in-app, try iOS Settings > Display & Brightness > View > 'Zoomed'. Using this mode you can make sure that strings will fit the screens of the narrower models.

+
+

And that‘s about it. Let’s bring perfection to the localized versions of Telegram, together.

+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/data/translations.telegram.org/en.html b/data/translations.telegram.org/en.html new file mode 100644 index 0000000000..b4256170ae --- /dev/null +++ b/data/translations.telegram.org/en.html @@ -0,0 +1,333 @@ + + + + + Translations + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+
+

+ English (English) + +

+
+ +
+
+

DiscussionsNEW

+

+ Feel free to join the discussion of this language pack. + View Discussion +

+
+
+

Sharing LinkNEW

+

+ Anyone can switch their Telegram interface to English by following this link: +

+ +
+
+

Actions

+ +
+
+
+ +
English
+
English
+
Please open this link on a desktop to help translate Telegram into English:
+ + +
Feel free to join the discussion of this language pack.
+
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/data/translations.telegram.org/en/android.html b/data/translations.telegram.org/en/android.html new file mode 100644 index 0000000000..5de43e674a --- /dev/null +++ b/data/translations.telegram.org/en/android.html @@ -0,0 +1,388 @@ + + + + + Translations + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+

+ Android4364 + +

+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/data/translations.telegram.org/en/android_x.html b/data/translations.telegram.org/en/android_x.html new file mode 100644 index 0000000000..a5617557bb --- /dev/null +++ b/data/translations.telegram.org/en/android_x.html @@ -0,0 +1,388 @@ + + + + + Translations + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+

+ Android X3559 + +

+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/data/translations.telegram.org/en/ios.html b/data/translations.telegram.org/en/ios.html new file mode 100644 index 0000000000..8bc905a497 --- /dev/null +++ b/data/translations.telegram.org/en/ios.html @@ -0,0 +1,388 @@ + + + + + Translations + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+

+ iOS5114 + +

+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/data/translations.telegram.org/en/macos.html b/data/translations.telegram.org/en/macos.html new file mode 100644 index 0000000000..9ff841be01 --- /dev/null +++ b/data/translations.telegram.org/en/macos.html @@ -0,0 +1,388 @@ + + + + + Translations + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+

+ macOS3645 + +

+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/data/translations.telegram.org/en/tdesktop.html b/data/translations.telegram.org/en/tdesktop.html new file mode 100644 index 0000000000..af5ff9e77b --- /dev/null +++ b/data/translations.telegram.org/en/tdesktop.html @@ -0,0 +1,388 @@ + + + + + Translations + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+

+ TDesktop2916 + +

+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + +