Telegram Theme Editor
+The online theme editor allows you to create and modify your existing cloud themes for every platform. Any changes will appear in the apps immediately after you save them.
+ Log in to Theme Editor +diff --git a/data/contest.com.html b/data/contest.com.html new file mode 100644 index 0000000000..bdf5cf55a8 --- /dev/null +++ b/data/contest.com.html @@ -0,0 +1,261 @@ + + +
+ +Subscribe to the Telegram Contests channel for the latest updates.
+Everybody is welcome to try out works submitted by the contestants and create issues (with supporting videos and screenshots) if they encounter any problems.
+Contestants can respond to issues. They appear on the platform under animal aliases to ensure fairness and transparency in testing. Admins will be around to do their own checks on the apps and tally up the results.
+Telegram allows placing chats into folders, based on their type, mute status, or other custom criteria, thanks to folder blacklists and whitelists.
+In the API, folders are called "dialog filters"; in the UI, they are typically represented as tabs.
Scheme:
+dialogFilter#7438f7e8 flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true id:int title:string emoticon:flags.25?string pinned_peers:Vector<InputPeer> include_peers:Vector<InputPeer> exclude_peers:Vector<InputPeer> = DialogFilter;
+
+dialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested;
+
+updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;
+updateDialogFilterOrder#a5d72105 order:Vector<int> = Update;
+updateDialogFilters#3504914f = Update;
+
+---functions---
+
+messages.getDialogFilters#f19ed96d = Vector<DialogFilter>;
+messages.getSuggestedDialogFilters#a29cd42c = Vector<DialogFilterSuggested>;
+messages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool;
+messages.updateDialogFiltersOrder#c563c1e4 order:Vector<int> = Bool;
+
+help.getAppConfig#98914110 = JSONValue;
+On startup, clients call:
+The boolean under the dialog_filters_tooltip
JSON key in the result of help.getAppConfig can be used to determine whether a folder tooltip should be presented to the user right away.
+The UI should then show a list of suggested folder combinations.
Once configuration is finished, apps call messages.updateDialogFilter to create or update existing folders.
+As per the dialogFilter constructor, folders have multiple flags that can be combined to determine which chats should be included in (or excluded from) the folder.
+Folders can also have unlimited pinned chats, as determined by the pinned_peers
field.
To reorder existing folders, messages.updateDialogFiltersOrder should be used with the IDs of the various dialog filters.
+To delete folders, use messages.updateDialogFilter without populating the filter
flag field.
Clients can receive updateDialogFilter, updateDialogFilterOrder updates with new filter information, generated by other clients when modifying folder info.
+Clients can also receive updateDialogFilters, in which case folder info should be refetched manually using messages.getDialogFilters.
The API also has another method for identifying groups of peers, typically used only by archived chats.
+Scheme:
+inputDialogPeer#fcaafeb7 peer:InputPeer = InputDialogPeer;
+inputDialogPeerFolder#64600527 folder_id:int = InputDialogPeer;
+
+dialogPeer#e56dbf05 peer:Peer = DialogPeer;
+dialogPeerFolder#514519e2 folder_id:int = DialogPeer;
+
+updateFolderPeers#19360dc0 folder_peers:Vector<FolderPeer> pts:int pts_count:int = Update;
+
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+
+---functions---
+
+folders.editPeerFolders#6847d0ab folder_peers:Vector<InputFolderPeer> = Updates;
+folders.deleteFolder#1c295881 folder_id:int = Updates;
+API peer folders are typically used only by archived chats, and are really handy for distinguishing groups of peers, since most peer-related constructors (updates, chat info) will contain the folder_id
assigned the the specified chat.
In Telegram apps, API peer folders are used only to implement the chat archive, identified by folder_id
1
; all other peers are in folder_id
0
by default; no other folder_id
is allowed at the moment.
0
folder.Both methods return an updates constructor, containing a single updateFolderPeers with the new folder_id
of moved peers.
+Clients can also receive updateFolderPeers as a normal update, generated by other clients when modifying peer folders.
When a client is being actively used, events will occur that affect the current user and that they must learn about as soon as possible, e.g. when a new message is received. To eliminate the need for the client itself to periodically download these events, there is an update delivery mechanism in which the server sends the user notifications over one of its available connections with the client.
+Update events are sent to an authorized user into the last active connection (except for connections needed for downloading / uploading files).
+So to start receiving updates the client needs to init connection and call API method, e.g. to fetch current state.
+All events are received from the socket as a sequence of TL-serialized Updates objects, which might be optionally gzip-compressed in the same way as responses to queries.
+Each Updates object may contain single or multiple Update objects, representing different events happening.
+In order to apply all updates in precise order and to guarantee that no update is missed or applied twice there is seq
attribute in Updates constructors, and pts
(with pts_count
) or qts
attributes in Update constructors. The client must use those attributes values in combination with locally stored state to correctly apply incoming updates.
When a gap in updates sequence occurs, it must be filled via calling one of the API methods. More below »
+As said earlier, each payload with updates has a TL-type Updates. It can be seen from the schema below that this type has several constructors.
+updatesTooLong#e317af7e = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updateShortMessage#2296d2c8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> = Updates;
+updateShortChatMessage#402d5dbb flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> = Updates;
+updateShortSentMessage#11f1331c flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+updatesTooLong indicates that there are too many events pending to be pushed to the client, so one needs to fetch them manually.
+Events inside updateShort constructors, normally, have lower priority and are broadcast to a large number of users, i.e. one of the chat participants started entering text in a big conversation (updateChatUserTyping).
+The updateShortMessage, updateShortSentMessage and updateShortChatMessage constructors are redundant but help significantly reduce the transmitted message size for 90% of the updates. They should be transformed to updateShort upon receiving.
+Two remaining constructors updates and updatesCombined are part of the Updates sequence. Both of them have seq
attribute, which indicates the remote Updates state after the generation of the Updates, and seq_start
indicates the remote Updates state after the first of the Updates in the packet is generated. For updates, seq_start
attribute is omitted, because it is assumed that it is always equal to seq
.
Each event related to a message box (message created, message edited, message deleted, etc) is identified by a unique autoincremented pts (or qts in case of secret chats).
+Each message box can be considered as some server-side DB table that stores messages and events associated with them. +All boxes are completely independent, and each pts sequence is tied to just one box (see below).
+Update object may contain info about multiple events (for example, updateDeleteMessages).
+That's why all single updates might have pts_count parameter indicating the number of events contained in the received update (with some exceptions, in this case, the pts_count is considered to be 0
).
Each channel and supergroup has its message box and its event sequence as a result; private chats and legacy groups of one user have another common event sequence. +User's Secret chats have yet another common secret event sequence.
+To recap, the client has to take care of the integrity of the following sequences to properly handle updates:
+The common update state is represented by the updates.State constructor. +When the user logs in for the first time, call to updates.getState has to be made to store the latest update state (which will not be the absolute initial state, just the latest state at the current time). +The common update state can also be fetched from updates.differenceTooLong.
+The channel update state is represented simply by the pts of the event sequence: when first logging in, the initial channel state can be obtained from the dialog constructor when fetching dialogs, from the full channel info, or it can be received as an updateChannelTooLong update.
+The secret chat update state is represented by the qts of the secret event sequence, it is contained in the updates.State of the common update state.
+The Updates sequence state is represented by the date and seq of the Updates sequence, it is contained in the updates.State of the common update state.
+Update handling in Telegram clients consists of receiving events, making sure there were no gaps and no events were missed based on the locally stored state of the correspondent event sequence, and then updating the locally stored state based on the parameters received.
+When the client receives payload with serialized updates, first of all, it needs to walk through all of the nested Update objects and check if they belong to any of message box sequences (have pts
or qts
parameters). Those updates need to be handled separately according to corresponding local state and new pts
/qts
values. Details below »
After message box updates are handled, if there are any other updates remaining the client needs to handle them with respect to seq
. Details below »
pts
: checking and applyingHere, local_pts
will be the local state, pts
will be the remote state, pts_count
will be the number of events in the update.
If local_pts + pts_count === pts
, the update can be applied.
+If local_pts + pts_count > pts
, the update was already applied, and must be ignored.
+If local_pts + pts_count < pts
, there's an update gap that must be filled.
For example, let's assume the client has the following local state for the channel 123456789
:
local_pts = 131
+Now let's assume an updateNewChannelMessage from channel 123456789
is received with pts = 132
and pts_count=1
.
+Since local_pts + pts_count === pts
, the total number of events since the last stored state is, in fact, equal to pts_count
: this means the update can be safely accepted and the remote pts
applied:
local_pts = 132
+Since:
+pts
indicates the server state after the new channel message events are generatedpts_count
indicates the number of events in the new channel updatepts_before = pts - pts_count = 131
, which is, in fact, equal to our local state.Now let's assume an updateNewChannelMessage from channel 123456789
is received with pts = 132
and pts_count=1
.
+Since local_pts + pts_count > pts
(133 > 132
), the update is skipped because we've already handled this update (in fact, our current local_pts
was set by this same update, and it was resent twice due to network issues or other issues).
Now let's assume an updateDeleteChannelMessages from channel 123456789
is received with pts = 140
and pts_count=5
.
+Since local_pts + pts_count < pts
(137 < 140
), this means that updates were missed, and the gap must be recovered.
The whole process is very similar for secret chats, but there is qts
instead of pts
, and events are never grouped, so it's assumed that qts_count
is always equal to 1.
seq
: checking and applyingOn top level when handling received updates and updatesCombined there are three possible cases:
+If local_seq + 1 === seq_start
, the updates can be applied.
+If local_seq + 1 > seq_start
, the updates were already applied, and must be ignored.
+If local_seq + 1 < seq_start
, there's an updates gap that must be filled (updates.getDifference must be used as with common and secret event sequences).
If the updates were applied, local Updates state must be updated with seq
and date
from the constructor.
For all the other Updates type constructors there is no need to check seq
or change a local state.
To do this, updates.getDifference (common/secret state) or updates.getChannelDifference (channel state) with the respective local states must be called. +These methods should also be called on startup, to fetch new updates (preferably with some flags to reduce server load, see the method's docs). +Manually obtaining updates is also required in the following situations:
+When calling updates.getDifference if the updates.differenceSlice constructor is returned in response, the full difference was too large to be received in one request. The intermediate status, intermediate_state, must be saved on the client and the query must be repeated, using the intermediate status as the current status.
+To fetch the updates difference of a channel, updates.getChannelDifference is used.
+If the difference is too large to be received in one request, the final
flag of the result is not set (see docs).
+The intermediate status, represented by the pts, must be saved on the client and the query must be repeated, using the intermediate status as the current status.
For perfomance reasons and for better user experience, client can set maximum gap size to be filled: pts_total_limit
parameter of updates.getDifference and limit
parameter for updates.getChannelDifference can be used.
If the gap is too large and there are too many updates to fetch, a *TooLong
constructor will be returned. In this case, the client must re-fetch the state, re-start fetching updates from that state and follow the instructions that can be found here.
It is recommended to use limit 10-100
for channels and 1000-10000
otherwise.
Implementations also have to take care to postpone updates received via the socket while filling gaps in the event and Update sequences, as well as avoid filling gaps in the same sequence.
+Example implementations: tdlib, MadelineProto.
+An interesting and easy way this can be implemented, instead of using various locks, is by running background loops, like in MadelineProto ».
+If a client does not have an active connection at the time of an event, PUSH Notifications will also be useful.
Logged-in sessions
+account.authorizations#1250abde authorizations:Vector<Authorization> = account.Authorizations;
+Name | +Type | +Description | +
---|---|---|
authorizations | +Vector<Authorization> | +Logged-in sessions | +
The code was sent through the telegram app
+auth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType;
+Name | +Type | +Description | +
---|---|---|
length | +int | +Length of the code in bytes | +
The code was sent via SMS
+auth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType;
+Name | +Type | +Description | +
---|---|---|
length | +int | +Length of the code in bytes | +
Invites were enabled/disabled
+channelAdminLogEventActionToggleInvites#1b7907ae new_value:Bool = ChannelAdminLogEventAction;
+Name | +Type | +Description | +
---|---|---|
new_value | +Bool | +New value | +
Slow mode setting for supergroups was changed
+channelAdminLogEventActionToggleSlowMode#53909779 prev_value:int new_value:int = ChannelAdminLogEventAction;
+Name | +Type | +Description | +
---|---|---|
prev_value | +int | +Previous slow mode value | +
new_value | +int | +New slow mode value | +
Toggle supergroup slow mode: if enabled, users will only be able to send one message every seconds
seconds
Myself
+channelParticipantSelf#a3289a6d user_id:int inviter_id:int date:int = ChannelParticipant;
+Name | +Type | +Description | +
---|---|---|
user_id | +int | +User ID | +
inviter_id | +int | +User that invited me to the channel/supergroup | +
date | +int | +When did I join the channel/supergroup | +
Fetch only recent participants
+channelParticipantsRecent#de3f3c79 = ChannelParticipantsFilter;
+This constructor does not require any parameters.
+The user has already joined this chat
+chatInviteAlready#5a686d7c chat:Chat = ChatInvite;
+Name | +Type | +Description | +
---|---|---|
chat | +Chat | +The chat connected to the invite | +
The entire message history has been deleted.
+===8===
+decryptedMessageActionFlushHistory#6719e45c = DecryptedMessageAction;
+This constructor does not require any parameters.
+A screenshot was taken.
+===8===
+decryptedMessageActionScreenshotMessages#8ac1f475 random_ids:Vector<long> = DecryptedMessageAction;
+Name | +Type | +Description | +
---|---|---|
random_ids | +Vector<long> | +List of affected message ids (that appeared on the screenshot) | +
Deleted emoji keyword
+emojiKeywordDeleted#236df622 keyword:string emoticons:Vector<string> = EmojiKeyword;
+Name | +Type | +Description | +
---|---|---|
keyword | +string | +Keyword | +
emoticons | +Vector<string> | +Emojis that were associated to keyword | +
No PSA/MTProxy info is available
+help.promoDataEmpty#98f6ac75 expires:int = help.PromoData;
+Name | +Type | +Description | +
---|---|---|
expires | +int | +Re-fetch PSA/MTProxy info after the specified number of seconds | +
Represents a channel
+inputChannel#afeb712e channel_id:int access_hash:long = InputChannel;
+Name | +Type | +Description | +
---|---|---|
channel_id | +int | +Channel ID | +
access_hash | +long | +Access hash taken from the channel constructor | +
Channel/supergroup info
Message by ID
+inputMessageID#a676a322 id:int = InputMessage;
+Name | +Type | +Description | +
---|---|---|
id | +int | +Message ID | +
Message to which the specified message replies to
+inputMessageReplyTo#bad88395 id:int = InputMessage;
+Name | +Type | +Description | +
---|---|---|
id | +int | +ID of the message that replies to the message we need | +
Return only messages containing contacts
+inputMessagesFilterContacts#e062db83 = MessagesFilter;
+This constructor does not require any parameters.
+Filter is absent.
+inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
+This constructor does not require any parameters.
+Defines the current user.
+inputPeerSelf#7da07ec9 = InputPeer;
+This constructor does not require any parameters.
+Whether people can add you to their contact list by your phone number
+inputPrivacyKeyAddedByPhone#d1219bdd = InputPrivacyKey;
+This constructor does not require any parameters.
+Whether we can see the exact last online timestamp of the user
+inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;
+This constructor does not require any parameters.
+JSON key: value pair
+jsonObjectValue#c0de1bd9 key:string value:JSONValue = JSONObjectValue;
+Name | +Type | +Description | +
---|---|---|
key | +string | +Key | +
value | +JSONValue | +Value | +
Translated localization string
+langPackString#cad181f6 key:string value:string = LangPackString;
+Name | +Type | +Description | +
---|---|---|
key | +string | +Language key | +
value | +string | +Value | +
A screenshot of the chat was taken
+messageActionScreenshotTaken#4792929b = MessageAction;
+This constructor does not require any parameters.
+Request for secure telegram passport values was sent
+messageActionSecureValuesSent#d95c6154 types:Vector<SecureValueType> = MessageAction;
+Name | +Type | +Description | +
---|---|---|
types | +Vector<SecureValueType> | +Secure value types | +
Message entity representing italic text.
+messageEntityItalic#826f8b60 offset:int length:int = MessageEntity;
+Name | +Type | +Description | +
---|---|---|
offset | +int | +Offset of message entity within message (in UTF-8 codepoints) | +
length | +int | +Length of message entity within message (in UTF-8 codepoints) | +
Extended info on chat and auxiliary data.
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+Name | +Type | +Description | +
---|---|---|
full_chat | +ChatFull | +Extended info on a chat | +
chats | +Vector<Chat> | +List containing basic info on chat | +
users | +Vector<User> | +List of users mentioned above | +
View, forward counter + info about replies
+messages.messageViews#b6c4f543 views:Vector<MessageViews> chats:Vector<Chat> users:Vector<User> = messages.MessageViews;
+Name | +Type | +Description | +
---|---|---|
views | +Vector<MessageViews> | +View, forward counter + info about replies | +
chats | +Vector<Chat> | +Chats mentioned in constructor | +
users | +Vector<User> | +Users mentioned in constructor | +
Recently used stickers
+messages.recentStickers#22f3afb3 hash:int packs:Vector<StickerPack> stickers:Vector<Document> dates:Vector<int> = messages.RecentStickers;
+Name | +Type | +Description | +
---|---|---|
hash | +int | +Hash for pagination, for more info click here | +
packs | +Vector<StickerPack> | +Emojis associated to stickers | +
stickers | +Vector<Document> | +Recent stickers | +
dates | +Vector<int> | +When was each sticker last used | +
How to fetch results from large lists of objects.
This key derivation algorithm defines that SRP 2FA login must be used
+passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow#3a912d4a salt1:bytes salt2:bytes g:int p:bytes = PasswordKdfAlgo;
+Name | +Type | +Description | +
---|---|---|
salt1 | +bytes | +One of two salts used by the derivation function (see SRP 2FA login) | +
salt2 | +bytes | +One of two salts used by the derivation function (see SRP 2FA login) | +
g | +int | +Base (see SRP 2FA login) | +
p | +bytes | +2048-bit modulus (see SRP 2FA login) | +
How to login to a user's account if they have enabled 2FA, how to change password.
Credit card info, provided by the card's bank(s)
+payments.bankCardData#3e24e573 title:string open_urls:Vector<BankCardOpenUrl> = payments.BankCardData;
+Name | +Type | +Description | +
---|---|---|
title | +string | +Credit card title | +
open_urls | +Vector<BankCardOpenUrl> | +Info URL(s) provided by the card's bank(s) | +
The phone call was disconnected
+phoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason;
+This constructor does not require any parameters.
+Whether messages forwarded from the user will be anonymously forwarded
+privacyKeyForwards#69ec56a3 = PrivacyKey;
+This constructor does not require any parameters.
+User is selecting a contact to share.
+sendMessageChooseContactAction#628cbc6f = SendMessageAction;
+This constructor does not require any parameters.
+User is uploading a file.
+sendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;
+Name | +Type | +Description | +
---|---|---|
progress | +int | +Progress percentage | +
Information about an active user in a supergroup
+statsGroupTopPoster#18f3d0f7 user_id:int messages:int avg_chars:int = StatsGroupTopPoster;
+Name | +Type | +Description | +
---|---|---|
user_id | +int | +User ID | +
messages | +int | +Number of messages for statistics period in consideration | +
avg_chars | +int | +Average number of characters per message | +
Telegram offers detailed channel statistics for channels and supergroups.
WEBP image. MIME type: image/webp
.
storage.fileWebp#1081464c = storage.FileType;
+This constructor does not require any parameters.
+Most used bots
+topPeerCategoryBotsPM#ab661b5b = TopPeerCategory;
+This constructor does not require any parameters.
+Most frequently called users
+topPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory;
+This constructor does not require any parameters.
+The recent sticker list was updated
+updateRecentStickers#9a422c20 = Update;
+This constructor does not require any parameters.
+An instant view webpage preview was generated
+updateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update;
+Name | +Type | +Description | +
---|---|---|
webpage | +WebPage | +Webpage preview | +
pts | +int | +Event count after generation | +
pts_count | +int | +Number of events that were generated | +
How to subscribe to updates and handle them properly.
Get all saved Telegram Passport documents, for more info see the passport docs »
+---functions---
+account.getAllSecureValues#b288bc7d = Vector<SecureValue>;
+This constructor does not require any parameters.
+Send confirmation code to cancel account deletion, for more info click here »
+auth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;
+---functions---
+account.sendConfirmPhoneCode#1b3faa88 hash:string settings:CodeSettings = auth.SentCode;
+Name | +Type | +Description | +
---|---|---|
hash | +string | +The hash from the service notification, for more info click here » | +
settings | +CodeSettings | +Phone code settings | +
Code | +Type | +Description | +
---|---|---|
400 | +HASH_INVALID | +The provided hash is invalid | +
How to reset an account if the 2FA password was forgotten.
Create and upload a new wallpaper
+wallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;
+wallPaperNoFile#8af40b25 flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;
+---functions---
+account.uploadWallPaper#dd853661 file:InputFile mime_type:string settings:WallPaperSettings = WallPaper;
+Name | +Type | +Description | +
---|---|---|
file | +InputFile | +The JPG/PNG wallpaper | +
mime_type | +string | +MIME type of uploaded wallpaper | +
settings | +WallPaperSettings | +Wallpaper settings | +
Toggle supergroup slow mode: if enabled, users will only be able to send one message every seconds
seconds
updatesTooLong#e317af7e = Updates;
+updateShortMessage#2296d2c8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> = Updates;
+updateShortChatMessage#402d5dbb flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+updateShortSentMessage#11f1331c flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> = Updates;
+---functions---
+channels.toggleSlowMode#edd49ef0 channel:InputChannel seconds:int = Updates;
+Name | +Type | +Description | +
---|---|---|
channel | +InputChannel | +The supergroup | +
seconds | +int | +Users will only be able to send one message every seconds seconds, 0 to disable the limitation |
+
Code | +Type | +Description | +
---|---|---|
400 | +CHAT_ADMIN_REQUIRED | +You must be an admin in this chat to do this | +
400 | +CHAT_NOT_MODIFIED | +The pinned message wasn't modified | +
400 | +INPUT_METHOD_INVALID_1192227_X | +Invalid method | +
400 | +INPUT_METHOD_INVALID_1604042050_X | +Invalid method | +
400 | +SECONDS_INVALID | +Invalid duration provided | +
How to handle channels, supergroups, groups, and what's the difference between them.
Stop getting notifications about thread replies of a certain user in @replies
updatesTooLong#e317af7e = Updates;
+updateShortMessage#2296d2c8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> = Updates;
+updateShortChatMessage#402d5dbb flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+updateShortSentMessage#11f1331c flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> = Updates;
+---functions---
+contacts.blockFromReplies#29a8962c flags:# delete_message:flags.0?true delete_history:flags.1?true report_spam:flags.2?true msg_id:int = Updates;
+Name | +Type | +Description | +
---|---|---|
flags | +# | +Flags, see TL conditional fields | +
delete_message | +flags.0?true | +Whether to delete the specified message as well | +
delete_history | +flags.1?true | +Whether to delete all @replies messages from this user as well |
+
report_spam | +flags.2?true | +Whether to also report this user for spam | +
msg_id | +int | +ID of the message in the @replies chat | +
Telegram allows commenting on a channel post or on a generic supergroup message, thanks to message threads.
Returns the current user's contact list.
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
+contacts.contacts#eae87e42 contacts:Vector<Contact> saved_count:int users:Vector<User> = contacts.Contacts;
+---functions---
+contacts.getContacts#c023849f hash:int = contacts.Contacts;
+Name | +Type | +Description | +
---|---|---|
hash | +int | +If there already is a full contact list on the client, a hash of a the list of contact IDs in ascending order may be passed in this parameter. If the contact set was not changed, (contacts.contactsNotModified) will be returned. | +
How to fetch results from large lists of objects.
+Contact list on the server is the same as the list on the client.
Get chats in common with a user
+messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
+messages.chatsSlice#9cd81144 count:int chats:Vector<Chat> = messages.Chats;
+---functions---
+messages.getCommonChats#d0a48c4 user_id:InputUser max_id:int limit:int = messages.Chats;
+Name | +Type | +Description | +
---|---|---|
user_id | +InputUser | +User ID | +
max_id | +int | +Maximum ID of chat to return (see pagination) | +
limit | +int | +Maximum number of results to return, see pagination | +
Code | +Type | +Description | +
---|---|---|
400 | +MSG_ID_INVALID | +Invalid message ID provided | +
400 | +USER_ID_INVALID | +The provided user ID is invalid | +
How to fetch results from large lists of objects.
Get a document by its SHA256 hash, mainly used for gifs
+documentEmpty#36f8c871 id:long = Document;
+document#1e87342b flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:int thumbs:flags.0?Vector<PhotoSize> video_thumbs:flags.1?Vector<VideoSize> dc_id:int attributes:Vector<DocumentAttribute> = Document;
+---functions---
+messages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document;
+Name | +Type | +Description | +
---|---|---|
sha256 | +bytes | +SHA256 of file | +
size | +int | +Size of the file in bytes | +
mime_type | +string | +Mime type | +
Code | +Type | +Description | +
---|---|---|
400 | +SHA256_HASH_INVALID | +The provided SHA256 hash is invalid | +
Get highscores of a game
+messages.highScores#9a3bfd99 scores:Vector<HighScore> users:Vector<User> = messages.HighScores;
+---functions---
+messages.getGameHighScores#e822649d peer:InputPeer id:int user_id:InputUser = messages.HighScores;
+Name | +Type | +Description | +
---|---|---|
peer | +InputPeer | +Where was the game sent | +
id | +int | +ID of message with game media attachment | +
user_id | +InputUser | +Get high scores made by a certain user | +
Code | +Type | +Description | +
---|---|---|
400 | +MESSAGE_ID_INVALID | +The provided message id is invalid | +
400 | +PEER_ID_INVALID | +The provided peer id is invalid | +
400 | +USER_BOT_REQUIRED | +This method can only be called by a bot | +
Get and increase the view counter of a message sent or forwarded from a channel
+messages.messageViews#b6c4f543 views:Vector<MessageViews> chats:Vector<Chat> users:Vector<User> = messages.MessageViews;
+---functions---
+messages.getMessagesViews#5784d3e1 peer:InputPeer id:Vector<int> increment:Bool = messages.MessageViews;
+Name | +Type | +Description | +
---|---|---|
peer | +InputPeer | +Peer where the message was found | +
id | +Vector<int> | +ID of message | +
increment | +Bool | +Whether to mark the message as viewed and increment the view counter | +
Code | +Type | +Description | +
---|---|---|
400 | +CHANNEL_INVALID | +The provided channel is invalid | +
400 | +CHANNEL_PRIVATE | +You haven't joined this channel/supergroup | +
400 | +CHAT_ID_INVALID | +The provided chat id is invalid | +
400 | +MSG_ID_INVALID | +Invalid message ID provided | +
400 | +PEER_ID_INVALID | +The provided peer id is invalid | +
How to handle channels, supergroups, groups, and what's the difference between them.
Get pinned dialogs
+messages.peerDialogs#3371c354 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> state:updates.State = messages.PeerDialogs;
+---functions---
+messages.getPinnedDialogs#d6b94df2 folder_id:int = messages.PeerDialogs;
+Name | +Type | +Description | +
---|---|---|
folder_id | +int | +Peer folder ID, for more info click here | +
Code | +Type | +Description | +
---|---|---|
400 | +FOLDER_ID_INVALID | +Invalid folder ID | +
Telegram allows placing chats into folders, based on their type, mute status, or other custom criteria, thanks to folder blacklists and whitelists.
Get saved GIFs
+messages.savedGifsNotModified#e8025ca2 = messages.SavedGifs;
+messages.savedGifs#2e0709a5 hash:int gifs:Vector<Document> = messages.SavedGifs;
+---functions---
+messages.getSavedGifs#83bf3d52 hash:int = messages.SavedGifs;
+Name | +Type | +Description | +
---|---|---|
hash | +int | +Hash for pagination, for more info click here | +
How to fetch results from large lists of objects.
Sends a request to start a secret chat to the user.
+encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
+encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;
+encryptedChatRequested#62718a82 flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;
+encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
+encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;
+---functions---
+messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
+Name | +Type | +Description | +
---|---|---|
user_id | +InputUser | +User ID | +
random_id | +int | +Unique client request ID required to prevent resending. This also doubles as the chat ID. | +
g_a | +bytes | +A = g ^ a mod p , see Wikipedia |
+
Code | +Type | +Description | +
---|---|---|
400 | +DH_G_A_INVALID | +g_a invalid | +
400 | +USER_ID_INVALID | +The provided user ID is invalid | +
Get info about a credit card
+payments.bankCardData#3e24e573 title:string open_urls:Vector<BankCardOpenUrl> = payments.BankCardData;
+---functions---
+payments.getBankCardData#2e79d779 number:string = payments.BankCardData;
+Name | +Type | +Description | +
---|---|---|
number | +string | +Credit card number | +
Installs a previously uploaded photo as a profile photo.
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+---functions---
+photos.updateProfilePhoto#72d4742c id:InputPhoto = photos.Photo;
+Name | +Type | +Description | +
---|---|---|
id | +InputPhoto | +Input photo | +
Code | +Type | +Description | +
---|---|---|
400 | +FILE_PARTS_INVALID | +The number of file parts is invalid | +
400 | +IMAGE_PROCESS_FAILED | +Failure while processing image | +
400 | +LOCATION_INVALID | +The provided location is invalid | +
400 | +PHOTO_CROP_SIZE_SMALL | +Photo is too small | +
400 | +PHOTO_EXT_INVALID | +The extension of the photo is invalid | +
400 | +PHOTO_ID_INVALID | +Photo ID invalid | +
++This document describes security recommendations for clients using MTProto 1.0, its status is DEPRECATED. +For up-to-date security recommendations, kindly see this document.
+
See also:
+While MTProto is designed to be a reasonably fast and secure protocol, its advantages can be easily negated by careless implementation. We collected some security guidelines for client software developers on this page. All Telegram clients are required to comply with these.
+We use DH key exchange in two cases:
+ +In both cases, there are some verifications to be done whenever DH is used:
+Client is expected to check whether p = dh_prime is a safe 2048-bit prime (meaning that both p and (p-1)/2 are prime, and that 2^2047 < p < 2^2048), and that g generates a cyclic subgroup of prime order (p-1)/2, i.e. is a quadratic residue mod p. Since g is always equal to 2, 3, 4, 5, 6 or 7, this is easily done using quadratic reciprocity law, yielding a simple condition on p mod 4g -- namely, p mod 8 = 7 for g = 2; p mod 3 = 2 for g = 3; no extra condition for g = 4; p mod 5 = 1 or 4 for g = 5; p mod 24 = 19 or 23 for g = 6; and p mod 7 = 3, 5 or 6 for g = 7. After g and p have been checked by the client, it makes sense to cache the result, so as not to repeat lengthy computations in future.
+If the verification takes too long (which is the case for older mobile devices), one might initially run only 15 Miller--Rabin iterations (use parameter 30 in Java) for verifying primeness of p and (p - 1)/2 with error probability not exceeding one billionth, and do more iterations in the background later.
+Another way to optimize this is to embed into the client application code a small table with some known "good" couples (g,p) (or just known safe primes p, since the condition on g is easily verified during execution), checked during code generation phase, so as to avoid doing such verification during runtime altogether. The server rarely changes these values, thus one usually needs to put the current value of server's dh_prime into such a table. For example, the current value of dh_prime equals (in big-endian byte order)
+C7 1C AE B9 C6 B1 C9 04 8E 6C 52 2F 70 F1 3F 73 98 0D 40 23 8E 3E 21 C1 49 34 D0 37 56 3D 93 0F 48 19 8A 0A A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E 0A C9 25 13 95 43 AE D4 4C CE 7C 37 20 FD 51 F6 94 58 70 5A C6 8C D4 FE 6B 6B 13 AB DC 97 46 51 29 69 32 84 54 F1 8F AF 8C 59 5F 64 24 77 FE 96 BB 2A 94 1D 5B CD 1D 4A C8 CC 49 88 07 08 FA 9B 37 8E 3C 4F 3A 90 60 BE E6 7C F9 A4 A4 A6 95 81 10 51 90 7E 16 27 53 B5 6B 0F 6B 41 0D BA 74 D8 A8 4B 2A 14 B3 14 4E 0E F1 28 47 54 FD 17 ED 95 0D 59 65 B4 B9 DD 46 58 2D B1 17 8D 16 9C 6B C4 65 B0 D6 FF 9C A3 92 8F EF 5B 9A E4 E4 18 FC 15 E8 3E BE A0 F8 7F A9 FF 5E ED 70 05 0D ED 28 49 F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6 35 B1 05 EE 2E 4E 15 D0 4B 24 54 BF 6F 4F AD F0 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B
+Apart from the conditions on the Diffie-Hellman prime dh_prime and generator g, both sides are to check that g, g_a and g_b are greater than 1 and less than dh_prime - 1. We recommend checking that g_a and g_b are between 2^{2048-64} and dh_prime - 2^{2048-64} as well.
+Once the client receives a server_DH_params_ok
answer in step 5) of the Authorization Key generation protocol and decrypts it obtaining answer_with_hash
, it MUST check that
answer_with_hash := SHA1(answer) + answer + (0-15 random bytes)
+In other words, the first 20 bytes of answer_with_hash
must be equal to SHA1 of the remainder of the decrypted message without the padding random bytes.
When the client receives and/or decrypts server messages during creation of Authorization Key, and these messages contain some nonce fields already known to the client from messages previously obtained during the same run of the protocol, the client is to check that these fields indeed contain the values previosly known.
+a
and b
Client must use a cryptographically secure PRNG to generate secret exponents a
or b
for DH key exchange. For secret chats, the client might request some entropy (random bytes) from the server while invoking messages.getDhConfig and feed these random bytes into its PRNG (for example, by PRNG_seed
if OpenSSL library is used), but never using these "random" bytes by themselves or replacing by them the local PRNG seed. One should mix bytes received from server into local PRNG seed.
Some important checks are to be done while sending and especially receiving encrypted MTProto messages.
+msg_key
is used not only to compute the AES key and IV to decrypt the received message. After decryption, the client MUST check that msg_key
is indeed equal to SHA1 of the plaintext obtained as the result of decryption (without the final padding bytes).
If an error is encountered before this check could be performed, the client must perform the msg-key
check anyway before returning any result. Note that the response to any error encountered before the msg_key
check must be the same as the response to a failed msg_key
check.
The client is to check that the length of the message or container obtained from the decrypted message (computed from its length
field) does not exceed the total size of the plaintext, and that the difference is not more than 15 bytes. Apart from this, knowing the total length is important for the previous verification.
The length should be always divisible by 4 and non-negative. On no account the client is to access data past the end of the decryption buffer containing the plaintext message.
+The client is to check that the session_id
field in the decrypted message indeed equals to that of an active session created by the client.
The client must check that msg_id
has even parity for messages from client to server, and odd parity for messages from server to client.
In addition, the identifiers (msg_id) of the last N messages received from the other side must be stored, and if a message comes in with an msg_id lower than all or equal to any of the stored values, that message is to be ignored. Otherwise, the new message msg_id is added to the set, and, if the number of stored msg_id values is greater than N, the oldest (i. e. the lowest) is discarded.
+In addition, msg_id values that belong over 30 seconds in the future or over 300 seconds in the past are to be ignored (recall that msg_id
approximately equals unixtime * 2^32). This is especially important for the server. The client would also find this useful (to protect from a replay attack), but only if it is certain of its time (for example, if its time has been synchronized with that of the server).
Certain client-to-server service messages containing data sent by the client to the server (for example, msg_id
of a recent client query) may, nonetheless, be processed on the client even if the time appears to be “incorrect”. This is especially true of messages to change server_salt and notifications about invalid time on the client. See Mobile Protocol: Service Messages.
If one of the checks listed above fails, the client is to completely discard the message obtained from server. We also recommend closing and reestablishing the TCP connection to the server, then retrying the operation or the whole key generation protocol.
+No information from incorrect messages can be used. Even if the application throws an exception and dies, this is much better than continuing with invalid data.
+Notice that invalid messages will infrequently appear during normal work even if no malicious tampering is being done. This is due to network transmission errors. We recommend ignoring the invalid message and closing the TCP connection, then creating a new TCP connection to the server and retrying the original query.
If you'd like to test Telegram Passport, use this page to request data. If you'd like to check out a real-life implementation, please see this blog post for examples of services that have integrated Telegram Passport.
++
+ + ++Note that the passport demo bot will only store data for 1 hour and then discard it. After logging in here, you can use the logout button on this page to reset your session.
+
The Android SDK helps you easily integrate Telegram Passport requests into your Android-based apps. Check out our GitHub repository to see samples using this SDK.
+Telegram Passport SDK is available from the Maven repository. +Add this line to the dependencies section in your build.gradle:
+compile 'org.telegram:passport:1.1'
+and sync your project.
+Download the library, unzip it and copy the library project to the root of your project directory (the one with settings.gradle and gradle.properties). Then, make the following changes to your Gradle scripts.
+In settings.gradle, add ':telegrampassport'
to includes:
include ':app', ':telegrampassport'
+In the build.gradle file for your app, add this line to the dependencies section:
+compile ':telegrampassport'
+and sync your project.
+The SDK provides the "Log in with Telegram" button which we recommend using for a consistent user experience across different apps. You can either add it from your Java code:
+TelegramLoginButton telegramButton;
+// ...
+telegramButton=new TelegramLoginButton(this);
+// Optionally you can change the roundness of the button corners
+// to better fit your design.
+telegramButton.setCornerRoundness(1f);
+viewGroupOfSomeSort.addView(telegramButton, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+Or from XML:
+ <org.telegram.passport.TelegramLoginButton
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ app:cornerRoundness="0.5"/>
+The button doesn't do anything by itself; you need to set an OnClickListener on it to start the authorization flow (replace the comments with actual parameters):
+private static final int TG_PASSPORT_RESULT=352; // this can be any integer less than 0xFFFF
+// ...
+telegramButton.setOnClickListener(new View.OnClickListener(){
+@Override
+public void onClick(View view){
+ TelegramPassport.AuthRequest req=new TelegramPassport.AuthRequest();
+ req.botID=/* your bot ID here */;
+ req.publicKey=/* your bot public key here */;
+ req.nonce=/* a unique nonce to pass to the bot server */;
+ // Request either a passport or an ID card with selfie, a driver license, personal details with
+ // name as it appears in the documents, address with any address document, and a phone number.
+ // You could also pass a raw JSON object here if that's what works better for you
+ // (for example, if you already get it from your server in the correct format).
+ req.scope=new PassportScope(
+ new PassportScopeElementOneOfSeveral(PassportScope.PASSPORT, PassportScope.IDENTITY_CARD).withSelfie(),
+ new PassportScopeElementOne(PassportScope.PERSONAL_DETAILS).withNativeNames(),
+ PassportScope.DRIVER_LICENSE,
+ PassportScope.ADDRESS,
+ PassportScope.ADDRESS_DOCUMENT,
+ PassportScope.PHONE_NUMBER
+ );
+ TelegramPassport.request(MyActivity.this, req, TG_PASSPORT_RESULT);
+}});
+If you need more control over the process, the TelegramPassport
class contains several more methods:
getAuthIntent(AuthParams)
returns an Intent
for you to use in startActivityForResult
if you need to do that in some special way. Be sure to check that an app is present that can handle this intent before starting it by using PackageManager
or intent.resolveActivity
.showAppInstallAlert(Activity)
shows an alert that the user needs to install Telegram in order to continue. This is intended to be used together with the previous method for the cases when the app isn't installed.The result is delivered via the onActivityResult
method in your activity with the request code you passed to TelegramPassport.request
. Currently, the only meaningful parameter is resultCode
, which is RESULT_OK
if the authorization was successful and RESULT_CANCELED
otherwise.
TDLib (Telegram Database Library) is a cross-platform, fully functional Telegram client. We designed it to help third-party developers create their own custom apps using the Telegram platform.
++ ++
+ ++
TDLib is fully open source, all code is available on GitHub.
+See also:
+ +Contact status: online / offline.
+contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;
+Constructor | +Description | +
---|---|
contactStatus | +Contact status: online / offline. | +
Payment credentials
+inputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;
+inputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;
+inputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;
+inputPaymentCredentialsAndroidPay#ca05d50e payment_token:DataJSON google_transaction_id:string = InputPaymentCredentials;
+Constructor | +Description | +
---|---|
inputPaymentCredentialsSaved | +Saved payment credentials | +
inputPaymentCredentials | +Payment credentials | +
inputPaymentCredentialsApplePay | +Apple pay payment credentials | +
inputPaymentCredentialsAndroidPay | +Android pay payment credentials | +
Media
+messageMediaEmpty#3ded6320 = MessageMedia;
+messageMediaPhoto#695150d7 flags:# photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia;
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
+messageMediaContact#cbf24940 phone_number:string first_name:string last_name:string vcard:string user_id:int = MessageMedia;
+messageMediaUnsupported#9f84f49e = MessageMedia;
+messageMediaDocument#9cb070d7 flags:# document:flags.0?Document ttl_seconds:flags.2?int = MessageMedia;
+messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;
+messageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;
+messageMediaGame#fdb19008 game:Game = MessageMedia;
+messageMediaInvoice#84551347 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string = MessageMedia;
+messageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia;
+messageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;
+messageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia;
+
+---functions---
+
+messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector<MessageEntity> = MessageMedia;
+messages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia;
+Constructor | +Description | +
---|---|
messageMediaEmpty | +Empty constructor. | +
messageMediaPhoto | +Attached photo. | +
messageMediaGeo | +Attached map. | +
messageMediaContact | +Attached contact. | +
messageMediaUnsupported | +Current version of the client does not support this media type. | +
messageMediaDocument | +Document (video, audio, voice, sticker, any media type except photo) | +
messageMediaWebPage | +Preview of webpage | +
messageMediaVenue | +Venue | +
messageMediaGame | +Telegram game | +
messageMediaInvoice | +Invoice | +
messageMediaGeoLive | +Indicates a live geolocation | +
messageMediaPoll | +Poll | +
messageMediaDice | +Dice | +
Method | +Description | +
---|---|
messages.getWebPagePreview | +Get preview of webpage | +
messages.uploadMedia | +Upload a file and associate it to a chat (without actually sending it to the chat) | +
Object describes message filter.
+inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
+inputMessagesFilterPhotos#9609a51c = MessagesFilter;
+inputMessagesFilterVideo#9fc00e65 = MessagesFilter;
+inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
+inputMessagesFilterDocument#9eddf188 = MessagesFilter;
+inputMessagesFilterUrl#7ef0dd87 = MessagesFilter;
+inputMessagesFilterGif#ffc86587 = MessagesFilter;
+inputMessagesFilterVoice#50f5c392 = MessagesFilter;
+inputMessagesFilterMusic#3751b49e = MessagesFilter;
+inputMessagesFilterChatPhotos#3a20ecb8 = MessagesFilter;
+inputMessagesFilterPhoneCalls#80c99768 flags:# missed:flags.0?true = MessagesFilter;
+inputMessagesFilterRoundVoice#7a7c17a4 = MessagesFilter;
+inputMessagesFilterRoundVideo#b549da53 = MessagesFilter;
+inputMessagesFilterMyMentions#c1f8e69a = MessagesFilter;
+inputMessagesFilterGeo#e7026d0d = MessagesFilter;
+inputMessagesFilterContacts#e062db83 = MessagesFilter;
+inputMessagesFilterPinned#1bb00451 = MessagesFilter;
+Constructor | +Description | +
---|---|
inputMessagesFilterEmpty | +Filter is absent. | +
inputMessagesFilterPhotos | +Filter for messages containing photos. | +
inputMessagesFilterVideo | +Filter for messages containing videos. | +
inputMessagesFilterPhotoVideo | +Filter for messages containing photos or videos. | +
inputMessagesFilterDocument | +Filter for messages containing documents. | +
inputMessagesFilterUrl | +Return only messages containing URLs | +
inputMessagesFilterGif | +Return only messages containing gifs | +
inputMessagesFilterVoice | +Return only messages containing voice notes | +
inputMessagesFilterMusic | +Return only messages containing audio files | +
inputMessagesFilterChatPhotos | +Return only chat photo changes | +
inputMessagesFilterPhoneCalls | +Return only phone calls | +
inputMessagesFilterRoundVoice | +Return only round videos and voice notes | +
inputMessagesFilterRoundVideo | +Return only round videos | +
inputMessagesFilterMyMentions | +Return only messages where the current user was mentioned | +
inputMessagesFilterGeo | +Return only messages containing geolocations | +
inputMessagesFilterContacts | +Return only messages containing contacts | +
inputMessagesFilterPinned | +Fetch only pinned messages | +
Phone call
+phoneCallEmpty#5366c915 id:long = PhoneCall;
+phoneCallWaiting#1b8f4ad1 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;
+phoneCallRequested#87eabb53 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;
+phoneCallAccepted#997c454a flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_b:bytes protocol:PhoneCallProtocol = PhoneCall;
+phoneCall#8742ae7f flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector<PhoneConnection> start_date:int = PhoneCall;
+phoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;
+Constructor | +Description | +
---|---|
phoneCallEmpty | +Empty constructor | +
phoneCallWaiting | +Incoming phone call | +
phoneCallRequested | +Requested phone call | +
phoneCallAccepted | +An accepted phone call | +
phoneCall | +Phone call | +
phoneCallDiscarded | +Indicates a discarded phone call | +
Installed themes
+account.themesNotModified#f41eb622 = account.Themes;
+account.themes#7f676421 hash:int themes:Vector<Theme> = account.Themes;
+
+---functions---
+
+account.getThemes#285946f8 format:string hash:int = account.Themes;
+Constructor | +Description | +
---|---|
account.themesNotModified | +No new themes were installed | +
account.themes | +Installed themes | +
Method | +Description | +
---|---|
account.getThemes | +Get installed themes | +
Contains info about the latest telegram Terms Of Service.
+help.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector<MessageEntity> min_age_confirm:flags.1?int = help.TermsOfService;
+Constructor | +Description | +
---|---|
help.termsOfService | +Info about the latest telegram Terms Of Service | +
A basic bare type, elements of which correspond to two-element sequences, representing 64-bit signed numbers (little-endian).
+ +Object contains info on one message with auxiliary data and data on the current state of updates.
+
We launched stickers back in January 2015. Since then, the Telegram sticker format has been adopted by other apps to reach a total of 2 billion people. Today we're introducing a new format for animated stickers.
+We asked ourselves: Can animated stickers have higher quality than static ones while taking less bandwidth? The answer turned out to be YES (but only after we told developers they'd get moving cat pictures).
+Telegram engineers experimented with vector graphics, packaging methods and forbidden magic to create the Lottie-based .TGS format, in which each sticker takes up about 20-30 Kilobytes – six times smaller than the average photo.
+Thanks to various optimizations, animated stickers consume less battery than GIFs and run at a smooth 60 frames per second. If a picture is worth a thousand words, that's 180,000 words per sticker.
+Naturally, animated stickers are a free platform. All artists are welcome to create new sets and share them with Telegram users.
+Like its static predecessor, the Telegram animated sticker format is likely to become the new industry standard in messaging. Check out this quick guide to get started.
+As always, the fastest way to find a sticker that fits your mood is to type in a relevant emoji – Telegram will immediately suggest matching stickers.
+Keep an eye out for new animated stickers – and our next update.
+July 6, 2019
The Telegram Team
++UPD: See Channels 2.0 for info on links to posts, silent messages and admin signatures.
+
Today we are introducing Channels, a new tool for broadcasting your messages to large audiences. Channels replace the old Broadcast lists and are better in every way. They can have an unlimited number of members, they can be public with a permanent URL and each post in a channel has its own view counter.
+Views from forwarded copies of your messages will be included in the total count. Last but not least, new members can see the entire message history in a channel once they join — all the way to day one.
+If you'd like an example, join our official Telegram channel to get notified about our updates, or try creating your own channels from the ‘New Message’ menu.
+In other good news, we‘ve added Quick Replies from notifications, which are now supported on iOS 9 devices. This means you can reply to messages in Telegram, directly from your iPhone’s lock screen. Split View and more iOS 9 features will become available in early October.
+Unfortunately, due to a bug in iOS 9, it is currently not possible to display the input field for Quick Replies right away — you‘ll need to press the ’Reply' button in order for it to appear. Quick replies will work as expected when iOS 9.1 is released with the relevant bugfixes.
+The in-app Photo Editor for iOS was updated with tools to adjust an image's tint, fade, and curves. The existing shadows and highlights tools default to 50% and are now functional in both directions.
+September 22, 2015
The Telegram Team
If you have feedback about the way an Instant View page was generated, ping our @previews bot. Only a handful of websites are supported at the moment, but we'll be adding more as we go. Eventually we want to provide Instant View pages for every story on the Web and thus devour the entire Internet (*evil laugh*).
+Today we are launching Telegraph – a publishing tool that lets you create richly formatted posts with photos and all sorts of embedded stuff. Telegraph posts get beautiful Instant View pages on Telegram.
+To try it, go to telegra.ph, publish a story, and share it on Telegram. With Telegraph, your Telegram channel can run stories just like the mainstream media (although you may find it tricky to become as biased).
+You can now travel in time to any moment in the past. Just tap Search inside a chat and choose a day using the Calendar tool.
+ + +Unfortunately, this doesn't work with dates from the future. Sorry, no flying cars and hoverboards for you today.
+Remember all those times when you had a sad Pepe among your recently sent stickers? If you‘re like us, your natural desire would’ve been to reunite the sad Pepe with the rest of his family by scrolling to the Pepe pack in your sticker panel.
+You can now do that in an instant: try a long tap (or 3D-touch on iOS) on a recent sticker, then choose ‘View Pack’. Hey presto! For some mysterious reason, this also works with non-Pepe stickers.
+Sometimes you want to find a group in your chats, but can‘t recall the title. Here’s a life-hack for you: think about a contact of yours that was also a member in that group. This association technique may help you bring back the title too. If it doesn‘t, open that contact’s profile and tap Groups in Common.
+Some of you Android users told us we loved iPhones more than Androids. That almost made us cry (remember the sad Pepe in our recent stickers?). To make things right with you, we fired our iOS dev, who was too good.
+Well, not really. We simply locked ourselves in the coding basement for several weeks to bring you this:
+And that's just getting us warmed up. Make Android Great Again!
+Something big is brewing in our secret dungeons. Stay tuned.
+November 22, 2016
The Telegram Team
Over 100 million new users joined Telegram this January, seeking more privacy and freedom. But what about the messages and memories that remain in older apps?
+Starting today, everyone can bring their chat history – including videos and documents – to Telegram from apps like WhatsApp, Line and KakaoTalk. This works both for individual chats and groups:
+To move a chat from WhatsApp on iOS, open the Contact Info or Group Info page in WhatsApp, tap Export Chat, then choose Telegram in the Share menu.
+On Android, open a WhatsApp chat, tap ⋮ > More > Export Chat, then choose Telegram in the Share menu:
+++WhatsApp for iOS also lets you export chats directly from the chat list. Swipe left on a chat, then choose '…' > Export Chat.
+
Messages will be imported into the current day but will also include their original timestamps. All members of the chat on Telegram will see the messages.
+The best part is that the messages and media you move don’t need to occupy extra space. Older apps make you store all data on your device – but Telegram can take up virtually no space while letting you access all your messages, photos and videos anytime you need them.
+++You can free up space and control your cache size in Settings > Data and Storage > Storage Usage.
+
Your data is your business, which is why Telegram users can not only export their chats, but also delete messages they send and receive for both sides – without a trace.
+With this update, you get even more control: secret chats, groups you created and call history can now also be deleted for all sides at any time.
+Telegram servers don’t store information about deleted chats and call logs, so the data will disappear completely, forever.
+You can now see which of your groups have active Voice Chats from the top of the Call History page.
+While in a voice chat you can adjust the volume of individual participants to manage microphone levels. Adjustments made by group admins are applied for all listeners.
+When a track is playing, tap the author name in the player to see their tracks from all your chats. If you need to skip ahead or repeat something you missed, press and hold on the Next and Previous buttons to fast-forward and rewind.
+We’ve also added a fade effect to please your ears when you pause and resume the music.
+If you have contacts who joined Telegram recently, it may be a nice touch to welcome them using one of Telegram's unique features. A greeting sticker will be suggested in your new chats, ready to send in one tap.
+A new update means sleek new interface animations. See if you can catch them all when downloading files, playing music, or loading chats after logging in.
+All Telegram apps let you report spam and other types of illegal content, including calls to violence or child abuse. Now you can also report fake channels or groups that impersonate famous people or organizations. Open their profile page and tap '…' > Report > Fake Account to let our moderators know.
+Many accessibility improvements have been added for both TalkBack and VoiceOver users. As we continue to refine app interfaces for all users, we welcome additional feedback on our Suggestions Platform.
+A warm welcome to everyone who joined us recently! The next update shouldn’t take long.
+January 28, 2021
The Telegram Team
Group chats have not evolved much since they first appeared in messaging apps many years ago. Today's new features bring group chat communication much closer to what it should look like in 2015. iOS, Android, OSX and Telegram Web get them first.
+To reply to a specific message in a group chat, simply tap on it (double-tap on iOS) and choose Reply. Easy as that!
+ + +The person you replied to will be notified about your message even if s/he muted the group chat — their notification settings for you personally apply in this case.
+Replies also make group chats much easier to navigate. If you tap on the quote, the app scrolls up to the original message.
+If you want several people within a group chat to get instantly involved in the conversation, you may now also mention them in a message, provided they have a username:
+ + +They will be notified about this message, even if they muted the group chat — unless they've muted you personally, of course!
+Another new way of bringing structure to group chats is by using hashtags. Any word starting with a “#” will be clickable. Tap on a hashtag to get instant search results from your Telegram messages.
+ + +On top of this, you can now add a comment to the stuff you forward. This comment will be shown before the forwarded messages.
+Group chats are becoming larger and livelier — a Telegram group may include up to 200 members that share thousands of messages daily. We hope that these new tools will help you bring order and clarity to the chaos of a thriving group chat.
+March 19, 2015
The Telegram Team
a new era of messaging
+The online theme editor allows you to create and modify your existing cloud themes for every platform. Any changes will appear in the apps immediately after you save them.
+ Log in to Theme Editor +