mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-11-28 19:23:11 +01:00
Update content of files
This commit is contained in:
parent
155f84dd00
commit
400a8a7342
6 changed files with 1344 additions and 0 deletions
148
data/core.telegram.org/api/animated-emojis.html
Normal file
148
data/core.telegram.org/api/animated-emojis.html
Normal file
|
@ -0,0 +1,148 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html class="">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Animated Emojis</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta property="description" content="Graphical telegram clients should transform emojis into their respective animated version.">
|
||||||
|
<meta property="og:title" content="Animated Emojis">
|
||||||
|
<meta property="og:image" content="">
|
||||||
|
<meta property="og:description" content="Graphical telegram clients should transform emojis into their respective animated version.">
|
||||||
|
<link rel="shortcut icon" href="/favicon.ico?4" type="image/x-icon" />
|
||||||
|
|
||||||
|
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
|
||||||
|
|
||||||
|
<link href="/css/telegram.css?212" rel="stylesheet" media="screen">
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="preload">
|
||||||
|
<div class="dev_page_wrap">
|
||||||
|
<div class="dev_page_head navbar navbar-static-top navbar-tg">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container clearfix">
|
||||||
|
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
<li><a href="//telegram.org/">Home</a></li>
|
||||||
|
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
|
||||||
|
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
|
||||||
|
<li class="active"><a href="/api">API</a></li>
|
||||||
|
<li class=""><a href="/mtproto">Protocol</a></li>
|
||||||
|
<li class=""><a href="/schema">Schema</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container clearfix">
|
||||||
|
<div class="dev_page">
|
||||||
|
<div id="dev_page_content_wrap" class=" ">
|
||||||
|
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/api/animated-emojis" >Animated Emojis</a></li></ul></div>
|
||||||
|
<h1 id="dev_page_title">Animated Emojis</h1>
|
||||||
|
|
||||||
|
<div id="dev_page_content"><p>Graphical telegram clients should transform emojis into their respective animated version. </p>
|
||||||
|
<pre><code><a href='/constructor/inputStickerSetAnimatedEmoji'>inputStickerSetAnimatedEmoji</a>#28703c8 = <a href='/type/InputStickerSet'>InputStickerSet</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/messages.stickerSet'>messages.stickerSet</a>#b60a24a6 set:<a href='/type/StickerSet'>StickerSet</a> packs:<a href='/type/Vector%20t'>Vector</a><<a href='/type/StickerPack'>StickerPack</a>> documents:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Document'>Document</a>> = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;
|
||||||
|
|
||||||
|
---functions---
|
||||||
|
|
||||||
|
<a href='/method/messages.getStickerSet'>messages.getStickerSet</a>#2619a90e stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;</code></pre>
|
||||||
|
<p>On startup, clients should fetch the animated emoji stickerset by calling the <a href="/method/messages.getStickerSet">messages.getStickerSet</a> method, providing <a href="/constructor/inputStickerSetAnimatedEmoji">inputStickerSetAnimatedEmoji</a> to the <code>stickerset</code> field.<br>
|
||||||
|
The returned stickerset will contain a set of animated stickers, one for each of the supported emojis. </p>
|
||||||
|
<p>Clients should substitute messages containing only one instance of one of the allowed emojis with the respective animated sticker. </p>
|
||||||
|
<p>Animated emojis should loop only once when first sent or received, or when clicked. </p>
|
||||||
|
<p>For special <a href="/api/dice">dice emojis</a> like <img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />, <img class="emoji" src="//telegram.org/img/emoji/40/F09F8EAF.png" width="20" height="20" alt="🎯" />, or <img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀" />, clients are supposed to behave differently both when sending and receiving such emojis: <a href="/api/dice">click here for more info »</a>.</p>
|
||||||
|
<h3><a class="anchor" href="#emojis-with-sounds" id="emojis-with-sounds" name="emojis-with-sounds"><i class="anchor-icon"></i></a>Emojis with sounds</h3>
|
||||||
|
<p>Certained animated emojis should play sound when clicked, as specified by <a href="/api/config#client-configuration">server-side configuration</a>. </p>
|
||||||
|
<p>The returned JSON object will contain the following map, with a list of file IDs to download:</p>
|
||||||
|
<pre><code> "emojies_sounds": {
|
||||||
|
"\ud83c\udf83": {
|
||||||
|
"id": "4956223179606458539",
|
||||||
|
"access_hash": "-2107001400913062971",
|
||||||
|
"file_reference_base64": "AF-4ApC7ukC0UWEPZN0TeSJURe7T"
|
||||||
|
},
|
||||||
|
"\u26b0": {
|
||||||
|
"id": "4956223179606458540",
|
||||||
|
"access_hash": "-1498869544183595185",
|
||||||
|
"file_reference_base64": "AF-4ApCLKMGt96WCvLm58kbqZHd3"
|
||||||
|
},
|
||||||
|
"\ud83e\udddf\u200d\u2642": {
|
||||||
|
"id": "4960929110848176331",
|
||||||
|
"access_hash": "3986395821757915468",
|
||||||
|
"file_reference_base64": "AF-4ApAedNln3IMEHH-SUQuH8L9g"
|
||||||
|
},
|
||||||
|
}</code></pre>
|
||||||
|
<p>The <a href="/api/file_reference">file reference field</a> should be base64-decoded before <a href="/api/files">downloading the file</a></p></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="footer_wrap">
|
||||||
|
<div class="footer_columns_wrap footer_desktop">
|
||||||
|
<div class="footer_column footer_column_telegram">
|
||||||
|
<h5>Telegram</h5>
|
||||||
|
<div class="footer_telegram_description"></div>
|
||||||
|
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="//telegram.org/faq">About</a></h5>
|
||||||
|
<ul>
|
||||||
|
<li><a href="//telegram.org/faq">FAQ</a></li>
|
||||||
|
<li><a href="//telegram.org/blog">Blog</a></li>
|
||||||
|
<li><a href="//telegram.org/jobs">Jobs</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
|
||||||
|
<ul>
|
||||||
|
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
|
||||||
|
<li><a href="//telegram.org/dl/android">Android</a></li>
|
||||||
|
<li><a href="//telegram.org/dl/wp">Windows Phone</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
|
||||||
|
<ul>
|
||||||
|
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
|
||||||
|
<li><a href="//macos.telegram.org/">macOS</a></li>
|
||||||
|
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="footer_column footer_column_platform">
|
||||||
|
<h5><a href="/">Platform</a></h5>
|
||||||
|
<ul>
|
||||||
|
<li><a href="/api">API</a></li>
|
||||||
|
<li><a href="//translations.telegram.org/">Translations</a></li>
|
||||||
|
<li><a href="//instantview.telegram.org/">Instant View</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="footer_columns_wrap footer_mobile">
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="//telegram.org/faq">About</a></h5>
|
||||||
|
</div>
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="//telegram.org/blog">Blog</a></h5>
|
||||||
|
</div>
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="//telegram.org/apps">Apps</a></h5>
|
||||||
|
</div>
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="/">Platform</a></h5>
|
||||||
|
</div>
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="/js/main.js?42"></script>
|
||||||
|
|
||||||
|
<script>backToTopInit("Go up");
|
||||||
|
removePreloadInit();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
550
data/core.telegram.org/api/files.html
Normal file
550
data/core.telegram.org/api/files.html
Normal file
|
@ -0,0 +1,550 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html class="">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Uploading and Downloading Files</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta property="description" content="How to transfer large data batches correctly.">
|
||||||
|
<meta property="og:title" content="Uploading and Downloading Files">
|
||||||
|
<meta property="og:image" content="1937a1be855ea8fce8">
|
||||||
|
<meta property="og:description" content="How to transfer large data batches correctly.">
|
||||||
|
<link rel="shortcut icon" href="/favicon.ico?4" type="image/x-icon" />
|
||||||
|
|
||||||
|
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
|
||||||
|
|
||||||
|
<link href="/css/telegram.css?212" rel="stylesheet" media="screen">
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="preload">
|
||||||
|
<div class="dev_page_wrap">
|
||||||
|
<div class="dev_page_head navbar navbar-static-top navbar-tg">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container clearfix">
|
||||||
|
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
<li><a href="//telegram.org/">Home</a></li>
|
||||||
|
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
|
||||||
|
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
|
||||||
|
<li class="active"><a href="/api">API</a></li>
|
||||||
|
<li class=""><a href="/mtproto">Protocol</a></li>
|
||||||
|
<li class=""><a href="/schema">Schema</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container clearfix">
|
||||||
|
<div class="dev_page">
|
||||||
|
<div id="dev_page_content_wrap" class=" ">
|
||||||
|
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/api/files" >Uploading and Downloading Files</a></li></ul></div>
|
||||||
|
<h1 id="dev_page_title">Uploading and Downloading Files</h1>
|
||||||
|
|
||||||
|
<div id="dev_page_content"><!-- scroll_nav -->
|
||||||
|
|
||||||
|
<p>When working with the API, it is sometimes necessary to send a relatively large file to the server. For example, when sending a message with a photo/video attachment or when setting the current user’s profile picture.</p>
|
||||||
|
<h3><a class="anchor" href="#uploading-files" id="uploading-files" name="uploading-files"><i class="anchor-icon"></i></a>Uploading files</h3>
|
||||||
|
<p>There are a number of API methods to save files. The schema of the types and methods used is presented below:</p>
|
||||||
|
<pre><code><a href='/constructor/inputFile'>inputFile</a>#f52ff27f id:<a href='/type/long'>long</a> parts:<a href='/type/int'>int</a> name:<a href='/type/string'>string</a> md5_checksum:<a href='/type/string'>string</a> = <a href='/type/InputFile'>InputFile</a>;
|
||||||
|
<a href='/constructor/inputFileBig'>inputFileBig</a>#fa4f0bb5 id:<a href='/type/long'>long</a> parts:<a href='/type/int'>int</a> name:<a href='/type/string'>string</a> = <a href='/type/InputFile'>InputFile</a>;
|
||||||
|
|
||||||
|
|
||||||
|
<a href='/constructor/inputEncryptedFileUploaded'>inputEncryptedFileUploaded</a>#64bd0306 id:<a href='/type/long'>long</a> parts:<a href='/type/int'>int</a> md5_checksum:<a href='/type/string'>string</a> key_fingerprint:<a href='/type/int'>int</a> = <a href='/type/InputEncryptedFile'>InputEncryptedFile</a>;
|
||||||
|
<a href='/constructor/inputEncryptedFileBigUploaded'>inputEncryptedFileBigUploaded</a>#2dc173c8 id:<a href='/type/long'>long</a> parts:<a href='/type/int'>int</a> key_fingerprint:<a href='/type/int'>int</a> = <a href='/type/InputEncryptedFile'>InputEncryptedFile</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/inputSecureFileUploaded'>inputSecureFileUploaded</a>#3334b0f0 id:<a href='/type/long'>long</a> parts:<a href='/type/int'>int</a> md5_checksum:<a href='/type/string'>string</a> file_hash:<a href='/type/bytes'>bytes</a> secret:<a href='/type/bytes'>bytes</a> = <a href='/type/InputSecureFile'>InputSecureFile</a>;
|
||||||
|
<a href='/constructor/inputSecureFile'>inputSecureFile</a>#5367e5be id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputSecureFile'>InputSecureFile</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/inputMediaUploadedPhoto'>inputMediaUploadedPhoto</a>#1e287d04 flags:<a href='/type/%23'>#</a> file:<a href='/type/InputFile'>InputFile</a> stickers:flags.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputDocument'>InputDocument</a>> ttl_seconds:flags.1?<a href='/type/int'>int</a> = <a href='/type/InputMedia'>InputMedia</a>;
|
||||||
|
<a href='/constructor/inputMediaUploadedDocument'>inputMediaUploadedDocument</a>#5b38c6c1 flags:<a href='/type/%23'>#</a> nosound_video:flags.3?<a href='/constructor/true'>true</a> force_file:flags.4?<a href='/constructor/true'>true</a> file:<a href='/type/InputFile'>InputFile</a> thumb:flags.2?<a href='/type/InputFile'>InputFile</a> mime_type:<a href='/type/string'>string</a> attributes:<a href='/type/Vector%20t'>Vector</a><<a href='/type/DocumentAttribute'>DocumentAttribute</a>> stickers:flags.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputDocument'>InputDocument</a>> ttl_seconds:flags.1?<a href='/type/int'>int</a> = <a href='/type/InputMedia'>InputMedia</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/inputChatUploadedPhoto'>inputChatUploadedPhoto</a>#c642724e flags:<a href='/type/%23'>#</a> file:flags.0?<a href='/type/InputFile'>InputFile</a> video:flags.1?<a href='/type/InputFile'>InputFile</a> video_start_ts:flags.2?<a href='/type/double'>double</a> = <a href='/type/InputChatPhoto'>InputChatPhoto</a>;
|
||||||
|
|
||||||
|
|
||||||
|
---functions---
|
||||||
|
|
||||||
|
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#3491eba9 flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to_msg_id:flags.0?<a href='/type/int'>int</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a><<a href='/type/MessageEntity'>MessageEntity</a>> schedule_date:flags.10?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;
|
||||||
|
<a href='/method/messages.uploadMedia'>messages.uploadMedia</a>#519bc2b1 peer:<a href='/type/InputPeer'>InputPeer</a> media:<a href='/type/InputMedia'>InputMedia</a> = <a href='/type/MessageMedia'>MessageMedia</a>;
|
||||||
|
<a href='/method/messages.sendEncryptedFile'>messages.sendEncryptedFile</a>#5559481d flags:<a href='/type/%23'>#</a> silent:flags.0?<a href='/constructor/true'>true</a> peer:<a href='/type/InputEncryptedChat'>InputEncryptedChat</a> random_id:<a href='/type/long'>long</a> data:<a href='/type/bytes'>bytes</a> file:<a href='/type/InputEncryptedFile'>InputEncryptedFile</a> = <a href='/type/messages.SentEncryptedMessage'>messages.SentEncryptedMessage</a>;
|
||||||
|
|
||||||
|
<a href='/method/photos.uploadProfilePhoto'>photos.uploadProfilePhoto</a>#89f30f69 flags:<a href='/type/%23'>#</a> file:flags.0?<a href='/type/InputFile'>InputFile</a> video:flags.1?<a href='/type/InputFile'>InputFile</a> video_start_ts:flags.2?<a href='/type/double'>double</a> = <a href='/type/photos.Photo'>photos.Photo</a>;
|
||||||
|
|
||||||
|
<a href='/method/upload.saveFilePart'>upload.saveFilePart</a>#b304a621 file_id:<a href='/type/long'>long</a> file_part:<a href='/type/int'>int</a> bytes:<a href='/type/bytes'>bytes</a> = <a href='/type/Bool'>Bool</a>;
|
||||||
|
<a href='/method/upload.saveBigFilePart'>upload.saveBigFilePart</a>#de7b673d file_id:<a href='/type/long'>long</a> file_part:<a href='/type/int'>int</a> file_total_parts:<a href='/type/int'>int</a> bytes:<a href='/type/bytes'>bytes</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||||
|
<p>Before transmitting the contents of the file itself, the file has to be assigned a unique 64-bit client identifier: <strong>file_id</strong>.</p>
|
||||||
|
<p>The file’s binary content is then split into parts. All parts must have the same size ( <strong>part_size</strong> ) and the following conditions must be met:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>part_size % 1024 = 0</code> (divisible by 1KB)</li>
|
||||||
|
<li><code>524288 % part_size = 0</code> (512KB must be evenly divisible by <strong>part_size</strong>)</li>
|
||||||
|
</ul>
|
||||||
|
<p>The last part does not have to satisfy these conditions, provided its size is less than <strong>part_size</strong>.</p>
|
||||||
|
<p>Each part should have a sequence number, <strong>file_part</strong>, with a value ranging from 0 to 2,999.</p>
|
||||||
|
<p>After the file has been partitioned you need to choose a method for saving it on the server. Use <a href="/method/upload.saveBigFilePart">upload.saveBigFilePart</a> in case the full size of the file is more than <strong>10 MB</strong> and <a href="/method/upload.saveFilePart">upload.saveFilePart</a> for smaller files.</p>
|
||||||
|
<p>Each call saves a portion of the data in a temporary location on the server to be used later. The storage life of each portion of data is between several minutes and several hours (depending on how busy the storage area is). After this time, the file part will become unavailable. To increase the time efficiency of a file save operation, we recommend using a call queue, so X pieces of the file are being saved at any given moment in time. Each successful operation to save a part invokes the method call to save the next part. The value of X can be tuned to achieve maximum performance.</p>
|
||||||
|
<p>When using one of the methods mentioned above to save file parts, one of the following <a href="/api/errors#400-bad-request">data input errors</a> may be returned:</p>
|
||||||
|
<ul>
|
||||||
|
<li>FILE_PARTS_INVALID - Invalid number of parts. The value is not between <code>1..3000</code></li>
|
||||||
|
<li>FILE_PART_INVALID: The file part number is invalid. The value is not between <code>0 and 2,999</code>.</li>
|
||||||
|
<li>FILE_PART_TOO_BIG: The size limit (512 KB) for the content of the file part has been exceeded</li>
|
||||||
|
<li>FILE_PART_EMPTY: The file part sent is empty</li>
|
||||||
|
<li>FILE_PART_SIZE_INVALID - 512KB cannot be evenly divided by <strong>part_size</strong></li>
|
||||||
|
<li>FILE_PART_SIZE_CHANGED - The part size is different from the size of one of the previous parts in the same file</li>
|
||||||
|
</ul>
|
||||||
|
<p>While the parts are being uploaded, an <a href="https://en.wikipedia.org/wiki/MD5">MD5 hash</a> of the file contents can also be computed to be used later as the <strong>md5_checksum</strong> parameter in the <a href="/constructor/inputFile">inputFile</a> constructor (since it is checked only by the server, for encrypted secret chat files it must be generated from the encrypted file).
|
||||||
|
After the entire file is successfully saved, the final method may be called and passed the generated <a href="/type/InputFile">inputFile</a> object. In case the <a href="/method/upload.saveBigFilePart">upload.saveBigFilePart</a> method is used, the <a href="/constructor/inputFileBig">inputFileBig</a> constructor must be passed, in other cases use <a href="/constructor/inputFile">inputFile</a>.</p>
|
||||||
|
<ul>
|
||||||
|
<li><a href="/method/messages.sendMedia">messages.sendMedia</a> - Sends a media file to a chat</li>
|
||||||
|
<li><a href="/method/messages.uploadMedia">messages.uploadMedia</a> - Uploads a media file to a chat, without sending it, returning only a <a href="/type/MessageMedia">MessageMedia</a> constructor that can be used to later send the file to multiple chats, without reuploading it every time. </li>
|
||||||
|
<li><a href="/method/photos.uploadProfilePhoto">photos.uploadProfilePhoto</a> - Used to set a <a href="#uploading-profile-or-chat-pictures">profile or chat picture or video</a></li>
|
||||||
|
</ul>
|
||||||
|
<p>The file save operation may return one of the following <a href="/api/errors#400-bad-request">data input errors</a>:</p>
|
||||||
|
<ul>
|
||||||
|
<li>FILE_PARTS_INVALID: The number of file parts is invalid The value is not between 1 and 3,000.</li>
|
||||||
|
<li>FILE_PART_Х_MISSING: Part X (where X is a number) of the file is missing from storage. Try repeating the method call to resave the part.</li>
|
||||||
|
<li>MD5_CHECKSUM_INVALID: The file’s checksum did not match the <strong>md5_checksum</strong> parameter</li>
|
||||||
|
</ul>
|
||||||
|
<h4><a class="anchor" href="#albums-grouped-media" id="albums-grouped-media" name="albums-grouped-media"><i class="anchor-icon"></i></a>Albums, grouped media</h4>
|
||||||
|
<pre><code><a href='/constructor/inputMediaUploadedPhoto'>inputMediaUploadedPhoto</a>#1e287d04 flags:<a href='/type/%23'>#</a> file:<a href='/type/InputFile'>InputFile</a> stickers:flags.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputDocument'>InputDocument</a>> ttl_seconds:flags.1?<a href='/type/int'>int</a> = <a href='/type/InputMedia'>InputMedia</a>;
|
||||||
|
<a href='/constructor/inputMediaUploadedDocument'>inputMediaUploadedDocument</a>#5b38c6c1 flags:<a href='/type/%23'>#</a> nosound_video:flags.3?<a href='/constructor/true'>true</a> force_file:flags.4?<a href='/constructor/true'>true</a> file:<a href='/type/InputFile'>InputFile</a> thumb:flags.2?<a href='/type/InputFile'>InputFile</a> mime_type:<a href='/type/string'>string</a> attributes:<a href='/type/Vector%20t'>Vector</a><<a href='/type/DocumentAttribute'>DocumentAttribute</a>> stickers:flags.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputDocument'>InputDocument</a>> ttl_seconds:flags.1?<a href='/type/int'>int</a> = <a href='/type/InputMedia'>InputMedia</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/inputSingleMedia'>inputSingleMedia</a>#1cc6e91f flags:<a href='/type/%23'>#</a> media:<a href='/type/InputMedia'>InputMedia</a> random_id:<a href='/type/long'>long</a> message:<a href='/type/string'>string</a> entities:flags.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/MessageEntity'>MessageEntity</a>> = <a href='/type/InputSingleMedia'>InputSingleMedia</a>;
|
||||||
|
|
||||||
|
---functions---
|
||||||
|
|
||||||
|
<a href='/method/messages.sendMultiMedia'>messages.sendMultiMedia</a>#cc0110cb flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to_msg_id:flags.0?<a href='/type/int'>int</a> multi_media:<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputSingleMedia'>InputSingleMedia</a>> schedule_date:flags.10?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||||
|
<p>Telegram allows grouping photos into <a href="https://telegram.org/blog/albums-saved-messages">albums</a> and generic files (audio, docuemnts) into media groups. </p>
|
||||||
|
<p>To do this, <a href="/method/messages.sendMultiMedia">messages.sendMultiMedia</a> is used, wrapping each <a href="/type/InputMedia">InputMedia</a> constructor (uploaded or pre-existing, maximum 10 per media group) into an <a href="/constructor/inputSingleMedia">inputSingleMedia</a> constructor, optionally providing a custom per-file caption in <code>message</code>. </p>
|
||||||
|
<p>For photo albums, clients should display an album caption only if exactly one photo in the group has a caption, otherwise no album caption should be displayed, and only when viewing in detail a specific photo of the group the caption should be shown.<br>
|
||||||
|
Other grouped media can display a caption under each file. </p>
|
||||||
|
<h4><a class="anchor" href="#re-using-pre-uploaded-files" id="re-using-pre-uploaded-files" name="re-using-pre-uploaded-files"><i class="anchor-icon"></i></a>Re-using pre-uploaded files</h4>
|
||||||
|
<pre><code><a href='/constructor/document'>document</a>#1e87342b flags:<a href='/type/%23'>#</a> id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> date:<a href='/type/int'>int</a> mime_type:<a href='/type/string'>string</a> size:<a href='/type/int'>int</a> thumbs:flags.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/PhotoSize'>PhotoSize</a>> video_thumbs:flags.1?<a href='/type/Vector%20t'>Vector</a><<a href='/type/VideoSize'>VideoSize</a>> dc_id:<a href='/type/int'>int</a> attributes:<a href='/type/Vector%20t'>Vector</a><<a href='/type/DocumentAttribute'>DocumentAttribute</a>> = <a href='/type/Document'>Document</a>;
|
||||||
|
|
||||||
|
---functions---
|
||||||
|
|
||||||
|
<a href='/method/messages.getDocumentByHash'>messages.getDocumentByHash</a>#338e2464 sha256:<a href='/type/bytes'>bytes</a> size:<a href='/type/int'>int</a> mime_type:<a href='/type/string'>string</a> = <a href='/type/Document'>Document</a>;</code></pre>
|
||||||
|
<p>For some types of documents like GIFs, <a href="/method/messages.getDocumentByHash">messages.getDocumentByHash</a> can be used to search for the document on Telegram servers.
|
||||||
|
The SHA256 hash of the file is computed, and it is passed along with the file's mime type and size to the method: if the file type is correct and the file is found, a <a href="/constructor/document">document</a> is returned.</p>
|
||||||
|
<h3><a class="anchor" href="#uploading-profile-or-chat-pictures" id="uploading-profile-or-chat-pictures" name="uploading-profile-or-chat-pictures"><i class="anchor-icon"></i></a>Uploading profile or chat pictures</h3>
|
||||||
|
<pre><code><a href='/constructor/photo'>photo</a>#fb197a65 flags:<a href='/type/%23'>#</a> has_stickers:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> date:<a href='/type/int'>int</a> sizes:<a href='/type/Vector%20t'>Vector</a><<a href='/type/PhotoSize'>PhotoSize</a>> video_sizes:flags.1?<a href='/type/Vector%20t'>Vector</a><<a href='/type/VideoSize'>VideoSize</a>> dc_id:<a href='/type/int'>int</a> = <a href='/type/Photo'>Photo</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/photos.photo'>photos.photo</a>#20212ca8 photo:<a href='/type/Photo'>Photo</a> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/photos.Photo'>photos.Photo</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/inputPhoto'>inputPhoto</a>#3bb3b94a id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> = <a href='/type/InputPhoto'>InputPhoto</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/inputFile'>inputFile</a>#f52ff27f id:<a href='/type/long'>long</a> parts:<a href='/type/int'>int</a> name:<a href='/type/string'>string</a> md5_checksum:<a href='/type/string'>string</a> = <a href='/type/InputFile'>InputFile</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/inputChatUploadedPhoto'>inputChatUploadedPhoto</a>#c642724e flags:<a href='/type/%23'>#</a> file:flags.0?<a href='/type/InputFile'>InputFile</a> video:flags.1?<a href='/type/InputFile'>InputFile</a> video_start_ts:flags.2?<a href='/type/double'>double</a> = <a href='/type/InputChatPhoto'>InputChatPhoto</a>;
|
||||||
|
<a href='/constructor/inputChatPhoto'>inputChatPhoto</a>#8953ad37 id:<a href='/type/InputPhoto'>InputPhoto</a> = <a href='/type/InputChatPhoto'>InputChatPhoto</a>;
|
||||||
|
|
||||||
|
---functions---
|
||||||
|
|
||||||
|
<a href='/method/photos.updateProfilePhoto'>photos.updateProfilePhoto</a>#72d4742c id:<a href='/type/InputPhoto'>InputPhoto</a> = <a href='/type/photos.Photo'>photos.Photo</a>;
|
||||||
|
<a href='/method/photos.uploadProfilePhoto'>photos.uploadProfilePhoto</a>#89f30f69 flags:<a href='/type/%23'>#</a> file:flags.0?<a href='/type/InputFile'>InputFile</a> video:flags.1?<a href='/type/InputFile'>InputFile</a> video_start_ts:flags.2?<a href='/type/double'>double</a> = <a href='/type/photos.Photo'>photos.Photo</a>;
|
||||||
|
|
||||||
|
<a href='/method/messages.editChatPhoto'>messages.editChatPhoto</a>#ca4c79d8 chat_id:<a href='/type/int'>int</a> photo:<a href='/type/InputChatPhoto'>InputChatPhoto</a> = <a href='/type/Updates'>Updates</a>;
|
||||||
|
|
||||||
|
<a href='/method/channels.editPhoto'>channels.editPhoto</a>#f12e57c9 channel:<a href='/type/InputChannel'>InputChannel</a> photo:<a href='/type/InputChatPhoto'>InputChatPhoto</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||||
|
<p>User profile pictures can be uploaded using the <a href="/method/photos.updateProfilePhoto">photos.uploadProfilePhoto</a> method: the actual profile picture has to be <a href="#uploading-files">uploaded as for normal files</a>.<br>
|
||||||
|
<a href="/method/photos.updateProfilePhoto">photos.uploadProfilePhoto</a> can also be used to reupload previously uploaded profile pictures. </p>
|
||||||
|
<h4><a class="anchor" href="#animated-profile-pictures" id="animated-profile-pictures" name="animated-profile-pictures"><i class="anchor-icon"></i></a>Animated profile pictures</h4>
|
||||||
|
<p>Animated profile pictures are also supported, by populating the <code>video</code> constructor: square MPEG4 videos up to <code>1080x1080</code> are supported, <code>800x800</code> is the recommended resolution.<br>
|
||||||
|
The <code>video_start_ts</code> is a floating point UNIX timestamp in seconds, indicating the frame of the video that should be used as static preview. </p>
|
||||||
|
<p><a href="/api/channel">Chat, channel and supergroup</a> profile photos and videos can be uploaded using <a href="/method/messages.editChatPhoto">messages.editChatPhoto</a> (<a href="/api/channel">legacy groups</a>) or <a href="/method/channels.editPhoto">channels.editPhoto</a> (<a href="/api/channel">channels, supergroups</a>).<br>
|
||||||
|
Use the <a href="/constructor/inputChatPhoto">inputChatPhoto</a> to reuse previously uploaded profile pictures. </p>
|
||||||
|
<h3><a class="anchor" href="#downloading-files" id="downloading-files" name="downloading-files"><i class="anchor-icon"></i></a>Downloading files</h3>
|
||||||
|
<p>There are methods available to download files which have been successfully uploaded. The schema of the types and methods used is presented below:</p>
|
||||||
|
<pre><code><a href='/constructor/upload.file'>upload.file</a>#96a18d5 type:<a href='/type/storage.FileType'>storage.FileType</a> mtime:<a href='/type/int'>int</a> bytes:<a href='/type/bytes'>bytes</a> = <a href='/type/upload.File'>upload.File</a>;
|
||||||
|
<a href='/constructor/upload.fileCdnRedirect'>upload.fileCdnRedirect</a>#f18cda44 dc_id:<a href='/type/int'>int</a> file_token:<a href='/type/bytes'>bytes</a> encryption_key:<a href='/type/bytes'>bytes</a> encryption_iv:<a href='/type/bytes'>bytes</a> file_hashes:<a href='/type/Vector%20t'>Vector</a><<a href='/type/FileHash'>FileHash</a>> = <a href='/type/upload.File'>upload.File</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/storage.fileUnknown'>storage.fileUnknown</a>#aa963b05 = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.fileJpeg'>storage.fileJpeg</a>#7efe0e = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.fileGif'>storage.fileGif</a>#cae1aadf = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.filePng'>storage.filePng</a>#a4f63c0 = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.fileMp3'>storage.fileMp3</a>#528a0677 = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.fileMov'>storage.fileMov</a>#4b09ebbc = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.filePartial'>storage.filePartial</a>#40bc6f52 = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.fileMp4'>storage.fileMp4</a>#b3cea0e4 = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.fileWebp'>storage.fileWebp</a>#1081464c = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
|
||||||
|
---functions---
|
||||||
|
|
||||||
|
<a href='/method/upload.getFile'>upload.getFile</a>#b15a9afc flags:<a href='/type/%23'>#</a> precise:flags.0?<a href='/constructor/true'>true</a> cdn_supported:flags.1?<a href='/constructor/true'>true</a> location:<a href='/type/InputFileLocation'>InputFileLocation</a> offset:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/upload.File'>upload.File</a>;</code></pre>
|
||||||
|
<p>Any file can be downloaded by calling <a href="/method/upload.getFile">upload.getFile</a>.
|
||||||
|
The data for the input parameter of the <a href="/type/InputFileLocation">InputFileLocation</a> type is generated as follows:</p>
|
||||||
|
<pre><code><a href='/constructor/inputFileLocation'>inputFileLocation</a>#dfdaabe1 volume_id:<a href='/type/long'>long</a> local_id:<a href='/type/int'>int</a> secret:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> = <a href='/type/InputFileLocation'>InputFileLocation</a>;
|
||||||
|
<a href='/constructor/inputEncryptedFileLocation'>inputEncryptedFileLocation</a>#f5235d55 id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputFileLocation'>InputFileLocation</a>;
|
||||||
|
<a href='/constructor/inputDocumentFileLocation'>inputDocumentFileLocation</a>#bad07584 id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> thumb_size:<a href='/type/string'>string</a> = <a href='/type/InputFileLocation'>InputFileLocation</a>;
|
||||||
|
<a href='/constructor/inputSecureFileLocation'>inputSecureFileLocation</a>#cbc7ee28 id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputFileLocation'>InputFileLocation</a>;
|
||||||
|
<a href='/constructor/inputTakeoutFileLocation'>inputTakeoutFileLocation</a>#29be5899 = <a href='/type/InputFileLocation'>InputFileLocation</a>;
|
||||||
|
<a href='/constructor/inputPhotoFileLocation'>inputPhotoFileLocation</a>#40181ffe id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> thumb_size:<a href='/type/string'>string</a> = <a href='/type/InputFileLocation'>InputFileLocation</a>;
|
||||||
|
<a href='/constructor/inputPhotoLegacyFileLocation'>inputPhotoLegacyFileLocation</a>#d83466f3 id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> volume_id:<a href='/type/long'>long</a> local_id:<a href='/type/int'>int</a> secret:<a href='/type/long'>long</a> = <a href='/type/InputFileLocation'>InputFileLocation</a>;
|
||||||
|
<a href='/constructor/inputPeerPhotoFileLocation'>inputPeerPhotoFileLocation</a>#27d69997 flags:<a href='/type/%23'>#</a> big:flags.0?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> volume_id:<a href='/type/long'>long</a> local_id:<a href='/type/int'>int</a> = <a href='/type/InputFileLocation'>InputFileLocation</a>;
|
||||||
|
<a href='/constructor/inputStickerSetThumb'>inputStickerSetThumb</a>#dbaeae9 stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> volume_id:<a href='/type/long'>long</a> local_id:<a href='/type/int'>int</a> = <a href='/type/InputFileLocation'>InputFileLocation</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/inputStickerSetEmpty'>inputStickerSetEmpty</a>#ffb62b95 = <a href='/type/InputStickerSet'>InputStickerSet</a>;
|
||||||
|
<a href='/constructor/inputStickerSetID'>inputStickerSetID</a>#9de7a269 id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
|
||||||
|
<a href='/constructor/inputStickerSetShortName'>inputStickerSetShortName</a>#861cc8a0 short_name:<a href='/type/string'>string</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/inputPeerSelf'>inputPeerSelf</a>#7da07ec9 = <a href='/type/InputPeer'>InputPeer</a>;
|
||||||
|
<a href='/constructor/inputPeerChat'>inputPeerChat</a>#179be863 chat_id:<a href='/type/int'>int</a> = <a href='/type/InputPeer'>InputPeer</a>;
|
||||||
|
<a href='/constructor/inputPeerUser'>inputPeerUser</a>#7b8e7de6 user_id:<a href='/type/int'>int</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputPeer'>InputPeer</a>;
|
||||||
|
<a href='/constructor/inputPeerChannel'>inputPeerChannel</a>#20adaef8 channel_id:<a href='/type/int'>int</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputPeer'>InputPeer</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/photo'>photo</a>#fb197a65 flags:<a href='/type/%23'>#</a> has_stickers:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> date:<a href='/type/int'>int</a> sizes:<a href='/type/Vector%20t'>Vector</a><<a href='/type/PhotoSize'>PhotoSize</a>> video_sizes:flags.1?<a href='/type/Vector%20t'>Vector</a><<a href='/type/VideoSize'>VideoSize</a>> dc_id:<a href='/type/int'>int</a> = <a href='/type/Photo'>Photo</a>;
|
||||||
|
<a href='/constructor/document'>document</a>#1e87342b flags:<a href='/type/%23'>#</a> id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> date:<a href='/type/int'>int</a> mime_type:<a href='/type/string'>string</a> size:<a href='/type/int'>int</a> thumbs:flags.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/PhotoSize'>PhotoSize</a>> video_thumbs:flags.1?<a href='/type/Vector%20t'>Vector</a><<a href='/type/VideoSize'>VideoSize</a>> dc_id:<a href='/type/int'>int</a> attributes:<a href='/type/Vector%20t'>Vector</a><<a href='/type/DocumentAttribute'>DocumentAttribute</a>> = <a href='/type/Document'>Document</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/photoSize'>photoSize</a>#77bfb61b type:<a href='/type/string'>string</a> location:<a href='/type/FileLocation'>FileLocation</a> w:<a href='/type/int'>int</a> h:<a href='/type/int'>int</a> size:<a href='/type/int'>int</a> = <a href='/type/PhotoSize'>PhotoSize</a>;
|
||||||
|
<a href='/constructor/photoCachedSize'>photoCachedSize</a>#e9a734fa type:<a href='/type/string'>string</a> location:<a href='/type/FileLocation'>FileLocation</a> w:<a href='/type/int'>int</a> h:<a href='/type/int'>int</a> bytes:<a href='/type/bytes'>bytes</a> = <a href='/type/PhotoSize'>PhotoSize</a>;</code></pre>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<p>For photos, <a href="/constructor/inputPhotoFileLocation">inputPhotoFileLocation</a> is used:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>id</code>, <code>file_reference</code> and <code>access_hash</code> taken from the <a href="/constructor/photo">photo</a> constructor</li>
|
||||||
|
<li><code>thumb_size</code> taken from the <code>type</code> field of the desired <a href="/type/PhotoSize">PhotoSize</a> of the <a href="/constructor/photo">photo</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>For profile pictures of users, channels, supergroups and groups, since in most occasions they are encountered as simple <a href="/constructor/fileLocationToBeDeprecated">fileLocationToBeDeprecated</a> constructors without an associated <a href="/constructor/photo">photo</a>, <a href="/constructor/inputPeerPhotoFileLocation">inputPeerPhotoFileLocation</a> has to be used:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>peer</code> is the identifier of the peer whose photo we want to download</li>
|
||||||
|
<li><code>volume_id</code> and <code>local_id</code> are extracted from the <a href="/constructor/fileLocationToBeDeprecated">fileLocationToBeDeprecated</a> of the desired quality (the logic for selecting the quality of profile pictures will be changed soon)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>For documents, <a href="/constructor/inputDocumentFileLocation">inputDocumentFileLocation</a> is used:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>id</code>, <code>file_reference</code> and <code>access_hash</code> taken from the <a href="/constructor/document">document</a> constructor</li>
|
||||||
|
<li>If downloading the thumbnail of a document, <code>thumb_size</code> should be taken from the <code>type</code> field of the desired <a href="/type/PhotoSize">PhotoSize</a> of the <a href="/constructor/photo">photo</a>; otherwise, provide an empty string.</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>For encrypted secret chat and telegram passport documents, respectively <a href="/constructor/inputEncryptedFileLocation">inputEncryptedFileLocation</a> and <a href="/constructor/inputSecureFileLocation">inputSecureFileLocation</a> have to be used, with parameters extracted from <a href="/constructor/encryptedFile">encryptedFile</a> and <a href="/constructor/secureFile">secureFile</a> (<a href="/passport">passport docs</a>).</p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>For previews of sticker sets, <a href="/constructor/inputStickerSetThumb">inputStickerSetThumb</a> is used (note: to download stickers and previews of stickers use the document method described above):</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>stickerset</code> is set to the <a href="/type/InputStickerSet">InputStickerSet</a> constructor generated from the <a href="/type/StickerSet">StickerSet</a></li>
|
||||||
|
<li><code>volume_id</code> and <code>local_id</code> are extracted from the <a href="/constructor/fileLocationToBeDeprecated">fileLocationToBeDeprecated</a> from the <code>thumb</code> <a href="/type/PhotoSize">PhotoSize</a> of the <a href="/type/StickerSet">StickerSet</a> (the logic for downloading stickerset previews will be changed soon)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>For old <strong>deprecated</strong> photos, if the client has cached some old fileLocations with the <strong>deprecated</strong> <code>secret</code> identifier, <a href="/constructor/inputPhotoLegacyFileLocation">inputFileLocation</a> is used (this is mainly used for backwards compatiblity with bot API file IDs, all user clients must use the modern <a href="/constructor/inputPhotoFileLocation">inputPhotoFileLocation</a> file IDs): </p>
|
||||||
|
<ul>
|
||||||
|
<li>All fields are taken from the previously cached fileLocation except for <code>id</code>, <code>file_reference</code> and <code>access_hash</code> taken from the <a href="/constructor/photo">photo</a> constructor</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p>The size of each file in bytes is available, which makes it possible to download the file in parts using the parameters <strong>offset</strong> and <strong>limit</strong>, similar to the way files are uploaded.</p>
|
||||||
|
<p>If <strong>precise</strong> flag is not specified, then </p>
|
||||||
|
<ul>
|
||||||
|
<li>The parameter <strong>offset</strong> must be divisible by 4 KB.</li>
|
||||||
|
<li>The parameter <strong>limit</strong> must be divisible by 4 KB.</li>
|
||||||
|
<li>1048576 (1 MB) must be divisible by <strong>limit</strong>.</li>
|
||||||
|
</ul>
|
||||||
|
<p>If <strong>precise</strong> is specified, then</p>
|
||||||
|
<ul>
|
||||||
|
<li>The parameter <strong>offset</strong> must be divisible by 1 KB.</li>
|
||||||
|
<li>The parameter <strong>limit</strong> must be divisible by 1 KB.</li>
|
||||||
|
<li><strong>limit</strong> must not exceed 1048576 (1 MB).</li>
|
||||||
|
</ul>
|
||||||
|
<p>In any case the requested part should be within one 1 MB chunk from the beginning of the file, i. e.</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>offset</strong> / (1024 * 1024) == (<strong>offset</strong> + <strong>limit</strong> - 1) / (1024 * 1024).</li>
|
||||||
|
</ul>
|
||||||
|
<p>The file download operation may return a <code>FILE_REFERENCE_EXPIRED</code> error (or another error starting with <code>FILE_REFERENCE_</code>): in this case, the <code>file_reference</code> field of the input location must be <a href="/api/file_reference">refreshed</a>.
|
||||||
|
The file download operation may return an <a href="/constructor/upload.fileCdnRedirect">upload.fileCdnRedirect</a> constructor: in this case, <a href="/cdn">these</a> instructions must be followed for downloading CDN files.
|
||||||
|
The file download operation may also return one of the following <a href="/api/errors#400-bad-request">data input errors</a>:</p>
|
||||||
|
<ul>
|
||||||
|
<li>FILE_ID_INVALID: The file address is invalid</li>
|
||||||
|
<li>OFFSET_INVALID: The <strong>offset</strong> value is invalid</li>
|
||||||
|
<li>LIMIT_INVALID: The <strong>limit</strong> value is invalid</li>
|
||||||
|
<li>FILE_MIGRATE_X: The file is in the datacenter No. X</li>
|
||||||
|
</ul>
|
||||||
|
<h4><a class="anchor" href="#verifying-downloaded-chunks" id="verifying-downloaded-chunks" name="verifying-downloaded-chunks"><i class="anchor-icon"></i></a>Verifying downloaded chunks</h4>
|
||||||
|
<pre><code><a href='/constructor/fileHash'>fileHash</a>#6242c773 offset:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> hash:<a href='/type/bytes'>bytes</a> = <a href='/type/FileHash'>FileHash</a>;
|
||||||
|
|
||||||
|
---functions---
|
||||||
|
|
||||||
|
<a href='/method/upload.getFileHashes'>upload.getFileHashes</a>#c7025931 location:<a href='/type/InputFileLocation'>InputFileLocation</a> offset:<a href='/type/int'>int</a> = <a href='/type/Vector%20t'>Vector</a><<a href='/type/FileHash'>FileHash</a>>;</code></pre>
|
||||||
|
<p>In order to confirm the integrity of the downloaded file, clients are recommended to verify hashes for each downloaded part, as for <a href="/cdn">CDN DCs</a>.
|
||||||
|
<a href="/method/upload.getFileHashes">upload.getFileHashes</a> contain <a href="/type/FileHash">FileHash</a> constructors. Each of these constructors contains the SHA-256 hash of a part of the file that starts with <code>offset</code> and takes <code>limit</code> bytes.</p>
|
||||||
|
<p>Before saving each portion of the data received from the DC into the file, the client can confirm that its hash matches the hash that was received from the master DC. If missing a hash for any file part, client developers must use the <a href="/method/upload.getFileHashes">upload.getFileHashes</a> method to obtain the missing hash.</p>
|
||||||
|
<h4><a class="anchor" href="#handling-audio-video-and-vector-previews" id="handling-audio-video-and-vector-previews" name="handling-audio-video-and-vector-previews"><i class="anchor-icon"></i></a>Handling audio, video and vector previews</h4>
|
||||||
|
<p>Scheme:</p>
|
||||||
|
<pre><code><a href='/constructor/photoSizeEmpty'>photoSizeEmpty</a>#e17e23c type:<a href='/type/string'>string</a> = <a href='/type/PhotoSize'>PhotoSize</a>;
|
||||||
|
<a href='/constructor/photoSize'>photoSize</a>#77bfb61b type:<a href='/type/string'>string</a> location:<a href='/type/FileLocation'>FileLocation</a> w:<a href='/type/int'>int</a> h:<a href='/type/int'>int</a> size:<a href='/type/int'>int</a> = <a href='/type/PhotoSize'>PhotoSize</a>;
|
||||||
|
<a href='/constructor/photoCachedSize'>photoCachedSize</a>#e9a734fa type:<a href='/type/string'>string</a> location:<a href='/type/FileLocation'>FileLocation</a> w:<a href='/type/int'>int</a> h:<a href='/type/int'>int</a> bytes:<a href='/type/bytes'>bytes</a> = <a href='/type/PhotoSize'>PhotoSize</a>;
|
||||||
|
<a href='/constructor/photoStrippedSize'>photoStrippedSize</a>#e0b0bc2e type:<a href='/type/string'>string</a> bytes:<a href='/type/bytes'>bytes</a> = <a href='/type/PhotoSize'>PhotoSize</a>;
|
||||||
|
<a href='/constructor/photoSizeProgressive'>photoSizeProgressive</a>#5aa86a51 type:<a href='/type/string'>string</a> location:<a href='/type/FileLocation'>FileLocation</a> w:<a href='/type/int'>int</a> h:<a href='/type/int'>int</a> sizes:<a href='/type/Vector%20t'>Vector</a><<a href='/type/int'>int</a>> = <a href='/type/PhotoSize'>PhotoSize</a>;
|
||||||
|
<a href='/constructor/photoPathSize'>photoPathSize</a>#d8214d41 type:<a href='/type/string'>string</a> bytes:<a href='/type/bytes'>bytes</a> = <a href='/type/PhotoSize'>PhotoSize</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/videoSize'>videoSize</a>#e831c556 flags:<a href='/type/%23'>#</a> type:<a href='/type/string'>string</a> location:<a href='/type/FileLocation'>FileLocation</a> w:<a href='/type/int'>int</a> h:<a href='/type/int'>int</a> size:<a href='/type/int'>int</a> video_start_ts:flags.0?<a href='/type/double'>double</a> = <a href='/type/VideoSize'>VideoSize</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/document'>document</a>#1e87342b flags:<a href='/type/%23'>#</a> id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> date:<a href='/type/int'>int</a> mime_type:<a href='/type/string'>string</a> size:<a href='/type/int'>int</a> thumbs:flags.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/PhotoSize'>PhotoSize</a>> video_thumbs:flags.1?<a href='/type/Vector%20t'>Vector</a><<a href='/type/VideoSize'>VideoSize</a>> dc_id:<a href='/type/int'>int</a> attributes:<a href='/type/Vector%20t'>Vector</a><<a href='/type/DocumentAttribute'>DocumentAttribute</a>> = <a href='/type/Document'>Document</a>;
|
||||||
|
<a href='/constructor/photo'>photo</a>#fb197a65 flags:<a href='/type/%23'>#</a> has_stickers:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> date:<a href='/type/int'>int</a> sizes:<a href='/type/Vector%20t'>Vector</a><<a href='/type/PhotoSize'>PhotoSize</a>> video_sizes:flags.1?<a href='/type/Vector%20t'>Vector</a><<a href='/type/VideoSize'>VideoSize</a>> dc_id:<a href='/type/int'>int</a> = <a href='/type/Photo'>Photo</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/photo'>photo</a>#fb197a65 flags:<a href='/type/%23'>#</a> has_stickers:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> date:<a href='/type/int'>int</a> sizes:<a href='/type/Vector%20t'>Vector</a><<a href='/type/PhotoSize'>PhotoSize</a>> video_sizes:flags.1?<a href='/type/Vector%20t'>Vector</a><<a href='/type/VideoSize'>VideoSize</a>> dc_id:<a href='/type/int'>int</a> = <a href='/type/Photo'>Photo</a>;</code></pre>
|
||||||
|
<p>Telegram attaches a vector of thumbnails with reduced resolution to all uploaded media.<br>
|
||||||
|
The server also generates a trimmed and scaled down video preview for videos, GIFs and animated profile pictures. </p>
|
||||||
|
<h4><a class="anchor" href="#image-thumbnail-types" id="image-thumbnail-types" name="image-thumbnail-types"><i class="anchor-icon"></i></a>Image thumbnail types</h4>
|
||||||
|
<p>Each photo preview has a specific <code>type</code>, indicating the resolution and image transform that was applied server-side. </p>
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Image filter</th>
|
||||||
|
<th>Size</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><code>s</code></td>
|
||||||
|
<td>box</td>
|
||||||
|
<td>100x100</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>m</code></td>
|
||||||
|
<td>box</td>
|
||||||
|
<td>320x320</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>x</code></td>
|
||||||
|
<td>box</td>
|
||||||
|
<td>800x800</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>y</code></td>
|
||||||
|
<td>box</td>
|
||||||
|
<td>1280x1280</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>w</code></td>
|
||||||
|
<td>box</td>
|
||||||
|
<td>2560x2560</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>a</code></td>
|
||||||
|
<td>crop</td>
|
||||||
|
<td>160x160</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>b</code></td>
|
||||||
|
<td>crop</td>
|
||||||
|
<td>320x320</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>c</code></td>
|
||||||
|
<td>crop</td>
|
||||||
|
<td>640x640</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>d</code></td>
|
||||||
|
<td>crop</td>
|
||||||
|
<td>1280x1280</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p>Special types:</p>
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Image filter</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><code>i</code></td>
|
||||||
|
<td>strip</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>j</code></td>
|
||||||
|
<td>outline</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h4><a class="anchor" href="#stripped-thumbnails" id="stripped-thumbnails" name="stripped-thumbnails"><i class="anchor-icon"></i></a>Stripped thumbnails</h4>
|
||||||
|
<pre><code><a href='/constructor/photoStrippedSize'>photoStrippedSize</a>#e0b0bc2e type:<a href='/type/string'>string</a> bytes:<a href='/type/bytes'>bytes</a> = <a href='/type/PhotoSize'>PhotoSize</a>;</code></pre>
|
||||||
|
<p>A <a href="/constructor/photoStrippedSize">photoStrippedSize</a> (with type <code>i</code>) is an extremely low-res thumbnail, embedded directly inside media location objects.<br>
|
||||||
|
It should be shown to the user in chat message previews, or while still downloading the most appropriately sized <a href="/constructor/photoSize">photoSize</a> through the media DCs as <a href="#downloading-files">described above</a>. </p>
|
||||||
|
<p>The stripped <code>bytes</code> payload should be inflated to a JPG payload as seen <a href="https://github.com/telegramdesktop/tdesktop/blob/1757dd856b84d23f83d4e562c94dde825f6eb40c/Telegram/SourceFiles/ui/image/image.cpp#L43">here »</a>.</p>
|
||||||
|
<h4><a class="anchor" href="#vector-thumbnails" id="vector-thumbnails" name="vector-thumbnails"><i class="anchor-icon"></i></a>Vector thumbnails</h4>
|
||||||
|
<pre><code><a href='/constructor/photoPathSize'>photoPathSize</a>#d8214d41 type:<a href='/type/string'>string</a> bytes:<a href='/type/bytes'>bytes</a> = <a href='/type/PhotoSize'>PhotoSize</a>;</code></pre>
|
||||||
|
<p>Messages with <a href="/animated_stickers">animated stickers</a> can have a compressed svg (< 300 bytes) to show the outline of the sticker before fetching the actual lottie animation.
|
||||||
|
Animated sticker outlines will have a <code>j</code> type <a href="/constructor/photoPathSize">photoPathSize</a> thumbnail. </p>
|
||||||
|
<p>This specific vector thumbnail consists in an <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths">SVG path</a>, specially encoded to save space.<br>
|
||||||
|
This path will be the outline of the animated sticker, and should be shown to the user while downloading the actual sticker. </p>
|
||||||
|
<p>As for stripped sizes, the payload should be inflated using the following algorithm:</p>
|
||||||
|
<pre><code>encoded := photoPathSize.bytes
|
||||||
|
|
||||||
|
lookup := "AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,"
|
||||||
|
|
||||||
|
path := "M"
|
||||||
|
|
||||||
|
len := strlen(encoded)
|
||||||
|
for (i = 0; i < len; i++) {
|
||||||
|
num := ord(encoded[i])
|
||||||
|
if (num >= 128 + 64) {
|
||||||
|
path += lookup[num - 128 - 64]
|
||||||
|
} else {
|
||||||
|
if (num >= 128) {
|
||||||
|
path += ','
|
||||||
|
} else if (num >= 64) {
|
||||||
|
path += '-'
|
||||||
|
}
|
||||||
|
path += itoa(num & 63)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
path += "z"</code></pre>
|
||||||
|
<p><code>path</code> will contain the actual SVG path that can be directly inserted in the <code>d</code> attribute of an <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Element/path">svg <path> element</a>: </p>
|
||||||
|
<pre><code><?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
viewBox="0 0 512 512" xml:space="preserve">
|
||||||
|
<path d="{$path}"/>
|
||||||
|
</svg></code></pre>
|
||||||
|
<h4><a class="anchor" href="#video-types" id="video-types" name="video-types"><i class="anchor-icon"></i></a>Video types</h4>
|
||||||
|
<pre><code><a href='/constructor/videoSize'>videoSize</a>#e831c556 flags:<a href='/type/%23'>#</a> type:<a href='/type/string'>string</a> location:<a href='/type/FileLocation'>FileLocation</a> w:<a href='/type/int'>int</a> h:<a href='/type/int'>int</a> size:<a href='/type/int'>int</a> video_start_ts:flags.0?<a href='/type/double'>double</a> = <a href='/type/VideoSize'>VideoSize</a>;</code></pre>
|
||||||
|
<p>A <a href="/constructor/videoSize">videoSize</a> constructor is typically used for [animated profile pictures]() and video previews.</p>
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Description</th>
|
||||||
|
<th>Format</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><code>u</code></td>
|
||||||
|
<td>Animated profile picture</td>
|
||||||
|
<td>MPEG4</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>v</code></td>
|
||||||
|
<td>Video preview</td>
|
||||||
|
<td>MPEG4</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3><a class="anchor" href="#downloading-webfiles" id="downloading-webfiles" name="downloading-webfiles"><i class="anchor-icon"></i></a>Downloading webfiles</h3>
|
||||||
|
<p>Remote HTTP files sent by inline bots <a href="/type/BotInlineResult">in response to inline queries</a> and in other places are represented by <a href="/type/WebDocument">WebDocument</a> constructors.
|
||||||
|
When forwarding such remote HTTP files, they should be sent using <a href="/type/InputMedia">external InputMedia constructors</a>.
|
||||||
|
Remote HTTP files can only be downloaded directly by the client if contained in a <a href="/constructor/webDocumentNoProxy">webDocumentNoProxy</a> constructor: in this case, the file is deemed safe to download (this is the case for HTTPS files from certain trusted domains).</p>
|
||||||
|
<p>However, if the remote file is contained in a <a href="/constructor/webDocument">webDocument</a>, to avoid leaking sensitive information the file must be downloaded through telegram's servers.
|
||||||
|
This can be done in a manner similar to <a href="#downloading-files">normal files</a>, with the difference that <a href="/method/upload.getWebFile">upload.getWebFile</a> must be used, instead.</p>
|
||||||
|
<pre><code><a href='/constructor/upload.webFile'>upload.webFile</a>#21e753bc size:<a href='/type/int'>int</a> mime_type:<a href='/type/string'>string</a> file_type:<a href='/type/storage.FileType'>storage.FileType</a> mtime:<a href='/type/int'>int</a> bytes:<a href='/type/bytes'>bytes</a> = <a href='/type/upload.WebFile'>upload.WebFile</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/storage.fileUnknown'>storage.fileUnknown</a>#aa963b05 = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.fileJpeg'>storage.fileJpeg</a>#7efe0e = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.fileGif'>storage.fileGif</a>#cae1aadf = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.filePng'>storage.filePng</a>#a4f63c0 = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.fileMp3'>storage.fileMp3</a>#528a0677 = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.fileMov'>storage.fileMov</a>#4b09ebbc = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.filePartial'>storage.filePartial</a>#40bc6f52 = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.fileMp4'>storage.fileMp4</a>#b3cea0e4 = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
<a href='/constructor/storage.fileWebp'>storage.fileWebp</a>#1081464c = <a href='/type/storage.FileType'>storage.FileType</a>;
|
||||||
|
|
||||||
|
---functions---
|
||||||
|
|
||||||
|
<a href='/method/upload.getWebFile'>upload.getWebFile</a>#24e6818d location:<a href='/type/InputWebFileLocation'>InputWebFileLocation</a> offset:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/upload.WebFile'>upload.WebFile</a>;</code></pre>
|
||||||
|
<p>The <a href="/type/InputWebFileLocation">InputWebFileLocation</a> constructor is generated as follows.</p>
|
||||||
|
<pre><code><a href='/constructor/inputWebFileLocation'>inputWebFileLocation</a>#c239d686 url:<a href='/type/string'>string</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputWebFileLocation'>InputWebFileLocation</a>;
|
||||||
|
<a href='/constructor/inputWebFileGeoPointLocation'>inputWebFileGeoPointLocation</a>#9f2221c9 geo_point:<a href='/type/InputGeoPoint'>InputGeoPoint</a> access_hash:<a href='/type/long'>long</a> w:<a href='/type/int'>int</a> h:<a href='/type/int'>int</a> zoom:<a href='/type/int'>int</a> scale:<a href='/type/int'>int</a> = <a href='/type/InputWebFileLocation'>InputWebFileLocation</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/webDocument'>webDocument</a>#1c570ed1 url:<a href='/type/string'>string</a> access_hash:<a href='/type/long'>long</a> size:<a href='/type/int'>int</a> mime_type:<a href='/type/string'>string</a> attributes:<a href='/type/Vector%20t'>Vector</a><<a href='/type/DocumentAttribute'>DocumentAttribute</a>> = <a href='/type/WebDocument'>WebDocument</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/inputGeoPoint'>inputGeoPoint</a>#48222faf flags:<a href='/type/%23'>#</a> lat:<a href='/type/double'>double</a> long:<a href='/type/double'>double</a> accuracy_radius:flags.0?<a href='/type/int'>int</a> = <a href='/type/InputGeoPoint'>InputGeoPoint</a>;
|
||||||
|
|
||||||
|
<a href='/constructor/geoPoint'>geoPoint</a>#b2a2f663 flags:<a href='/type/%23'>#</a> long:<a href='/type/double'>double</a> lat:<a href='/type/double'>double</a> access_hash:<a href='/type/long'>long</a> accuracy_radius:flags.0?<a href='/type/int'>int</a> = <a href='/type/GeoPoint'>GeoPoint</a>;</code></pre>
|
||||||
|
<ul>
|
||||||
|
<li><a href="/constructor/inputWebFileLocation">inputWebFileLocation</a> is simply generated by taking the <code>url</code> and <code>access_hash</code> fields of the <a href="/constructor/webDocument">webDocument</a> constructor.</li>
|
||||||
|
<li><a href="/constructor/inputWebFileGeoPointLocation">inputWebFileGeoPointLocation</a> is used to download a server-generated image with the map preview from a <a href="/constructor/geoPoint">geoPoint</a>.<ul>
|
||||||
|
<li><code>geo_point</code> is generated from the <code>lat</code>, <code>long</code> <code>accuracy_radius</code> parameters of the <a href="/constructor/geoPoint">geoPoint</a></li>
|
||||||
|
<li><code>access_hash</code> is the access hash of the <a href="/constructor/geoPoint">geoPoint</a></li>
|
||||||
|
<li><code>w</code> - Map width in pixels before applying scale; 16-1024</li>
|
||||||
|
<li><code>h</code> - Map height in pixels before applying scale; 16-1024</li>
|
||||||
|
<li><code>zoom</code> - Map zoom level; 13-20</li>
|
||||||
|
<li><code>scale</code> - Map scale; 1-3</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<h3><a class="anchor" href="#general-considerations" id="general-considerations" name="general-considerations"><i class="anchor-icon"></i></a>General Considerations</h3>
|
||||||
|
<p>It is recommended that large queries (<a href="/method/upload.getFile">upload.getFile</a>, <a href="/method/upload.saveFilePart">upload.saveFilePart</a>, <a href="/method/upload.getWebFile">upload.getWebFile</a>) be handled through a separate session and a separate connection, in which no methods other than these should be executed. If this is done, then data transfer will cause less interference with <a href="/api/updates">getting updates</a> and other method calls.</p>
|
||||||
|
<h3><a class="anchor" href="#related-articles" id="related-articles" name="related-articles"><i class="anchor-icon"></i></a>Related articles</h3>
|
||||||
|
<h4><a class="anchor" href="#handling-file-references" id="handling-file-references" name="handling-file-references"><i class="anchor-icon"></i></a><a href="/api/file_reference">Handling file references</a></h4>
|
||||||
|
<p>How to handle file references.</p></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="footer_wrap">
|
||||||
|
<div class="footer_columns_wrap footer_desktop">
|
||||||
|
<div class="footer_column footer_column_telegram">
|
||||||
|
<h5>Telegram</h5>
|
||||||
|
<div class="footer_telegram_description"></div>
|
||||||
|
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="//telegram.org/faq">About</a></h5>
|
||||||
|
<ul>
|
||||||
|
<li><a href="//telegram.org/faq">FAQ</a></li>
|
||||||
|
<li><a href="//telegram.org/blog">Blog</a></li>
|
||||||
|
<li><a href="//telegram.org/jobs">Jobs</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
|
||||||
|
<ul>
|
||||||
|
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
|
||||||
|
<li><a href="//telegram.org/dl/android">Android</a></li>
|
||||||
|
<li><a href="//telegram.org/dl/wp">Windows Phone</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
|
||||||
|
<ul>
|
||||||
|
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
|
||||||
|
<li><a href="//macos.telegram.org/">macOS</a></li>
|
||||||
|
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="footer_column footer_column_platform">
|
||||||
|
<h5><a href="/">Platform</a></h5>
|
||||||
|
<ul>
|
||||||
|
<li><a href="/api">API</a></li>
|
||||||
|
<li><a href="//translations.telegram.org/">Translations</a></li>
|
||||||
|
<li><a href="//instantview.telegram.org/">Instant View</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="footer_columns_wrap footer_mobile">
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="//telegram.org/faq">About</a></h5>
|
||||||
|
</div>
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="//telegram.org/blog">Blog</a></h5>
|
||||||
|
</div>
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="//telegram.org/apps">Apps</a></h5>
|
||||||
|
</div>
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="/">Platform</a></h5>
|
||||||
|
</div>
|
||||||
|
<div class="footer_column">
|
||||||
|
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="/js/main.js?42"></script>
|
||||||
|
<script src="/js/jquery.min.js?1"></script>
|
||||||
|
<script src="/js/bootstrap.min.js"></script>
|
||||||
|
|
||||||
|
<script>window.initDevPageNav&&initDevPageNav();
|
||||||
|
backToTopInit("Go up");
|
||||||
|
removePreloadInit();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
359
data/tsf.telegram.org/css/billboard.css
Normal file
359
data/tsf.telegram.org/css/billboard.css
Normal file
|
@ -0,0 +1,359 @@
|
||||||
|
/*!
|
||||||
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
||||||
|
* billboard.js project is licensed under the MIT license
|
||||||
|
*
|
||||||
|
* billboard.js, JavaScript chart library
|
||||||
|
* http://naver.github.io/billboard.js/
|
||||||
|
*
|
||||||
|
* @version 1.7.1
|
||||||
|
*/
|
||||||
|
.bb-color-pattern{background-image:url(#00c73c;#fa7171;#2ad0ff;#7294ce;#e3e448;#cc7e6e;#fb6ccf;#c98dff;#4aea99;#bbbbbb;)}.bb svg{font-size:12px;font-family:Meiryo,sans-serif,Arial,nanumgothic,Dotum;line-height:1}.bb line,.bb path{fill:none;stroke:#c4c4c4}.bb .bb-button,.bb text{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;fill:#555;font-size:11px}.bb-axis,.bb-bars path,.bb-event-rect,.bb-legend-item-title,.bb-xgrid-focus,.bb-ygrid{shape-rendering:crispEdges}.bb-axis-y2 text,.bb-axis-y text{fill:#737373}.bb-event-rects{fill-opacity:1!important}.bb-event-rects .bb-event-rect{fill:transparent}.bb-event-rects .bb-event-rect._active_{fill:rgba(39,201,3,.05)}.tick._active_ text{fill:#00c83c!important}.bb-grid line{stroke:#f1f1f1}.bb-grid .bb-ygrid:last-child{stroke:#e9e9e9}.bb-xgrid-focus line{stroke:#ddd}.bb-text.bb-empty{fill:#767676}.bb-line{stroke-width:1px}.bb-circle._expanded_{fill:#fff!important;stroke-width:2px;stroke:red}rect.bb-circle._expanded_,use.bb-circle._expanded_{stroke-width:1px}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-target.bb-focused{opacity:1}.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step{stroke-width:2px}.bb-target.bb-defocused{opacity:.3!important}.bb-region{fill:#4682b4;fill-opacity:.1}.bb-region.selected rect{fill:#27c903}.bb-brush .extent,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.bb-title{font-size:14px}.bb-tooltip-container{z-index:10;font-family:Meiryo,sans-serif,Arial,nanumgothic,Dotum;position:absolute}.bb-tooltip{border-collapse:separate;border-spacing:0;empty-cells:show;border:1px solid #999;background-color:#fff;text-align:left;font-size:11px}.bb-tooltip th{font-size:12px;padding:4px 8px;text-align:left;border-bottom:1px solid #eee}.bb-tooltip td{padding:4px 6px;background-color:#fff}.bb-tooltip td:first-child{padding-left:8px}.bb-tooltip td:last-child{padding-right:8px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;width:10px;height:10px;margin-right:6px;border-radius:5px;vertical-align:middle}.bb-tooltip td.value{border-left:1px solid transparent}.bb-tooltip .bb-tooltip-title{display:inline-block;color:#aaa;line-height:20px}.bb-tooltip .bb-tooltip-detail table{border-collapse:collapse;border-spacing:0}.bb-tooltip .bb-tooltip-detail .bb-tooltip-name,.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{font-size:11px;line-height:13px;padding:4px 0 3px;color:#444;text-align:left;font-weight:400}.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{padding-left:5px;font-weight:800;font-size:12px}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:none}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-arcs .bb-chart-arcs-title{font-size:16px!important;fill:#000;font-weight:600}.bb-chart-arcs path.empty{fill:#eaeaea;stroke-width:0}.bb-chart-arc .bb-gauge-value{fill:#000}.bb-chart-arc path{stroke:#fff}.bb-chart-arc text{fill:#fff;font-size:13px}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{font-size:1.15em;cursor:default}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;top:10px;right:10px}.bb-button .bb-zoom-reset{border:1px solid #ccc;background-color:#fff;padding:5px;border-radius:5px;cursor:pointer}
|
||||||
|
|
||||||
|
|
||||||
|
.bb svg,
|
||||||
|
.bb-tooltip-container {
|
||||||
|
font-size: 12px;
|
||||||
|
font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
|
||||||
|
}
|
||||||
|
.bb .bb-axis-x g.tick text tspan {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
.bb text.bb-axis-x-label {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
.bb .bb-axis-y g.tick line {
|
||||||
|
stroke: none;
|
||||||
|
}
|
||||||
|
.bb .bb-axis-y2 path.domain {
|
||||||
|
stroke: none;
|
||||||
|
}
|
||||||
|
.bb .bb-axis-y path.domain {
|
||||||
|
stroke: none;
|
||||||
|
}
|
||||||
|
.bb .bb-axis-y2 path.domain {
|
||||||
|
stroke: none;
|
||||||
|
}
|
||||||
|
.bb .bb-axis-x path.domain {
|
||||||
|
stroke: #DBDBDB;
|
||||||
|
}
|
||||||
|
.dark .bb .bb-axis-x path.domain {
|
||||||
|
stroke: #283442;
|
||||||
|
}
|
||||||
|
.bb .bb-grid .bb-ygrids line {
|
||||||
|
stroke: none;
|
||||||
|
}
|
||||||
|
.bb .bb-ygrid-line line {
|
||||||
|
stroke: #E9E9E9;
|
||||||
|
stroke-width: 1px;
|
||||||
|
}
|
||||||
|
.dark .bb .bb-ygrid-line line {
|
||||||
|
stroke: #293544;
|
||||||
|
}
|
||||||
|
.dark .bb .bb-xgrid-focus line.bb-xgrid-focus {
|
||||||
|
stroke: #3b4a5a;
|
||||||
|
}
|
||||||
|
.dark .bb-circle._expanded_ {
|
||||||
|
fill: #242f3e !important;
|
||||||
|
}
|
||||||
|
.bb-axis-x g.tick line {
|
||||||
|
stroke: none;
|
||||||
|
}
|
||||||
|
.bb g.tick {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.bb text.bb-axis-x-label,
|
||||||
|
.bb g.tick text tspan {
|
||||||
|
fill: #7A8A93;
|
||||||
|
-webkit-text-stroke: 2px #fff;
|
||||||
|
text-shadow:
|
||||||
|
-1px -1px 0 #fff,
|
||||||
|
1px -1px 0 #fff,
|
||||||
|
-1px 1px 0 #fff,
|
||||||
|
1px 1px 0 #fff;
|
||||||
|
}
|
||||||
|
.dark .bb text.bb-axis-x-label,
|
||||||
|
.dark .bb g.tick text tspan {
|
||||||
|
fill: #546778;
|
||||||
|
-webkit-text-stroke: 2px #242f3e;
|
||||||
|
text-shadow:
|
||||||
|
-1px -1px 0 #242f3e,
|
||||||
|
1px -1px 0 #242f3e,
|
||||||
|
-1px 1px 0 #242f3e,
|
||||||
|
1px 1px 0 #242f3e;
|
||||||
|
}
|
||||||
|
.bb-axis-y2 g.tick line {
|
||||||
|
stroke: none;
|
||||||
|
}
|
||||||
|
.chart_wrap {
|
||||||
|
-webkit-touch-callout: none; /* iOS Safari */
|
||||||
|
-webkit-user-select: none; /* Safari */
|
||||||
|
-khtml-user-select: none; /* Konqueror HTML */
|
||||||
|
-moz-user-select: none; /* Firefox */
|
||||||
|
-ms-user-select: none; /* Internet Explorer/Edge */
|
||||||
|
user-select: none; /* Non-prefixed version, currently
|
||||||
|
supported by Chrome and Opera */
|
||||||
|
}
|
||||||
|
.chart_wrap > svg rect.selection {
|
||||||
|
fill: #1F8CED;
|
||||||
|
fill-opacity: 0.1;
|
||||||
|
stroke: none;
|
||||||
|
/*stroke: #1F8CED;*/
|
||||||
|
/*stroke-width: 2px;*/
|
||||||
|
/*stroke-dasharray: 0,50,150;*/
|
||||||
|
}
|
||||||
|
.chart_wrap > svg rect.handle {
|
||||||
|
stroke: none;
|
||||||
|
/*width: 3px;*/
|
||||||
|
/*fill: #1F8CED;*/
|
||||||
|
}
|
||||||
|
.bb .bb-brush-handle {
|
||||||
|
stroke: #1F8CED;
|
||||||
|
stroke-width: 4px;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.dark .bb .bb-brush-handle {
|
||||||
|
stroke: #4d96cd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart_wrap > svg > g:nth-child(3) > g.bb-axis-x .tick {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.bb-area {
|
||||||
|
stroke-width:0;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
.bb-chart-lines g.bb-lines path.bb-line {
|
||||||
|
stroke-width: 2px;
|
||||||
|
}
|
||||||
|
svg > g:nth-child(3) .bb-chart-lines g.bb-lines path.bb-line {
|
||||||
|
stroke-width: 1px;
|
||||||
|
}
|
||||||
|
.bb-chart-lines g.bb-target-chart-type--area g.bb-lines path.bb-line,
|
||||||
|
.bb-chart-lines g.bb-target-chart-type--area-step g.bb-lines path.bb-line {
|
||||||
|
stroke-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bb-circles circle {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
.bb-circles circle._expanded_,
|
||||||
|
.bb-target-chart-type--bubble .bb-circles circle {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
.bb-legend-item text {
|
||||||
|
fill: #7A8A93;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.dark .bb-legend-item text {
|
||||||
|
fill: #546778;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bb-tooltip {
|
||||||
|
border-radius: 2px;
|
||||||
|
overflow: hidden;
|
||||||
|
border: 0;
|
||||||
|
/*border-color: #CCC;*/
|
||||||
|
/*-webkit-box-shadow: 1px 1px 0 0px rgba(0,0,0,0.1), -1px -1px 0 0px rgba(0,0,0,0.1);
|
||||||
|
-moz-box-shadow: 1px 1px 0 0px rgba(0,0,0,0.1), -1px -1px 0 0px rgba(0,0,0,0.1);
|
||||||
|
box-shadow: 1px 1px 0 0px rgba(0,0,0,0.1), -1px -1px 0 0px rgba(0,0,0,0.1);*/
|
||||||
|
|
||||||
|
-webkit-box-shadow: 1px 0px 1px 0px rgba(0,0,0,0.1),
|
||||||
|
-1px 0px 1px 0px rgba(0,0,0,0.1),
|
||||||
|
0px 1px 1px 0px rgba(0,0,0,0.1),
|
||||||
|
0px -1px 0 0px rgba(0,0,0,0.1);
|
||||||
|
box-shadow: 1px 0px 1px 0px rgba(0,0,0,0.1),
|
||||||
|
-1px 0px 1px 0px rgba(0,0,0,0.1),
|
||||||
|
0px 1px 1px 0px rgba(0,0,0,0.1),
|
||||||
|
0px -1px 0 0px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
.dark .bb-tooltip,
|
||||||
|
.dark .bb-tooltip td {
|
||||||
|
background-color: #283442;
|
||||||
|
}
|
||||||
|
.bb-tooltip th {
|
||||||
|
border-bottom: 0;
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-left: 10px;
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
|
.bb-tooltip td:first-child {
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
.bb-tooltip td:last-child {
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
|
.bb-tooltip tr:first-child td {
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
.bb-tooltip tr:last-child td {
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
.bb-tooltip td.value {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.bb-tooltip td.name,
|
||||||
|
.bb-tooltip td.value {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.bb-tooltip td>span, .bb-tooltip td>svg {
|
||||||
|
width: 11px;
|
||||||
|
height: 11px;
|
||||||
|
}
|
||||||
|
.piechart .bb-tooltip td:first-child {
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
.piechart .bb-tooltip td:last-child {
|
||||||
|
padding-right: 8px;
|
||||||
|
}
|
||||||
|
.piechart .bb-tooltip tr:first-child td {
|
||||||
|
padding-top: 5px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
|
.bb-chart-arc text {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.dark .bb-chart-arc path {
|
||||||
|
stroke: #242f3e;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.chart_wrap_loading {
|
||||||
|
color: #7A8A93;
|
||||||
|
font-size: 16px;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 40px 20px;
|
||||||
|
}
|
||||||
|
.dark .chart_wrap_loading {
|
||||||
|
color: #546778;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bbchart-custom-legend {
|
||||||
|
padding: 0 10px;
|
||||||
|
margin: -11px 0 7px;
|
||||||
|
}
|
||||||
|
.bbchart_wrap_noslider .bbchart-custom-legend {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
.bbchart-custom-legend-label {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 6px 12px 6px 7px;
|
||||||
|
border-radius: 18px;
|
||||||
|
height: 34px;
|
||||||
|
line-height: 32px;
|
||||||
|
/*background: #f1f5f8;*/
|
||||||
|
margin-right: 5px;
|
||||||
|
margin-bottom: 3px;
|
||||||
|
font-size: 12px;
|
||||||
|
vertical-align: middle;
|
||||||
|
border: 1px solid #e6ecf0;
|
||||||
|
}
|
||||||
|
.dark .bbchart-custom-legend-label {
|
||||||
|
/*background: #4788ba;*/
|
||||||
|
border-color: #344658;
|
||||||
|
}
|
||||||
|
.bbchart-custom-legend-label-icon {
|
||||||
|
display: inline-block;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
border-radius: 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-right: 10px;
|
||||||
|
line-height: 20px;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
.bbchart-custom-legend-label-icon-tick {
|
||||||
|
display: inline-block;
|
||||||
|
height: 8px;
|
||||||
|
width: 11px;
|
||||||
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMSIgaGVpZ2h0PSI4Ij48cGF0aCBkPSJNMy42OTcxNjcxIDUuMjM4NDUwN0w4LjUwNDYwMTkuNDMxMDE1OWMuMzkwNTcwOS0uMzkwNTcxIDEuMDIzODExNi0uMzkwNTcxIDEuNDE0MzgyNiAwIC4zOTA1NzA5LjM5MDU3MS4zOTA1NzA5IDEuMDIzODExNiAwIDEuNDE0MzgyNmwtNS40MjE4IDUuNDIxNzk5OWMtLjIyNjczMzQuMjI2NzMzNS0uNTM1MjQ2OC4zMjE4NDQxLS44MzA1OTA3LjI4NTMzMTktLjExOTQzOS4wMDQwOTMzLS4yNDE1ODEzLS4wMjA1NDU0LS4zNTYxNTA0LS4wNzczNzc4YS43NDU0NTgwNy43NDU0NTgwNyAwIDAgMS0uMTc4ODYxNy0uMTI0MjMzMUwuNDE2NjM4NyA0LjgwMzAxNzZDLjAzNDc4MDQgNC40NDQ2NTM3LjAxNTczNDQgMy44NDQ1ODUxLjM3NDA5ODMgMy40NjI3MjY4YS45NDc5NTA1NS45NDc5NTA1NSAwIDAgMSAuMDE1NTg0Mi0uMDE2MjE2MWMuMzc4MzA1MS0uMzg0NDE0MS45OTQ2NDgzLS4zOTU0NzAzIDEuMzg2NDk3MS0uMDI0ODcxNmwxLjkyMDk4NzUgMS44MTY4MTE2eiIgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+);
|
||||||
|
transform: translateX(5px) translateY(1px);
|
||||||
|
}
|
||||||
|
.bbchart-custom-legend-label-hidden .bbchart-custom-legend-label-icon-tick {
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #ffffff;
|
||||||
|
border: 0;
|
||||||
|
transform: none;
|
||||||
|
margin: 2px 2px;
|
||||||
|
}
|
||||||
|
.dark .bbchart-custom-legend-label-hidden .bbchart-custom-legend-label-icon-tick {
|
||||||
|
/*background: #4788ba;*/
|
||||||
|
background: #242f3e;
|
||||||
|
}
|
||||||
|
.bbchart-custom-legend-label-text {
|
||||||
|
line-height: 20px;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.button-item.ripple-handler {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.ripple-mask {
|
||||||
|
position: absolute;
|
||||||
|
left: 0; right: 0;
|
||||||
|
top: 0; bottom: 0;
|
||||||
|
transform: translateZ(0);
|
||||||
|
overflow: hidden;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.radio-item .ripple-mask,
|
||||||
|
.checkbox-item .ripple-mask {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
left: -6px;
|
||||||
|
top: -6px;
|
||||||
|
border-radius: 16px;
|
||||||
|
}
|
||||||
|
.button-item .ripple-mask {
|
||||||
|
border-radius: 19px;
|
||||||
|
}
|
||||||
|
.radio-item .ripple,
|
||||||
|
.checkbox-item .ripple {
|
||||||
|
position: absolute;
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
left: -24px;
|
||||||
|
top: -24px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: rgba(179, 179, 179, .2);
|
||||||
|
transition: transform .65s ease-out, opacity .65s ease-out, background-color .65s ease-out;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
.radio-item input.radio:checked + .radio-input .ripple,
|
||||||
|
.checkbox-item input.checkbox:checked + .checkbox-input .ripple {
|
||||||
|
background-color: rgba(84, 169, 235, .2);
|
||||||
|
}
|
||||||
|
.button-item .ripple {
|
||||||
|
position: absolute;
|
||||||
|
width: 200%;
|
||||||
|
left: 50%; top: 50%;
|
||||||
|
margin: -100% 0 0 -100%;
|
||||||
|
padding-top: 200%;
|
||||||
|
border-radius: 50%;
|
||||||
|
/*background-color: rgba(179, 179, 179, .2);*/
|
||||||
|
background-color: rgba(55, 144, 207, .2);
|
||||||
|
/*background-color: #3790cf;*/
|
||||||
|
transition: transform .65s ease-out, opacity .65s ease-out, background-color .65s ease-out;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
/*.button-item-flat .ripple {
|
||||||
|
background-color: #d9ebf7;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
.bbchart-custom-legend-label .ripple {
|
||||||
|
background-color: rgba(119, 160, 191, .08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark .bbchart-custom-legend-label .ripple {
|
||||||
|
background-color: rgba(121, 153, 185, .08);
|
||||||
|
}
|
13
data/tsf.telegram.org/js/billboard.min.js
vendored
Normal file
13
data/tsf.telegram.org/js/billboard.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
9
data/tsf.telegram.org/js/jquery-ui.min.js
vendored
Normal file
9
data/tsf.telegram.org/js/jquery-ui.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
265
data/tsf.telegram.org/manuals/answering_questions.html
Normal file
265
data/tsf.telegram.org/manuals/answering_questions.html
Normal file
|
@ -0,0 +1,265 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Telegram Support Force</title>
|
||||||
|
<meta property="og:title" content="Answering Questions">
|
||||||
|
<meta property="og:description" content="We answer questions. This document holds general ideas on how to handle them.
|
||||||
|
This was intended for volunteers of the Telegram…">
|
||||||
|
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
|
||||||
|
<link rel="alternate icon" href="/favicon.ico?4" type="image/x-icon" />
|
||||||
|
<script>document.cookie="stel_dt="+encodeURIComponent((new Date).getTimezoneOffset())+";path=/;max-age=31536000;samesite=None;secure"</script>
|
||||||
|
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700" rel="stylesheet" type="text/css">
|
||||||
|
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
|
||||||
|
<link href="/css/bootstrap-extra.css?2" rel="stylesheet">
|
||||||
|
<link href="/css/telegram.css?212" rel="stylesheet">
|
||||||
|
<link href="/css/tsf.css?7" rel="stylesheet">
|
||||||
|
<link href="/css/jquery-ui.min.css" rel="stylesheet">
|
||||||
|
<link href="/css/health.css?126" rel="stylesheet">
|
||||||
|
<link href="/css/tchart.min.css?10" rel="stylesheet">
|
||||||
|
<link href="/css/billboard.css?17" rel="stylesheet">
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body class="emoji_image no-transition">
|
||||||
|
|
||||||
|
<div id="aj_progress" class="progress-bar"></div>
|
||||||
|
|
||||||
|
<div id="aj_content"><div class="tr-container">
|
||||||
|
<header>
|
||||||
|
<div class="container">
|
||||||
|
<div class="header-wrap">
|
||||||
|
<div id="header-panel" class="header-panel">
|
||||||
|
<div class="header-auth">
|
||||||
|
<div class="header-auth-item"><a class="header-search-btn"></a></div><div class="header-auth-item"><a class="header-auth-link login-link" href="/auth">Login</a></div>
|
||||||
|
</div>
|
||||||
|
<div class="header-breadcrumb header-breadcrumb-simple">
|
||||||
|
<ol id="breadcrumb" class="header-nav breadcrumb"><li><a href="/">Telegram Support Force</a></li></ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<main class="container">
|
||||||
|
<nav class="tr-menu">
|
||||||
|
<div class="tr-menu-section">
|
||||||
|
<div class="tr-menu-header">
|
||||||
|
<div class="tr-menu-header-label">Resources</div>
|
||||||
|
</div>
|
||||||
|
<ul class="tr-menu-items"><li>
|
||||||
|
<a class="tr-menu-item" href="/">
|
||||||
|
<span class="nav-label">Introduction</span>
|
||||||
|
</a>
|
||||||
|
</li><li class="active">
|
||||||
|
<a class="tr-menu-item" href="/manuals">
|
||||||
|
<span class="nav-label">Manuals</span>
|
||||||
|
</a>
|
||||||
|
</li></ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
<section class="content clearfix">
|
||||||
|
<section class="tr-content"><div id="dev_page_content_wrap" class=" ">
|
||||||
|
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/" >Telegram Support Initiative</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/manuals" >Manuals</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/manuals/answering_questions" >Answering Questions</a></li></ul></div>
|
||||||
|
<h1 id="dev_page_title">Answering Questions</h1>
|
||||||
|
|
||||||
|
<div id="dev_page_content"><p>We answer questions. This document holds general ideas on how to handle them.<br>This was intended for volunteers of the <a href="/">Telegram Support Force</a>, but anyone else is free to take a look as well.</p>
|
||||||
|
<h3><a class="anchor-link" href="#general"><i class="anchor-icon"></i></a><a class="anchor" name="general"></a>General</h3>
|
||||||
|
<ol>
|
||||||
|
<li><p>Our goal is to bring human support to human beings. To achieve this goal, we rely on volunteers. Your pay is perfection in what you do, so be cool.</p>
|
||||||
|
</li>
|
||||||
|
<li><p>Corporate support standards do not apply here. Treat people in a kind, personal, informal manner. No need to pretend to be something you are not (unless you're a dog in disguise — keep human appearances in this case).</p>
|
||||||
|
</li>
|
||||||
|
<li><p>Never lie to people.</p>
|
||||||
|
</li>
|
||||||
|
<li><p>Check everything before you reply. Things change or may no longer work the way you remember. This includes interface details, links (!) and, well, everything.</p>
|
||||||
|
</li>
|
||||||
|
<li><p>Support is a form of Art, so be fun and creative.</p>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
<h3><a class="anchor-link" href="#the-result"><i class="anchor-icon"></i></a><a class="anchor" name="the-result"></a>The result</h3>
|
||||||
|
<p>As support volunteers, we need to provide a <strong>solution</strong> for the user. Remember, that this doesn't always have to be the solution the user was asking for. So first, we want to understand the <strong>problem</strong> that drove them to ask the question. And then find a way of solving — completely or partially — that problem.</p>
|
||||||
|
<p>For example, some users ask us for an option to send sketches or drawings to their friends. While this is not possible directly, one could take a photo with their thumb on the camera (to get a black picture), then use the drawing tools built into the photo editor to make their doodle.</p>
|
||||||
|
<p>This isn‘t what the user was looking for, but it solves the problem — and it is even more flexible and customizable than the original idea (since you could also add stickers and emoji out of the box). Some solutions are less elegant. For example, right now you can’t email your Telegram conversations. While there is much less need to do so, since you can access everything in the cloud from any of your devices, this may be a problem in some cases. What one could do then, is open the conversation in Telegram Web (or any other desktop client), select multiple messages with the mouse, then copy and paste them into a text document. Any solution is better than no solution at all.</p>
|
||||||
|
<p>There will be cases, when it is not possible to solve the problem at all. As a user in this situation, I want that people on the other end of the line <strong>understand</strong> me and <strong>care</strong> about the whole thing. Therefore, two things become important:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Make it clear that you understand the issue. ‘No, you can’t do that‘ is not a good answer. ’No, I‘m afraid it is not possible to make Telegram wash your dishes in a fast and securely encrypted way’ — is better.</li>
|
||||||
|
<li>Be gentle. Gentle doesn‘t mean soft — if we really can’t do something, it means just that — we can‘t. But adding ’Sorry about that' helps a lot.</li>
|
||||||
|
</ul>
|
||||||
|
<p>Lastly, whatever the outcome, I always look for help from a human being, not a dumb interface. When you're casual and witty, the user feels more at ease. On the other hand, human beings, as opposed to dumb interfaces, usually understand what is appropriate in which situation. For example, when a user is in distress, he most likely needs help first — and jokes can wait until the crisis has been dealt with.</p>
|
||||||
|
<hr>
|
||||||
|
<p>To sum up, we need to be: <strong>smart</strong> (to identify the problem and find an approach to the user), <strong>inventive</strong> (to find a solution, not always the obvious one), <strong>compassionate</strong> (in case there is no immediate solution) — and <strong>witty</strong> (otherwise it gets boring). I'm sure we are.</p>
|
||||||
|
<h3><a class="anchor-link" href="#what-if-i-don-39t-know-the-answer"><i class="anchor-icon"></i></a><a class="anchor" name="what-if-i-don-39t-know-the-answer"></a>What if I don't know the answer</h3>
|
||||||
|
<p>Happens to all. Don't worry, you can always find one. The <a href="/manuals/bios">TSF BIOS</a> will tell you what to do in most situations. In case it doesn‘t or you’re not sure, ask your fellow volunteers in the group — they should know. If worst comes to worst, consult Markus.</p>
|
||||||
|
<p>Admitting you don't know something is <strong>infinitely</strong> better than trying to cover it up. So when cornered use this mantra: ‘I’m afraid I don‘t know this. Will ask my teammates and get back to you’. Just make sure that the question is not in the FAQs before you say this.</p>
|
||||||
|
<h3><a class="anchor-link" href="#handling-user-suggestions"><i class="anchor-icon"></i></a><a class="anchor" name="handling-user-suggestions"></a>Handling user suggestions</h3>
|
||||||
|
<p>The three rules for requests and suggestions are: don‘t lie, don’t promise anything, and don't give an exact timeframe.</p>
|
||||||
|
<ul>
|
||||||
|
<li>The internal <a href="https://trello.com/b/TgdZ0YI6">Suggestions board</a> on Trello has a list of most frequently suggested features together with estimations on how likely, when and why they will be introduced. </li>
|
||||||
|
<li>For insights into the decision making process, check our <a href="/manuals/feature_philosophy">Feature Philosophy</a>.</li>
|
||||||
|
</ul>
|
||||||
|
<p>Plans change frequently, so it‘s best if we only talk about things that exist. Never say that something will be done. ’We may do this‘, ’we will definitely add this at some point in the future‘ or ’this is coming soon' — is as far as we can go.</p>
|
||||||
|
<p>Same applies to the negative: never say we will never do something (except steal users‘ spouses and enslave their children, as mentioned in the general FAQ). The worst thing that can happen is ’we are currently not working on this‘, ’we may consider this', etc.</p>
|
||||||
|
<p>Even if you know something is happening tomorrow, say ‘in the next few days’. People love it when they get things earlier than they expected — and get downright angry if we get 5 minutes (or a few months) late.</p>
|
||||||
|
<h3><a class="anchor-link" href="#reporting-bugs-in-telegram"><i class="anchor-icon"></i></a><a class="anchor" name="reporting-bugs-in-telegram"></a>Reporting bugs in Telegram</h3>
|
||||||
|
<p>Every now and then you will get actual bug-reports. We have an internal board on <a href="https://trello.com/b/ll9sbLcd">trello</a>, so you will be able to search all known issues and get the relevant info.</p>
|
||||||
|
<ul>
|
||||||
|
<li>The <a href="/manuals/bugs">Handling Bugs</a> manual covers all you need to know about bug reporting in Telegram.</li>
|
||||||
|
<li>The internal <a href="https://trello.com/b/ll9sbLcd">Issues board</a> on Trello lists all known issues.</li>
|
||||||
|
</ul>
|
||||||
|
<p>If you are not part of the team and are looking for advanced troubleshooting tips, you may find the <a href="/manuals/bugs#troubleshooting-common-issues">Troubleshooting</a> section interesting.</p>
|
||||||
|
<h3><a class="anchor-link" href="#chatting"><i class="anchor-icon"></i></a><a class="anchor" name="chatting"></a>Chatting</h3>
|
||||||
|
<p>Truth is, most users come to simply say ‘hello’. Hello them back if you have the time. Sometimes these users do have a question after all. In other cases they may be new to Telegram, without many friends to chat with or show them around. So you can tell them more about Telegram, point to interesting features — or even other <a href="//telegram.org/apps">Telegram apps</a>. No need to advertise, just explain what needs explaining.</p>
|
||||||
|
<p>Remember: we’re here to help those we can help and talk to others that we feel we have the time to talk to, but not more. If kids get too insistent without any real needs, it’s ok to ignore them after a few replies. If somebody seems to be a nice conversation partner, it’s always a good idea to discuss Telegram, see what the user thinks is missing. Maybe tell them about our <a href="/">Support Initiative</a>.</p>
|
||||||
|
<h3><a class="anchor-link" href="#real-life-problems"><i class="anchor-icon"></i></a><a class="anchor" name="real-life-problems"></a>Real-life problems</h3>
|
||||||
|
<p>Unfortunately, we cannot really help people with real-life problems. A few kind words wouldn‘t hurt, but generally we should send those users to places where they can get actual help, like a crisis line or chat. (Now, if you want to be a member of the TSF and read this far, go send a picture of a kangaroo to the auditions account. No, this is not a joke. It is a test that helps us understand whether or not you actually read this. And don’t tell others. If you're already a member, you know what to do: humpa viceroy squid)</p>
|
||||||
|
<h3><a class="anchor-link" href="#insults"><i class="anchor-icon"></i></a><a class="anchor" name="insults"></a>Insults</h3>
|
||||||
|
<p>Yep, everyone gets their share of those. First of all, remember that these people are not really talking to you. They just see an abstract ‘Telegram’ entity. My advice is to humor them — I usually send a ‘well, that escalated quickly’ picture and it helps many users. Joke around with them and you’ll be surprised how that can humble people. And never insult back, even if they manage to get you angry for some reason. Nonviolent irony is always your best — and only — weapon.</p>
|
||||||
|
<hr>
|
||||||
|
<h5><a class="anchor-link" href="#other-tsf-documents"><i class="anchor-icon"></i></a><a class="anchor" name="other-tsf-documents"></a>Other TSF documents:</h5>
|
||||||
|
<p><div class="dev_page_nav_wrap"></p>
|
||||||
|
<ul>
|
||||||
|
<li><a href="/">TSF Manifesto</a></li>
|
||||||
|
<li><a href="/manuals/bios">BIOS</a></li>
|
||||||
|
<li><strong><a href="/manuals/answering_questions">Answering questions</a></strong> (you are here)</li>
|
||||||
|
<li><a href="/manuals/bugs">Bug handling and troubleshooting</a></li>
|
||||||
|
<li><a href="/manuals/feature_philosophy">Feature Philosophy</a></li>
|
||||||
|
</ul>
|
||||||
|
<p></div></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div></section>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
</div><div class="popup-container login-popup-container hide" id="login-popup-container">
|
||||||
|
<div class="popup">
|
||||||
|
<div class="popup-body">
|
||||||
|
<section>
|
||||||
|
<h2>Log In</h2>
|
||||||
|
<p>Log in here to access your TSF stats. Please enter your <b>phone number</b> in the <a target="_blank" rel="noopener" href="https://telegram.org/faq#login-and-sms">international format</a> and we will send a confirmation message to your account via Telegram.</p>
|
||||||
|
|
||||||
|
<form id="send-form" class="login-form">
|
||||||
|
<div class="form-group">
|
||||||
|
<input type="tel" class="form-control tr-form-control input-lg" id="phone-number" placeholder="+12223334455" autocomplete="off"/>
|
||||||
|
</div>
|
||||||
|
<div class="popup-buttons">
|
||||||
|
<a class="btn btn-link btn-lg login-cancel-btn">Cancel</a><button type="submit" class="btn btn-link btn-lg">Next</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div id="login-form" class="hide">
|
||||||
|
<div class="form-group">
|
||||||
|
<span class="form-control tr-form-control input input-lg input-disabled"><strong id="phone-number-field"></strong> (<a class="login-back" href="/auth">Incorrect?</a>)</span>
|
||||||
|
<p class="help-block dots-animated">We've just sent you a message.<br/>Please confirm access via Telegram</p>
|
||||||
|
</div>
|
||||||
|
<div class="popup-buttons">
|
||||||
|
<a class="btn btn-link btn-lg login-cancel-btn">Cancel</a><a class="btn btn-link btn-lg login-back">Back</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div></div>
|
||||||
|
<script src="/js/jquery.min.js?1"></script>
|
||||||
|
<script src="/js/bootstrap.min.js"></script>
|
||||||
|
<script src="/js/main-aj.js?53"></script>
|
||||||
|
<script src="/js/main.js?42"></script>
|
||||||
|
<script src="/js/tsf.js?3"></script>
|
||||||
|
<script src="/js/jquery-ui.min.js?1"></script>
|
||||||
|
<script src="/js/tchart.min.js?15"></script>
|
||||||
|
<script src="/js/billboard.min.js"></script>
|
||||||
|
<script src="/js/stats.js?17"></script>
|
||||||
|
|
||||||
|
<script>ajInit({"version":551,"apiUrl":"\/api?hash=telegram-crawler","unauth":true});</script>
|
||||||
|
<script id="aj_script">Aj.onLoad(function(state) {
|
||||||
|
function requestConfirmation(event) {
|
||||||
|
event && event.preventDefault();
|
||||||
|
var phone = $('#phone-number').val();
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
url: '/auth/request',
|
||||||
|
data: {
|
||||||
|
phone: phone
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
$('#phone-number-field').text(phone);
|
||||||
|
$('#send-form').addClass('hide');
|
||||||
|
$('#login-form').removeClass('hide');
|
||||||
|
checkAuth(result.temp_session);
|
||||||
|
},
|
||||||
|
error: function(xhr) {
|
||||||
|
showAlert(xhr.responseText || 'Server error');
|
||||||
|
},
|
||||||
|
dataType: 'json'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function cancelConfirmation(event) {
|
||||||
|
event && event.preventDefault();
|
||||||
|
$('#phone-number-field').text('');
|
||||||
|
$('#send-form').removeClass('hide');
|
||||||
|
$('#login-form').addClass('hide');
|
||||||
|
$('#phone-number').focus();
|
||||||
|
clearTimeout(window.authTimeout);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function checkAuth(temp_session) {
|
||||||
|
clearTimeout(window.authTimeout);
|
||||||
|
window.authTimeout = setTimeout(function doCheckAuth() {
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
url: '/auth/login',
|
||||||
|
data: {
|
||||||
|
temp_session: temp_session
|
||||||
|
},
|
||||||
|
success: function(result) {
|
||||||
|
if (result) {
|
||||||
|
location.reload();
|
||||||
|
} else {
|
||||||
|
checkAuth(temp_session);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (xhr) {
|
||||||
|
showAlert(xhr.responseText || 'Server error');
|
||||||
|
},
|
||||||
|
dataType: 'json'
|
||||||
|
});
|
||||||
|
}, 700);
|
||||||
|
}
|
||||||
|
$('#login-popup-container').on('popup:open', function() {
|
||||||
|
$('#phone-number').focus();
|
||||||
|
});
|
||||||
|
$('#login-popup-container').on('popup:close', function() {
|
||||||
|
cancelConfirmation();
|
||||||
|
if (location.pathname == '/auth') {
|
||||||
|
window.history && history.replaceState(null, null, '/');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('#login-popup-container #send-form').on('submit', requestConfirmation);
|
||||||
|
$('#login-popup-container .login-cancel-btn').on('click', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
closePopup('#login-popup-container');
|
||||||
|
});
|
||||||
|
$('#login-popup-container .login-back').on('click', cancelConfirmation);
|
||||||
|
$('.login-link').on('click', function(e) {
|
||||||
|
e.stopImmediatePropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
openPopup('#login-popup-container');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
Aj.onUnload(function(state) {
|
||||||
|
$('#login-popup-container').off('popup:open');
|
||||||
|
$('#login-popup-container').off('popup:close');
|
||||||
|
$('#login-popup-container #send-form').off('submit');
|
||||||
|
$('#login-popup-container .login-cancel-btn').off('click');
|
||||||
|
$('#login-popup-container .login-back').off('click');
|
||||||
|
$('.login-link').off('click');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>Aj.pageLoaded();</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue