From 70983930af22c49fe4d173572015c4237dbc914f Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 14 Feb 2022 18:56:04 +0000 Subject: [PATCH] Update content of files --- data/core.telegram.org/api/push-updates.html | 1009 ----------------- data/core.telegram.org/api/srp.html | 307 ----- .../constructor/botInlineMessageText.html | 170 --- .../inputMessageEntityMentionName.html | 162 --- .../inputPaymentCredentialsSaved.html | 152 --- .../constructor/inputUserFromMessage.html | 160 --- .../tdlib/getting-started.html | 198 ---- data/core.telegram.org/type/EmojiURL.html | 162 --- .../constructor/botInfo.html | 157 --- .../decryptedMessageMediaAudio.html | 174 --- .../constructor/updateBotCommands.html | 159 --- 11 files changed, 2810 deletions(-) delete mode 100644 data/core.telegram.org/api/push-updates.html delete mode 100644 data/core.telegram.org/api/srp.html delete mode 100644 data/core.telegram.org/constructor/botInlineMessageText.html delete mode 100644 data/core.telegram.org/constructor/inputMessageEntityMentionName.html delete mode 100644 data/core.telegram.org/constructor/inputPaymentCredentialsSaved.html delete mode 100644 data/core.telegram.org/constructor/inputUserFromMessage.html delete mode 100644 data/core.telegram.org/tdlib/getting-started.html delete mode 100644 data/core.telegram.org/type/EmojiURL.html delete mode 100644 data/corefork.telegram.org/constructor/botInfo.html delete mode 100644 data/corefork.telegram.org/constructor/decryptedMessageMediaAudio.html delete mode 100644 data/corefork.telegram.org/constructor/updateBotCommands.html diff --git a/data/core.telegram.org/api/push-updates.html b/data/core.telegram.org/api/push-updates.html deleted file mode 100644 index 0deaeb8156..0000000000 --- a/data/core.telegram.org/api/push-updates.html +++ /dev/null @@ -1,1009 +0,0 @@ - - - - - Handling PUSH-notifications - - - - - - - - - - - - - -
- -
-
-
- -

Handling PUSH-notifications

- -
- -

Configuring the application

-

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

-

Subscribing to notifications

-

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

-

The following modes are supported:

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

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

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

Notification encryption

-

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

-

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

-

Example implementation.

-

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

-

Notification structure

-

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

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

Each notification has several parameters that describe it.

-

Notification type

-

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

-

Notification text arguments

-

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

-

Custom parameters

-

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

-

Sound

-

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

-

User id

-

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

-

Processing notifications

-

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

-

Service notifications

-

The following notifications can be used to update app settings.

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

Possible Notifications

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeTemplate exampleArgumentsExtra custom arguments
AUTH_REGIONNew login from unrecognized device {1}, location: {2}1. Device name
2. Location
 
AUTH_UNKNOWNNew login from unrecognized device {1}1. Device name 
CHANNEL_MESSAGES{1} posted an album1. Message authorattachb64: Base64-encoded version of the attached media (related to the first message)
channel_id: Channel/supergroup identifier (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
CHANNEL_MESSAGE_AUDIO{1} posted a voice message1. Message authorattachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_CONTACT{1} posted a contact {2}1. Message author
2. Contact name
attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_DOC{1} posted a file1. Message authorattachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_DOCS{1} posted {2} files1. Channel name
2. Number of documents that were posted
attachb64: Base64-encoded version of the attached media (related to the first message)
channel_id: Channel/supergroup identifier (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
CHANNEL_MESSAGE_FWDS{1} posted {2} forwarded messages1. Message author
2. Number of forwarded messages
attachb64: Base64-encoded version of the attached media (related to the first message)
channel_id: Channel/supergroup identifier (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
CHANNEL_MESSAGE_GAME{1} invited you to play {2}1. Message author
2. Game name
attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_GAME_SCORE{1} scored {3} in game {2}1. User
2. Game name
3. Score
attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_GEO{1} posted a location1. Channel nameattachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_GEOLIVE{1} posted a live location1. Channel nameattachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_GIF{1} posted a GIF1. Channel nameattachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_NOTEXT{1} posted a message1. Channel nameattachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_PHOTO{1} posted a photo1. Channel nameattachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_PHOTOS{1} posted {2} photos1. Channel name
2. Number of photos that was sent
attachb64: Base64-encoded version of the attached media (related to the first message)
channel_id: Channel/supergroup identifier (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
CHANNEL_MESSAGE_PLAYLIST{1} posted {2} music files1. Channel name
2. Number of audio files that were posted
attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_POLL{1} posted a poll {2}1. Channel name
2. Poll name
attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_QUIZ{1} posted a quiz {2}1. Channel name
2. Quiz name
attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_ROUND{1} posted a video message1. Channel nameattachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_STICKER{1} posted a {2} sticker1. Channel name
2. Sticker emoji
attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_TEXT{1}: {2}1. Channel name
2. Message body
attachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_VIDEO{1} posted a video1. Channel nameattachb64: Base64-encoded version of the attached media
channel_id: Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHANNEL_MESSAGE_VIDEOS{1} posted {2} videos1. Channel name
2. Number of videos that were posted
attachb64: Base64-encoded version of the attached media (related to the first message)
channel_id: Channel/supergroup identifier (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
CHAT_ADD_MEMBER{1} invited {3} to the group {2}1. Message author
2. Chat name
3. New participant name
chat_id: chat identifier
CHAT_ADD_YOU{1} invited you to the group {2}1. User name
2. Group name
chat_id: chat identifier
CHAT_CREATED{1} invited you to the group {2}1. Message author
2. Chat name
chat_id: chat identifier
CHAT_DELETE_MEMBER{1} removed {3} from the group {2}1. Message author
2. Chat name
3. Dropped participant name
chat_id: chat identifier
CHAT_DELETE_YOU{1} removed you from the group {2}1. Message author
2. Chat name
chat_id: chat identifier
CHAT_JOINED{1} joined the group {2}1. User name
2. Group name
chat_id: chat identifier
CHAT_LEFT{1} left the group {2}1. Message author
2. Chat name
chat_id: chat identifier
CHAT_MESSAGES{1} sent an album to the group {2}1. User name
2. Group name
chat_from_id: Message author identifier
chat_id: chat identifier
mention: Whether the user was mentioned in the message
CHAT_MESSAGE_AUDIO{1} sent a voice message to the group {2}1. Message author
2. Chat name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_CONTACT{1} shared a contact {3} in the group {2}1. User name
2. Group name
3. Contact name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_DOC{1} sent a file to the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_DOCS{1} sent {3} files to the group {2}1. User name
2. Group name
3. Number of documents that were sent
attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
chat_id: Chat identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
CHAT_MESSAGE_FWDS{1} forwarded {3} messages to the group {2}1. User name
2. Group name
3. Number of messages that were forwarded
attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
chat_id: Chat identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
CHAT_MESSAGE_GAME{1} invited the group {2} to play {3}1. User name
2. Group name
3. Game name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_GAME_SCORE{1} scored {4} in game {3} in the group {2}1. User name
2. Group name
3. Game name
4. Score
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_GEO{1} sent a location to the group {2}1. Message author
2. Chat name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_GEOLIVE{1} shared a live location with the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_GIF{1} sent a GIF to the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_INVOICE{1} sent an invoice to the group {2} for {3}1. User name
2. Group name
3. Product name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_NOTEXT{1} sent a message to the group {2}1. Message author
2. Chat name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_PHOTO{1} sent a photo to the group {2}1. Message author
2. Chat name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_PHOTOS{1} sent {3} photos to the group {2}1. User name
2. Group name
3. Number of photos that were sent
attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
chat_id: Chat identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
CHAT_MESSAGE_PLAYLIST{1} sent {3} music files to the group {2}1. User name
2. Group name
3. Number of audio files that were sent
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_POLL{1} sent a poll {3} to the group {2}1. User name
2. Group name
3. Poll name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_QUIZ{1} sent a quiz {3} to the group {2}1. User name
2. Group name
3. Quiz name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_ROUND{1} sent a video message to the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_STICKER{1} sent a {3} sticker to the group {2}1. User name
2. Group name
3. Sticker emoji
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_TEXT{1} @ {2}: {3}1. Message author
2. Chat name
3. Message body
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_VIDEO{1} sent a video to the group {2}1. Message author
2. Chat name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
chat_id: Chat identifier
edit_date: When was the message last edited
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
CHAT_MESSAGE_VIDEOS{1} sent {3} videos to the group {2}1. User name
2. Group name
3. Number of videos that were sent
attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
chat_id: Chat identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
CHAT_PHOTO_EDITED{1} changed the group photo for {2}1. Message author
2. Chat name
chat_from_id: Message author identifier
chat_id: chat identifier
msg_id: ID of the message
CHAT_RETURNED{1} returned to the group {2}1. Message author
2. Chat name
chat_id: chat identifier
CHAT_TITLE_EDITED{1} renamed the group {2}1. User name
2. Group name
chat_id: chat identifier
CHAT_VOICECHAT_END{1} ended a voice chat in the group {2}1. User name
2. Chat name
 
CHAT_VOICECHAT_INVITE{1} invited {3} to a voice chat in the group {2}1. User name
2. Chat name
3. Invited users
 
CHAT_VOICECHAT_INVITE_YOU{1} invited you to a voice chat in the group {2}1. User name
2. Chat name
 
CHAT_VOICECHAT_START{1} started a voice chat in the group {2}1. User name
2. Chat name
 
CONTACT_JOINED{1} joined Telegram!1. Contact namecontact_id: contact identifier
ENCRYPTED_MESSAGEYou have a new message encryption_id: secret chat identifier
random_id: message identifier
ENCRYPTION_ACCEPTYou have a new message encryption_id: secret chat identifier
ENCRYPTION_REQUESTYou have a new message encryption_id: secret chat identifier
LOCKED_MESSAGEYou have a new message  
MESSAGES{1} sent you an album1. User namefrom_id: author identifier
MESSAGE_ANNOUNCEMENT{1}1. Announcementannouncement: Announcement: roughly equivalent to a message received from the service notifications (Telegram Notifications, id 777000) user, but must be delivered via push notifications, without contacting the API.
MESSAGE_AUDIO{1} sent you a voice message1. Message authorattachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_CONTACT{1} shared a contact {2} with you1. User name
2. Contact name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_DOC{1} sent you a file1. User nameattachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_DOCS{1} sent you {2} files1. User name
2. Number of documents that were sent
attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
from_id: Author identifier (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
MESSAGE_FWDS{1} forwarded you {2} messages1. User name
2. Number of messages that were forwarded
attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
from_id: Author identifier (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
MESSAGE_GAME{1} invited you to play {2}1. User name
2. Game name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_GAME_SCORE{1} scored {3} in game {2}1. User name
2. Game name
3. Score
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_GEO{1} sent you a location1. Message authorattachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_GEOLIVE{1} sent you a live location1. User nameattachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_GIF{1} sent you a GIF1. User nameattachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_INVOICE{1} sent you an invoice for {2}1. User name
2. Product
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_NOTEXT{1} sent you a message1. Message authorattachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_PHOTO{1} sent you a photo1. Message authorattachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_PHOTOS{1} sent you {2} photos1. User name
2. Number of photos that were sent
attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
from_id: Author identifier (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
MESSAGE_PHOTO_SECRET{1} sent you a self-destructing photo1. User nameattachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_PLAYLIST{1} sent you {2} music files1. User name
2. Number of audio files that were sent
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_POLL{1} sent you a poll {2}1. User name
2. Poll name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_QUIZ{1} sent you a quiz {2}1. User name
2. Quiz name
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_ROUND{1} sent you a video message1. User nameattachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_SCREENSHOT{1} took a screenshot1. User nameattachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_STICKER{1} sent you a {2} sticker1. User name
2. Sticker emoji
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_TEXT{1}: {2}1. Message author
2. Message body
attachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_VIDEO{1} sent you a video1. Message authorattachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
MESSAGE_VIDEOS{1} sent you {2} videos1. User name
2. Number of videos that were sent
attachb64: Base64-encoded version of the attached media (related to the first message)
chat_from_id: Groups only, message author identifier (related to the first message)
edit_date: When was the message last edited (related to the first message)
from_id: Author identifier (related to the first message)
mention: Whether the user was mentioned in the message (related to the first message)
msg_id: ID of the message (related to the first message)
silent: Whether the message was posted silently (no notification should be issued) (related to the first message)
MESSAGE_VIDEO_SECRET{1} sent you a self-destructing video1. User nameattachb64: Base64-encoded version of the attached media
chat_from_id: Groups only, message author identifier
edit_date: When was the message last edited
from_id: Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
scheduled: Whether this is a scheduled message
silent: Whether the message was posted silently (no notification should be issued)
PHONE_CALL_MISSEDYou missed a call from {1}1. User name 
PHONE_CALL_REQUEST{1} is calling you!1. User namecall_ah: Call access hash
call_id: Call ID
PINNED_AUDIO{1} pinned a voice message1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_AUDIO{1} pinned a voice message in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_CONTACT{1} pinned a contact {2}1. User name
2. Contact name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_CONTACT{1} pinned a contact {3} in the group {2}1. User name
2. Group name
3. Contact name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_DOC{1} pinned a file1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_DOC{1} pinned a file in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GAME{1} pinned a game1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GAME{1} pinned a game in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GAME_SCORE{1} pinned a game score1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GAME_SCORE{1} pinned a game score in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GEO{1} pinned a map1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GEO{1} pinned a map in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GEOLIVE{1} pinned a live location1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GEOLIVE{1} pinned a live location in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GIF{1} pinned a GIF1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_GIF{1} pinned a GIF in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_INVOICE{1} pinned an invoice1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_INVOICE{1} pinned an invoice in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_NOTEXT{1} pinned a message1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_NOTEXT{1} pinned a message in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_PHOTO{1} pinned a photo1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_PHOTO{1} pinned a photo in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_POLL{1} pinned a poll {2}1. User name
2. Poll name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_POLL{1} pinned a poll {3} in the group {2}1. User name
2. Group name
3. Poll name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_QUIZ{1} pinned a quiz {2}1. User name
2. Quiz name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_QUIZ{1} pinned a quiz {3} in the group {2}1. User name
2. Group name
3. Quiz name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_ROUND{1} pinned a video message1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_ROUND{1} pinned a video message in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_STICKER{1} pinned a {2} sticker1. User name
2. Sticker emoji
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_STICKER{1} pinned a {3} sticker in the group {2}1. User name
2. Group name
3. Sticker emoji
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_TEXT{1} pinned "{2}"1. User name
2. Message body
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_TEXT{1} pinned "{3}" in the group {2}1. User name
2. Group name
3. Message body
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_VIDEO{1} pinned a video1. User nameattachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
PINNED_VIDEO{1} pinned a video in the group {2}1. User name
2. Group name
attachb64: Base64-encoded version of the attached media
channel_id: For channels and supergroups, Channel/supergroup identifier
chat_from_id: Groups only, message author identifier
chat_id: For chats, Chat identifier
edit_date: When was the message last edited
from_id: For PMs, Author identifier
mention: Whether the user was mentioned in the message
msg_id: ID of the message
silent: Whether the message was posted silently (no notification should be issued)
- -
- -
-
- -
- - - - - - - - diff --git a/data/core.telegram.org/api/srp.html b/data/core.telegram.org/api/srp.html deleted file mode 100644 index 7ea2c7a89e..0000000000 --- a/data/core.telegram.org/api/srp.html +++ /dev/null @@ -1,307 +0,0 @@ - - - - - Two-factor authentication - - - - - - - - - - - - - -
- -
-
-
- -

Two-factor authentication

- -
- -

Telegram uses the Secure Remote Password protocol version 6a to implement 2FA.

-

Example impementation: tdlib.

-

Checking the password with SRP

-

To login to an account protected by a 2FA password or to perform some other actions (like changing channel owner), you will need to verify the user's knowledge of the current 2FA account password.

-

To do this, first the client needs to obtain SRP parameters and the KDF algorithm to use to check the validity of the password via account.getPassword method. For now, only the passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow algorithm is supported, so we'll only explain that.

-

Then, after the user provides a password, the client should generate an InputCheckPasswordSRP object using SRP and a specific KDF algorithm as shown below and pass it to appropriate method (e.g. auth.checkPassword in case of authorization).

-

This extension of the SRP protocol uses the password-based PBKDF2 with 100000 iterations using sha512 (PBKDF2HMACSHA512iter100000). -PBKDF2 is used to additionally rehash the x parameter, obtained using a method similar to the one described in RFC 2945 (H(s | H ( I | password | I) | s) instead of H(s | H ( I | ":" | password)) (see below).

-

Here, | denotes concatenation and + denotes the arithmetical operator +. -In all cases where concatenation of numbers passed to hashing functions is done, the numbers must be used in big-endian form, padded to 2048 bits; all maths is modulo p. -Instead of I, salt1 will be used (see SRP protocol). -Instead of s, salt2 will be used (see SRP protocol).

-

The main hashing function H is sha256:

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

The salting hashing function SH is defined as follows:

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

The primary password hashing function is defined as follows:

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

The secondary password hashing function is defined as follows:

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

Client-side, the following parameters are extracted from the passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow object, contained in the account.password object.

-
    -
  • -

    g := algo.g

    -
  • -
  • -

    p := algo.p -The client is expected to check whether p is a safe 2048-bit prime (meaning that both p and (p-1)/2 are prime, and that 2^2047 < p < 2^2048), and that g generates a cyclic subgroup of prime order (p-1)/2, i.e. is a quadratic residue mod p. Since g is always equal to 2, 3, 4, 5, 6 or 7, this is easily done using quadratic reciprocity law, yielding a simple condition on p mod 4g -- namely, p mod 8 = 7 for g = 2; p mod 3 = 2 for g = 3; no extra condition for g = 4; p mod 5 = 1 or 4 for g = 5; p mod 24 = 19 or 23 for g = 6; and p mod 7 = 3, 5 or 6 for g = 7. After g and p have been checked by the client, it makes sense to cache the result, so as to avoid repeating lengthy computations in future. This cache might be shared with one used for Authorization Key generation.

    -

    If the client has an inadequate random number generator, it makes sense to use the secure_random of account.password as additional seed.

    -
  • -
  • -

    password := (user-provided password)

    -
  • -
  • -

    salt1 := algo.salt1

    -
  • -
  • -

    salt2 := algo.salt2

    -
  • -
  • -

    g_b := srp_B -srp_B and srp_id are extracted from the account.password object.

    -
  • -
-

The k parameter is generated, both on client and server:

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

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

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

The final parameters are generated client-side only:

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

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

-

A final shared param is generated, for commodity:

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

Finally, the key exchange process starts on both parties.

-

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

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

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

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

Finally, the SRP session keys are generated:

-

Client side:

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

Server side:

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

Since:

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

And:

-
    -
  • -

    g_a := pow(g, a) mod p

    -
  • -
  • -

    v := pow(g, x) mod p

    -
  • -
  • -

    s_b := pow(g_a * (pow(v, u) mod p), b) mod p

    -
  • -
  • -

    s_b := pow((pow(g, a) mod p) * (pow(pow(g, x) mod p, u) mod p), b) mod p

    -
  • -
  • -

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

    -
  • -
  • -

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

    -
  • -
  • -

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

    -
  • -
-

This means:

-
    -
  • s_b === s_a
  • -
  • k_b === k_a
  • -
-

Finally, as per SRP:

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

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

-

The server then computes:

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

Since we said that:

-
    -
  • s_b === s_a
  • -
  • k_b === k_a
  • -
-

This means, if everything was done correctly,

-
    -
  • M1 === M2
  • -
-

If the password isn't correct, 400 PASSWORD_HASH_INVALID will be returned.

-

Setting a new 2FA password

-

To set a new 2FA password use the account.updatePasswordSettings method.
-If a password is already set, generate an InputCheckPasswordSRP object as per checking passwords with SRP, and insert it in the password field of the account.updatePasswordSettings method.
-To remove the current password, pass an empty new_password_hash in the account.PasswordInputSettings object.

-

To set a new password, use the SRP parameters and the KDF algorithm obtained using account.getPassword when generating the password field. -Then generate a new new_password_hash using the KDF algorithm specified in the new_settings, just append 32 sufficiently random bytes to the salt1, first. -Proceed as for checking passwords with SRP, just stop at the generation of the v parameter, and use it as new_password_hash:

-
    -
  • v := pow(g, x) mod p
  • -
-

As usual in big endian form, padded to 2048 bits.

-

Email verification

-

When setting up two-factor authorization, it is recommended to set up a recovery email, to allow recovery of the password through the user's email address, in case they forget it.

-

To set up a recovery email, it must first be verified. -This can be done directly when setting the new password using account.updatePasswordSettings by setting the email parameter and flag in the account.passwordInputSettings constructor. -If the email isn't verified, an EMAIL_UNCONFIRMED_X 400 error will be returned, where X is the length of the verification code that was just sent to the email. -Use account.confirmPasswordEmail to enter the received verification code and enable the recovery email. -Use account.resendPasswordEmail to resend the verification code. -Use account.cancelPasswordEmail to cancel the verification code.

-

To get the current recovery email, use account.getPasswordSettings.

-

Email recovery

-

In order to recover a forgotten 2FA password, an email must be sent to the previously specified address using the auth.requestPasswordRecovery method.
-Use auth.checkRecoveryPassword to make sure that the user provided a valid code.
-Then use auth.recoverPassword with the received code to delete the current 2FA password, to set a new one follow these instructions.

-

Password reset

-
account.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordResult;
-account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;
-account.resetPasswordOk#e926d63e = account.ResetPasswordResult;
-
----functions---
-
-account.resetPassword#9308ce1b = account.ResetPasswordResult;
-account.declinePasswordReset#4c9409f6 = Bool;
-

If the user is already logged in and has forgotten their 2FA password, account.resetPassword can be used to initiate a password reset.
-On success, the call will initially return a account.resetPasswordRequestedWait constructor and start a 7-day server-side timer, during which the user can abort the reset process using a button sent by the Telegram service account or directly in-UI using account.declinePasswordReset.

-

When the time comes, account.resetPassword is invoked once more, returning a account.resetPasswordOk to indicate that the password was successfully reset.

-

If the user recently requested a password reset that was canceled, account.resetPasswordFailedWait will be returned by the initial account.resetPassword call, and they must wait until the specified date before requesting another reset.

-

Note that if the user already knows their 2FA password and simply wants to disable 2FA, the same process used to enable the password must also be used to disable it ».

-

Related pages

-

SRP design

- -
- -
-
- -
- - - - - - - - diff --git a/data/core.telegram.org/constructor/botInlineMessageText.html b/data/core.telegram.org/constructor/botInlineMessageText.html deleted file mode 100644 index 9fb7d1d5aa..0000000000 --- a/data/core.telegram.org/constructor/botInlineMessageText.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - botInlineMessageText - - - - - - - - - - - - - -
- -
-
-
- -

botInlineMessageText

- -

Send a simple text message

-

- -
-
botInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
flags#Flags, see TL conditional fields
no_webpageflags.0?trueDisable webpage preview
messagestringThe message
entitiesflags.1?Vector<MessageEntity>Message entities for styled text
reply_markupflags.2?ReplyMarkupInline keyboard
-

Type

-

BotInlineMessage

-

Related pages

-

Styled text with message entities

-

How to create styled text with message entities

- -
- -
-
- -
- - - - - - diff --git a/data/core.telegram.org/constructor/inputMessageEntityMentionName.html b/data/core.telegram.org/constructor/inputMessageEntityMentionName.html deleted file mode 100644 index 7b8f9b9fcd..0000000000 --- a/data/core.telegram.org/constructor/inputMessageEntityMentionName.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - inputMessageEntityMentionName - - - - - - - - - - - - - -
- -
-
-
- -

inputMessageEntityMentionName

- -

Message entity that can be used to create a user user mention: received mentions use the messageEntityMentionName constructor, instead.

-

- -
-
inputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity;

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
offsetintOffset of message entity within message (in UTF-8 codepoints)
lengthintLength of message entity within message (in UTF-8 codepoints)
user_idInputUserIdentifier of the user that was mentioned
-

Type

-

MessageEntity

-

Related pages

-

Mentions

-

Telegram allows mentioning other users in case of urgent duckling matters, and quickly navigating to those mentions in order to read them as swiftly as possible.

-

messageEntityMentionName

-

Message entity representing a user mention: for creating a mention use inputMessageEntityMentionName.

- -
- -
-
- -
- - - - - - diff --git a/data/core.telegram.org/constructor/inputPaymentCredentialsSaved.html b/data/core.telegram.org/constructor/inputPaymentCredentialsSaved.html deleted file mode 100644 index 68fabf3079..0000000000 --- a/data/core.telegram.org/constructor/inputPaymentCredentialsSaved.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - inputPaymentCredentialsSaved - - - - - - - - - - - - - -
- -
-
-
- -

inputPaymentCredentialsSaved

- -

Saved payment credentials

-

- -
-
inputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;

-

Parameters

- - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
idstringCredential ID
tmp_passwordbytesTemporary password
-

Type

-

InputPaymentCredentials

- -
- -
-
- -
- - - - - - diff --git a/data/core.telegram.org/constructor/inputUserFromMessage.html b/data/core.telegram.org/constructor/inputUserFromMessage.html deleted file mode 100644 index 4eec2ed10d..0000000000 --- a/data/core.telegram.org/constructor/inputUserFromMessage.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - - inputUserFromMessage - - - - - - - - - - - - - -
- -
-
-
- -

inputUserFromMessage

- -

Defines a min user that was seen in a certain message of a certain chat.

-

- -
-
inputUserFromMessage#1da448e2 peer:InputPeer msg_id:int user_id:long = InputUser;

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
peerInputPeerThe chat where the user was seen
msg_idintThe message ID
user_idlongThe identifier of the user that was seen
-

Type

-

InputUser

-

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.

- -
- -
-
- -
- - - - - - diff --git a/data/core.telegram.org/tdlib/getting-started.html b/data/core.telegram.org/tdlib/getting-started.html deleted file mode 100644 index d5ee3a802d..0000000000 --- a/data/core.telegram.org/tdlib/getting-started.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Getting started with TDLib - - - - - - - - - - - - - -
- -
-
-
- -

Getting started with TDLib

- -
- -

TDLib is a fully functional Telegram client which takes care of all networking, local storage and data consistency details. In this tutorial we describe the main concepts understanding of which is required for efficient TDLib usage.

-

TDLib interface

-

In this text, Client means an interface for interaction with a TDLib instance and Application means the program that uses TDLib to interact with Telegram.

-

The main TDLib API is fully-asyncronous. An Application can send a request to TDLib through ClientManager.send method and receive a response asynchronously through the ClientManager.receive method when it becomes available. The exact naming of these methods and the way in which requests are matched with responses is different for different TDLib interfaces, but the concept as a whole remains the same. For example, in TDLib JSON interface these methods are called td_send and td_receive, and their @extra field must be used to match requests with the corresponding responses.

-

In a high-level interface used by an Application the matching of responses with corresponding requests is often automated and transformed by some wrapper into a call to a continuation, a callback, a Promise or a Future to simplify the handling of responses.

-

Aside from responses to requests, an Application receives a lot of important data through incoming updates. Updates are used to pass new data from TDLib to the Application and often control the behavior of the Application, leaving no chance to implement something wrong. The correct handling of updates is crucial for creating an Application that is efficient and works correctly.

-
-

You can find a list of all available TDLib API methods in our web-documentation. You can also find the descriptions of all available TDLib methods and classes in the TDLIB API scheme.

-

TDLib can be used from any programming language. You can find a lot of examples of TDLib-based frameworks in various programming languages in our examples section.

-
-

TDLib glossary

-

This section describes the basic notions required for understanding the TDLib API. If you have used the TDLib-based Telegram Bot API most of them should be already familiar to you.

-

Telegram is a messenger, so the main object is a message. Each message belongs to some chat and has a unique identifier within that chat. Messages inside a chat must be sorted by that identifier. Telegram supports many different kinds of messages, so a message can have many different kinds of message content. Currently there are more than 45 different kinds of message content, for example messageText for text messages, messagePhoto for photos, or messageScreenshotTaken for notifications about screenshots taken by the other party.

-

A Telegram user is called user. Each user has a unique identifier and a first name, and can also have an optional last name, username and profile photo among other useful fields. Bot is a special type of user which can be controlled through the Telegram Bot API.

-

Each chat has members, i.e. users that immediately receive all messages sent to the chat. Currently there are 6 possible chat member statuses which describe different rights and restrictions a user can have in a chat, ranging from the owner of the chat who has more rights in the chat than any other user, to a user banned in the chat who is banned in the chat and can't return to it by self or even view chat messages, even if the chat is public.

-

As noted earlier, each message belongs to a chat. Currently there are 4 different types of chats on Telegram:

-
    -
  • Private chats are ordinary one-to-one chats with another user (or with oneself in the case of the special “Saved messages” chat).
  • -
  • Basic groups are basic groups with 0-200 members. Every basic group member has their own copy of the message history, so new basic group members may not see older messages (unless another user forwards their own copy to them).
  • -
  • Supergroups are groups with up to 200000 members who share a common message history, so new supergroup members can see all the previously sent messages (unless this is explicitly forbidden by the chat creator). There are special kinds of supergroups, called broadcast groups and channels, which can have an unlimited number of members and where only the chat creator and some chat administrators can write. All other chat members can only read messages in channel and broadcast group chats.
  • -
  • Secret chats are end-to-end encrypted one-to-one chats with another user, available only on the device which was used to initiate and accept the chat.
  • -
-

Each chat has a unique identifier, a title and an optional chat photo. Chats comprise sorted lists shown to the user, position in which is determined, roughly speaking, by the time of latest activity. The correct order of chats in chat lists is maintained by TDLib, so the Application only needs to listen to updates that change the chat.positions field and sort all chats by the pair (position.order, chat.id) in a given position.list.

-

Messages, chat photos and many other objects can have a file inside of them. Each file has an identifier and may be available locally on a local storage or remotely on a cloud server. A file can be usually downloaded to the local storage or uploaded to Telegram cloud servers.

-

Messages with media content like photos or videos can have a short accompanying text called caption. The texts of text messages and media captions can contain fragments, which must be formatted in some unusual way. These fragments are called text entities and the combination of a text and its entities are referred together as a formatted text.

-

TDLib sends a lot of important data to the Application through updates. For example, if there is a user unknown to the Application, or some data about a user has changed, then TDLib immediately sends an updateUser to the Application.

-
-

You can find list of all currently available updates here »

-
-

User authorization

-

Authorization is an example of a behavior, which is controlled by TDLib through updates. Whenever an action is required to proceed with user authorization, the Application receives an updateAuthorizationState with the description of the current AuthorizationState. The Application only needs to handle this update appropriately to correctly implement user authorization.

-

The first authorization state received by the Application is always of the type authorizationStateWaitTdlibParameters. When it is received, the Application must provide parameters for TDLib initialization by calling the setTdlibParameters method. In this method the Application will need to specify, among other parameters:

-
    -
  • api_id — Application identifier for accessing the Telegram API, which can be obtained at https://my.telegram.org.
  • -
  • api_hash — Hash of the Application identifier for accessing the Telegram API, which can be obtained at https://my.telegram.org.
  • -
  • database_directory — The path to the directory on the local disk where the TDLib database is to be stored; must point to a writable directory.
  • -
  • use_message_database — If set to true, the library will maintain a local cache of chats and messages.
  • -
  • use_secret_chats — If set to true, support for secret chats will be enabled.
  • -
  • system_language_code — IETF language tag of the user's operating system language, like “en-GB”.
  • -
  • device_model — Model of the device the Application is being run on, like “iPhone Z”.
  • -
-

After call to setTdlibParameters in case of success Application will receive updateAuthorizationState with new state and just needs to handle that update, nothing should be done explicitly. If setTdlibParameters fails, then authorization state is not changed and the Application must try to handle the current authorization state again.

-

The second received authorization state is always authorizationStateWaitEncryptionKey. When it is received, the database encryption key must be provided through a call to checkDatabaseEncryptionKey. For most mobile apps, you can provide an empty database encryption key here (more info). If user isn't authorized yet, then some of authorizationStateWaitPhoneNumber, authorizationStateWaitCode, authorizationStateWaitRegistration and authorizationStateWaitPassword authorization states may be received. After completing these authorization steps, the Application will receive authorizationStateReady, meaning that authorization was successful and ordinary requests can be sent now.

-
-

You can find complete examples of user authorization in our Java and C# examples.

-
-

Sending a message

-

To send any kind of message, the Application needs to call the method sendMessage providing a chat identifier and the content of the message to be sent. For example, the Application can send a text message using inputMessageText class as input message content, a photo using inputMessagePhoto, or a location using inputMessageLocation. The Application can use inputFileLocal as InputFile in these objects to send a local file from the local storage.

-
-

You can find examples of sending a text message in our Java and C# examples.

-
-

Handling updates

-

All updates and responses to requests must be handled in the order they are received. Here is a list of the most important updates and how they must be handled:

-
    -
  • updateAuthorizationState — The handling of this update is essential for correct user authorization.
  • -
  • updateNewChat — This update is received whenever a new chat is discovered. This update is guaranteed to come before the chat identifier is returned to the Application. So, whenever an Application receives a chat_id, it never needs to use a getChat request to receive the chat object. Instead it must maintain a cache of chats received through this update and take all the necessary data about chats from this cache.
  • -
  • updateUser — This update is received whenever a new user has been discovered or some data about a known user has changed. This update is guaranteed to come before the user identifier is returned to the Application. So, whenever an Application receives a user_id, it never needs to use the getUser request to receive the user object. Instead it must maintain a cache of users received through this update and take all the necessary data about users from this cache.
  • -
  • updateBasicGroup — This update is received whenever a new basic group has been discovered or some data about a known basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the Application. So, whenever an Application receives a basic_group_id, it never needs to use the getBasicGroup request to receive the basicGroup object. Instead it must maintain a cache of basic groups received through this update and take all the necessary data about basic groups from this cache.
  • -
  • updateSupergroup — This update is received whenever a new supergroup has been discovered or some data about a known supergroup has changed. This update is guaranteed to come before the supergroup identifier is returned to the Application. So, whenever an Application receives a supergroup_id, it never needs to use the getSupergroup request to receive the supergroup object. Instead it must maintain a cache of supergroups received through this update and take all the necessary data about supergroups from this cache.
  • -
  • updateSecretChat — This update is received whenever a new secret chat has been discovered or some data about a known secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the Application. So, whenever an Application receives a secret_chat_id, it never needs to use the getSecretChat request to receive the secret chat object. Instead it must maintain a cache of secret chats received through this update and take all the necessary data about secret chats from this cache.
  • -
  • updateNewMessage — This update is received whenever a new message is added to a chat.
  • -
  • updateMessageSendSucceeded — This update is received whenever a message is successfully sent.
  • -
  • updateMessageContent — This update is received whenever the content of a message changes.
  • -
  • updateFile — This update is received whenever information about a file is updated. The handling of this update is essential to follow the progress of files being downloaded or uploaded.
  • -
  • updateChatTitle, updateChatPhoto, updateChatPermissions, updateChatLastMessage, updateChatPosition, updateChatReadInbox, updateChatReadOutbox, updateChatActionBar, updateChatDraftMessage, updateChatMessageSender, updateChatMessageTtl, updateChatNotificationSettings, updateChatPendingJoinRequests, updateChatReplyMarkup, updateChatTheme, updateChatUnreadMentionCount, updateChatVideoChat, updateChatDefaultDisableNotification, updateChatHasProtectedContent, updateChatHasScheduledMessages, updateChatIsBlocked, updateChatIsMarkedAsUnread — These updates are received whenever some information about a chat changes, the chats cache must be updated accordingly
  • -
-
-

For a full list of currently available updates see the documentation for the Update class.

-

You can find an example of correct handling of some updates in our Java example.

-
-

Getting the lists of chats

-

Currently there are 3 different types of chat lists:
- Main chat list.
- Archive chat list.
- A folder chat list.

-

The positions of chats in chat lists are managed by TDLib, so the Application only needs to listen to updates that change the chat.positions field, maintain the list of all chats, sorted by the pair (position.order, chat.id) in descending order, and call loadChats only if more chats are needed. For optimal performance, the number of loaded chats is chosen by TDLib and can be smaller than the specified limit. If the Application needs more chats, it must send another loadChats request.

-
-

You can find an example of retrieving the Main chat list in our Java example.

-
-

Getting chat messages

-

The Application can use the method getChatHistory to get messages in a chat. The messages will be returned in the reverse chronological order (i.e., in descending order of message_id). The Application can pass from_message_id == 0 to get messages from the last message. To get more messages than can be returned in one response, the Application needs to pass the identifier of the last message it has received as from_message_id to next request. For optimal performance, the number of the returned messages is chosen by TDLib and can be smaller than the specified limit. If the Application needs more messages, it needs to adjust the from_message_id parameter and repeat the request.

-
- -
- -
-
- -
- - - - - - - - diff --git a/data/core.telegram.org/type/EmojiURL.html b/data/core.telegram.org/type/EmojiURL.html deleted file mode 100644 index 83d6f66f1a..0000000000 --- a/data/core.telegram.org/type/EmojiURL.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - EmojiURL - - - - - - - - - - - - - -
- -
-
-
- -

EmojiURL

- -

Emoji URL

-

- -
-
emojiURL#a575739d url:string = EmojiURL;
-
----functions---
-
-messages.getEmojiURL#d5b10c26 lang_code:string = EmojiURL;

-

Constructors

- - - - - - - - - - - - - -
ConstructorDescription
emojiURLAn HTTP URL which can be used to automatically log in into translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation
-

Methods

- - - - - - - - - - - - - -
MethodDescription
messages.getEmojiURLReturns an HTTP URL which can be used to automatically log in into translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation
- -
- -
-
- -
- - - - - - diff --git a/data/corefork.telegram.org/constructor/botInfo.html b/data/corefork.telegram.org/constructor/botInfo.html deleted file mode 100644 index 4ee38aa232..0000000000 --- a/data/corefork.telegram.org/constructor/botInfo.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - botInfo - - - - - - - - - - - - - -
- -
-
-
- -

botInfo

- -

Info about bots (available bot commands, etc)

-

- -
-
botInfo#1b74b335 user_id:long description:string commands:Vector<BotCommand> = BotInfo;

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
user_idlongID of the bot
descriptionstringDescription of the bot
commandsVector<BotCommand>Bot commands that can be used in the chat
-

Type

-

BotInfo

- -
- -
-
- -
- - - - - - diff --git a/data/corefork.telegram.org/constructor/decryptedMessageMediaAudio.html b/data/corefork.telegram.org/constructor/decryptedMessageMediaAudio.html deleted file mode 100644 index c851b4dcd3..0000000000 --- a/data/corefork.telegram.org/constructor/decryptedMessageMediaAudio.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - decryptedMessageMediaAudio - - - - - - - - - - - - - -
- -
-
-
- -

decryptedMessageMediaAudio

- -

Audio file attached to a secret chat message.

-

- -
-
===8===
-decryptedMessageMediaAudio#6080758f duration:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
-
-===17===
-decryptedMessageMediaAudio#57e0a9cb duration:int mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
durationintAudio duration in seconds
mime_typestringMIME-type of the audio file
Parameter added in Layer 13.
sizeintFile size
keybytesKey to decrypt the attached media file
ivbytesInitialization vector
-

Type

-

DecryptedMessageMedia

-

Related pages

-

Layers

-

Below you will find information on schema changes. For more details on the use of layers, see Invoking API methods.

- -
- -
-
- -
- - - - - - diff --git a/data/corefork.telegram.org/constructor/updateBotCommands.html b/data/corefork.telegram.org/constructor/updateBotCommands.html deleted file mode 100644 index 8b1023926a..0000000000 --- a/data/corefork.telegram.org/constructor/updateBotCommands.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - updateBotCommands - - - - - - - - - - - - - -
- -
-
-
- -

updateBotCommands

- -

The command set of a certain bot in a certain chat has changed.

-

- -
-
updateBotCommands#4d712f2e peer:Peer bot_id:long commands:Vector<BotCommand> = Update;

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
peerPeerThe affected chat
bot_idlongID of the bot that changed its command set
commandsVector<BotCommand>New bot commands
-

Type

-

Update

-

Related pages

-

Telegram Bot API

- -
- -
-
- -
- - - - - -