mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-12-15 03:06:18 +01:00
1498 lines
70 KiB
HTML
1498 lines
70 KiB
HTML
<!DOCTYPE html>
|
|
<html class="">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Deep links</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta property="description" content="Telegram clients must handle special tg:// and t.me deep links encountered in messages, link entities and in other apps by registering OS handlers.">
|
|
<meta property="og:title" content="Deep links">
|
|
<meta property="og:image" content="">
|
|
<meta property="og:description" content="Telegram clients must handle special tg:// and t.me deep links encountered in messages, link entities and in other apps by registering OS handlers.">
|
|
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
|
|
<link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" />
|
|
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
|
|
|
|
<link href="/css/telegram.css?236" 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/links" >Deep links</a></li></ul></div>
|
|
<h1 id="dev_page_title">Deep links</h1>
|
|
|
|
<div id="dev_page_content"><!-- scroll_nav -->
|
|
|
|
<p>Telegram clients must handle special <code>tg://</code> and <code>t.me</code> deep links encountered in messages, link entities and in other apps by registering OS handlers. </p>
|
|
<p>Links are generally available in two flavors: <code>t.me</code> HTTPS links and <code>tg:</code> URIs. </p>
|
|
<p><code>t.me</code> link syntax examples: </p>
|
|
<ul>
|
|
<li><code>t.me/path?query</code></li>
|
|
<li><code>http://t.me/path?query</code></li>
|
|
<li><code>https://t.me/path?query</code></li>
|
|
</ul>
|
|
<p>Where <code>t.me</code> can also be <code>telegram.me</code>, <code>telegram.dog</code>, and the domain specified in the <code>me_url_prefix</code> field of the global <a href="/constructor/config">configuration</a>, obtainable using <a href="/method/help.getConfig">help.getConfig</a>.</p>
|
|
<p><code>tg:</code> link syntax examples: </p>
|
|
<ul>
|
|
<li><code>tg:path?query</code></li>
|
|
<li><code>tg://path?query</code></li>
|
|
</ul>
|
|
<p>The <code>#fragment</code> part is always ignored when parsing Telegram deep links. </p>
|
|
<p>Also note that whenever a <code><username>.t.me</code> link is encountered and <code><username></code>:</p>
|
|
<ul>
|
|
<li>Is not equal to:<ul>
|
|
<li><code>www</code></li>
|
|
<li>Any of the values specified in <a href="https://github.com/tdlib/td/blob/07c1d53a6d3cb1fad58d2822e55eef6d57363581/td/telegram/LinkManager.cpp#L1099">this list »</a>.</li>
|
|
</ul>
|
|
</li>
|
|
<li>AND is not a single letter</li>
|
|
<li>AND is a valid username</li>
|
|
</ul>
|
|
<p>...it should be treated exactly as a <code>t.me/<username>/</code> link (generate a <code>t.me/<username>/</code> link and append the rest of the path (if present) and the query string (if present)). </p>
|
|
<h3><a class="anchor" href="#public-username-links" id="public-username-links" name="public-username-links"><i class="anchor-icon"></i></a>Public username links</h3>
|
|
<p>Used to link to public users, groups and channels, see <a href="/api/invites#public-usernames">here for more info on how to handle them »</a>. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/<username></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://resolve?domain=<username></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>username</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Username to <a href="/api/invites#public-usernames">check or import »</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Note that <a href="#message-links">message links</a> have the same syntax, with extra parameters. </p>
|
|
<h3><a class="anchor" href="#temporary-profile-links" id="temporary-profile-links" name="temporary-profile-links"><i class="anchor-icon"></i></a>Temporary profile links</h3>
|
|
<p>Used to link to user profiles, generated using <a href="/method/contacts.exportContactToken">contacts.exportContactToken</a>.<br>
|
|
These links can be generated even for profiles that don't have a username, and they have an expiration date, specified by the <code>expires</code> field of the <a href="/constructor/exportedContactToken">exportedContactToken</a> constructor returned by <a href="/method/contacts.exportContactToken">contacts.exportContactToken</a>. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/contact/<token></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://contact?token=<token></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>token</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Profile token to import using <a href="/method/contacts.importContactToken">contacts.importContactToken</a>, will return user information.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#phone-number-links" id="phone-number-links" name="phone-number-links"><i class="anchor-icon"></i></a>Phone number links</h3>
|
|
<p>Used to link to public and private users by their phone number. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/+<phone_number></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://resolve?phone=<phone_number></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>phone_number</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Phone number to resolve using <a href="/method/contacts.resolvePhone">contacts.resolvePhone</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Note that <a href="#message-links">chat invite links</a> have the same syntax, but <code><phone_number></code> won't be a valid phone number. </p>
|
|
<h3><a class="anchor" href="#chat-invite-links" id="chat-invite-links" name="chat-invite-links"><i class="anchor-icon"></i></a>Chat invite links</h3>
|
|
<p>Used to invite users to private groups and channels, see <a href="/api/invites#invite-links">here for more info on how to generate such links »</a>. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/+<hash></code></pre>
|
|
<p><code>t.me</code> syntax (legacy):</p>
|
|
<pre><code>t.me/joinchat/<hash></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://join?invite=<hash></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>hash</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Invite hash to <a href="/api/invites#invite-links">check or import »</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#chat-folder-links" id="chat-folder-links" name="chat-folder-links"><i class="anchor-icon"></i></a>Chat folder links</h3>
|
|
<p>Used to invite users to private groups and channels, see <a href="/api/folders#shared-folders">here for more info on how to generate such links »</a>. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/addlist/<slug></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://addlist?slug=<slug></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>slug</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Invite slug to <a href="/api/folders#shared-folders">check or import »</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#message-links" id="message-links" name="message-links"><i class="anchor-icon"></i></a>Message links</h3>
|
|
<p>Used to link to specific messages in public or private groups and channels. </p>
|
|
<p><code>t.me</code> syntax (public links): </p>
|
|
<pre><code>t.me/<username>/<thread_id>/<id>?single&comment=<message_id>&t=<media_timestamp>
|
|
t.me/<username>/<id>?single&thread=<thread_id>&comment=<message_id>&t=<media_timestamp></code></pre>
|
|
<p><code>t.me</code> syntax (private links): </p>
|
|
<pre><code>t.me/c/<channel>/<id>?single&thread=<thread_id>&comment=<message_id>&t=<media_timestamp>
|
|
t.me/c/<channel>/<thread_id>/<id>?single&comment=<message_id>&t=<media_timestamp></code></pre>
|
|
<p><code>tg:</code> syntax (public links):</p>
|
|
<pre><code>tg://resolve?domain=<username>&post=<id>&single&thread=<thread_id>&comment=<comment>&t=<media_timestamp></code></pre>
|
|
<p><code>tg:</code> syntax (private links):</p>
|
|
<pre><code>tg://privatepost?channel=<channelid>&post=<id>&single&thread=<thread_id>&comment=<comment>&t=<media_timestamp></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>username</code></td>
|
|
<td style="text-align: center;">Required if public link</td>
|
|
<td>Dialog username.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>channel</code></td>
|
|
<td style="text-align: center;">Required if private link</td>
|
|
<td>Channel or supergroup ID.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>id</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Message ID.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>single</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>For albums/grouped media, if set indicates that this is a link to a specific media in the album; otherwise, it is a link to the entire album.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>thread_id</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>For <a href="/api/threads">message threads</a>, contains the thread ID.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>comment</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>For <a href="/api/discussion">channel comments</a>, <code>username</code> will contain the channel username, <code>id</code> will contain the message ID of the channel message that started the comment section and this field will contain the message ID of the comment in the discussion group.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>media_timestamp</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>Timestamp at which to start playing the media file present in the body or in the webpage preview of the message, in the following formats: <br>- Seconds: <code>123</code>, regex <code>^(\d+)$</code> <br>- Minutes and seconds: <code>10:23</code>, example regex <code>^(\d+):(\d{1,2})$</code> <br>- Hours, minutes and seconds: <code>1h23m10s</code>, example regex <code>^(?:(\d+)h)?(?:(\d{1,2})m)?(?:(\d{1,2})s)$</code></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Note that since a <a href="/api/forum#forum-topics">forum topic</a> ID is actually the ID of the service message that created the topic, whenever the client resolves a <a href="#message-links">message link</a> that points to a <a href="/constructor/messageActionTopicCreate">messageActionTopicCreate</a> service message, it should open the topic, instead.<br>
|
|
Also, if the message ID is <code>1</code> and the linked-to supergroup is a forum, the "General" topic should be opened instead of the first message of the supergroup. </p>
|
|
<h3><a class="anchor" href="#forum-topic-links" id="forum-topic-links" name="forum-topic-links"><i class="anchor-icon"></i></a>Forum topic links</h3>
|
|
<p>Used to link to a specific <a href="/api/forum#forum-topics">forum topic</a>. </p>
|
|
<p>The syntax is exactly the same as for <a href="#message-links">message links</a>, because the topic ID is actually the ID of the service message that created the topic, so whenever the client resolves a <a href="#message-links">message link</a> that points to a <a href="/constructor/messageActionTopicCreate">messageActionTopicCreate</a> service message, it should open the topic, instead. </p>
|
|
<p>Also, if the message ID is <code>1</code> and the linked-to supergroup is a forum, the "General" topic should be opened instead of the first message of the supergroup. </p>
|
|
<h3><a class="anchor" href="#share-links" id="share-links" name="share-links"><i class="anchor-icon"></i></a>Share links</h3>
|
|
<p>Used to share a prepared message and URL into a chosen chat's text field.<br>
|
|
These links should be handled as follows:</p>
|
|
<ul>
|
|
<li>Open a dialog selection prompt</li>
|
|
<li>After selection: validate, trim and enter the URL at the beginning of the text field</li>
|
|
<li>Append a newline to the text field</li>
|
|
<li>Append and select the <code>text</code>, if present</li>
|
|
</ul>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/share?url=<url>
|
|
t.me/share?url=<url>&text=<text></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://msg_url?url=<url>&text=<text></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>url</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>URL to share (urlencoded)</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>text</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>Message to share</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#video-chat-livestream-links" id="video-chat-livestream-links" name="video-chat-livestream-links"><i class="anchor-icon"></i></a>Video chat/Livestream links</h3>
|
|
<p>Used to join video/voice chats in groups, and livestreams in channels.<br>
|
|
Such links are generated using <a href="/method/phone.exportGroupCallInvite">phone.exportGroupCallInvite</a>.<br>
|
|
Note that <code>voicechat</code> links are deprecated, the API will always export <code>videochat</code> links for video and voice chats in groups, clients should support parsing the old link format only for backwards compatibility. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/<username>?videochat
|
|
t.me/<username>?videochat=<invite_hash>
|
|
t.me/<username>?livestream
|
|
t.me/<username>?livestream=<invite_hash>
|
|
t.me/<username>?voicechat
|
|
t.me/<username>?voicechat=<invite_hash></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://resolve?domain=<username>&videochat
|
|
tg://resolve?domain=<username>&videochat=<invite_hash>
|
|
tg://resolve?domain=<username>&livestream
|
|
tg://resolve?domain=<username>&livestream=<invite_hash>
|
|
tg://resolve?domain=<username>&voicechat
|
|
tg://resolve?domain=<username>&voicechat=<invite_hash></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>invite_hash</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>Invite hash exported if the <code>can_self_unmute</code> flag is set when calling <a href="/method/phone.exportGroupCallInvite">phone.exportGroupCallInvite</a>: should be passed to <a href="/method/phone.joinGroupCall">phone.joinGroupCall</a>, allows the user to speak in livestreams or muted group chats.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#stickerset-links" id="stickerset-links" name="stickerset-links"><i class="anchor-icon"></i></a>Stickerset links</h3>
|
|
<p>Used to import stickersets or <a href="/api/custom-emoji">custom emoji</a> stickersets as described <a href="/api/stickers#installing-stickersets">here »</a>.</p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/addstickers/<slug>
|
|
t.me/addemoji/<slug></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://addstickers?set=<slug>
|
|
tg://addemoji?set=<slug></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>slug</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Stickerset short name, used when <a href="/api/stickers#installing-stickersets">installing stickers</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#custom-emoji-stickerset-links" id="custom-emoji-stickerset-links" name="custom-emoji-stickerset-links"><i class="anchor-icon"></i></a>Custom emoji stickerset links</h3>
|
|
<p>Used to import <a href="/api/custom-emoji">custom emoji</a> stickersets as described <a href="/api/stickers#installing-stickersets">here »</a>.</p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/addemoji/<slug></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://addemoji?set=<slug></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>slug</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Stickerset short name, used when <a href="/api/stickers#installing-stickersets">installing stickers</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#story-links" id="story-links" name="story-links"><i class="anchor-icon"></i></a>Story links</h3>
|
|
<p>Used to link to a <a href="/api/stories">Telegram Story »</a>, generated using the procedure <a href="/api/links#story-links">specified here »</a>. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/<username>/s/<story_id></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://resolve?domain=<username>&story=<story_id></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>username</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Username of the user or channel that posted the story.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>story_id</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>ID of the <a href="/api/stories#watching-stories">Telegram Story to be fetched and viewed as described here »</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#boost-links" id="boost-links" name="boost-links"><i class="anchor-icon"></i></a>Boost links</h3>
|
|
<p>Used by users to <a href="/api/boost">boost channels »</a>, granting them the ability to post stories and further perks.</p>
|
|
<p>Use the channel information to boost the channel as described <a href="/api/boost">here »</a>. </p>
|
|
<p><code>t.me</code> syntax (public channels):</p>
|
|
<pre><code>t.me/boost/<username>
|
|
t.me/<username>?boost</code></pre>
|
|
<p><code>t.me</code> syntax (private channels):</p>
|
|
<pre><code>t.me/boost?c=<id>
|
|
t.me/c/<id>?boost</code></pre>
|
|
<p><code>tg:</code> syntax (public channels):</p>
|
|
<pre><code>tg://boost?domain=<username></code></pre>
|
|
<p><code>tg:</code> syntax (private channels):</p>
|
|
<pre><code>tg://boost?channel=<id></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>username</code></td>
|
|
<td style="text-align: center;">Required for public links</td>
|
|
<td>Channel username.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>channel</code></td>
|
|
<td style="text-align: center;">Required for private links</td>
|
|
<td>Channel ID.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#proxy-links" id="proxy-links" name="proxy-links"><i class="anchor-icon"></i></a>Proxy links</h3>
|
|
<p>Used to share a proxy server that can be used to connect to Telegram. </p>
|
|
<h4><a class="anchor" href="#mtproxy-links" id="mtproxy-links" name="mtproxy-links"><i class="anchor-icon"></i></a>MTProxy links</h4>
|
|
<p>Used for <a href="/mtproto/mtproto-transports#transport-obfuscation">MTProxies »</a>.</p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/proxy?server=<server>&port=<port>&secret=<secret></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://proxy?server=<server>&port=<port>&secret=<secret></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>server</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>MTProxy server IP address or host</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>port</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>MTProxy server port</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>secret</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>MTProxy <a href="/mtproto/mtproto-transports#transport-obfuscation">secret »</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" href="#socks5-proxy-links" id="socks5-proxy-links" name="socks5-proxy-links"><i class="anchor-icon"></i></a>Socks5 proxy links</h4>
|
|
<p>Used for socks5 proxies.</p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/socks?server=<server>&port=<port>&user=<user>&pass=<pass></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://socks?server=<server>&port=<port>&user=<user>&pass=<pass></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>server</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Proxy server IP address or host</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>port</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Proxy server port</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>user</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>Proxy server username</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>pass</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>Proxy server password</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#theme-links" id="theme-links" name="theme-links"><i class="anchor-icon"></i></a>Theme links</h3>
|
|
<p>Used to <a href="/api/themes#installing-themes">install themes »</a>.</p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/addtheme/<name></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://addtheme?slug=<name></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>name</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Theme short name used when <a href="/api/themes#installing-themes">installing themes »</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#wallpaper-links" id="wallpaper-links" name="wallpaper-links"><i class="anchor-icon"></i></a>Wallpaper links</h3>
|
|
<p>Used to share and install chat backgrounds (wallpapers): see <a href="/api/wallpapers">here for more info on the various wallpaper and fill types »</a>. </p>
|
|
<h4><a class="anchor" href="#image-wallpapers" id="image-wallpapers" name="image-wallpapers"><i class="anchor-icon"></i></a><a href="/api/wallpapers#image-wallpapers">Image wallpapers</a></h4>
|
|
<p>Used for <a href="/api/wallpapers#image-wallpapers">image-based wallpapers »</a>. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/bg/<slug>?mode=<mode></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://bg?slug=<slug>&mode=<mode></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>slug</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Wallpaper slug used to obtain the image file using <a href="/method/account.getWallPaper">account.getWallPaper</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>mode</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>A combination of <code>blur</code> and <code>motion</code> (joined by <code>+</code>) to enable blurring and/or parallax motion as specified in the <a href="/api/wallpapers#image-wallpapers">docs »</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" href="#solid-fill-wallpapers" id="solid-fill-wallpapers" name="solid-fill-wallpapers"><i class="anchor-icon"></i></a>Solid fill wallpapers</h4>
|
|
<p>Used for <a href="/api/wallpapers#fill-wallpapers">fill wallpapers »</a> with a <a href="/api/wallpapers#solid-fill">solid fill »</a>. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/bg/<hex_color></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://bg?color=<hex_color></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>hex_color</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Fill color in hex RGB format.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" href="#gradient-fill-wallpapers" id="gradient-fill-wallpapers" name="gradient-fill-wallpapers"><i class="anchor-icon"></i></a>Gradient fill wallpapers</h4>
|
|
<p>Used for <a href="/api/wallpapers#fill-wallpapers">fill wallpapers »</a> with a <a href="/api/wallpapers#gradient-fill">gradient fill »</a>. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/bg/<top_color>-<bottom_color>?rotation=<rotation></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://bg?gradient=<top_color>-<bottom_color>&rotation=<rotation></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>top_color</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Top gradient color in hex RGB format.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>bottom_color</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Bottom gradient color in hex RGB format.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>rotation</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>Clockwise rotation angle of the gradient, in degrees; 0-359. Must be always divisible by 45, default to 0 if not set.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" href="#freeform-gradient-fill-wallpapers" id="freeform-gradient-fill-wallpapers" name="freeform-gradient-fill-wallpapers"><i class="anchor-icon"></i></a>Freeform gradient fill wallpapers</h4>
|
|
<p>Used for <a href="/api/wallpapers#fill-wallpapers">fill wallpapers »</a> with a <a href="/api/wallpapers#freeform-gradient-fill">freeform gradient fill »</a>. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/bg/<hex_color1>~<hex_color2>~<hex_color3>
|
|
t.me/bg/<hex_color1>~<hex_color2>~<hex_color3>~<hex_color4></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://bg?gradient=<hex_color1>~<hex_color2>~<hex_color3>
|
|
tg://bg?gradient=<hex_color1>~<hex_color2>~<hex_color3>~<hex_color4></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>hex_color1</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>First gradient color in hex RGB format.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>hex_color2</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Second gradient color in hex RGB format.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>hex_color3</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Third gradient color in hex RGB format.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>hex_color4</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>Fourth gradient color in hex RGB format.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" href="#solid-pattern-wallpapers" id="solid-pattern-wallpapers" name="solid-pattern-wallpapers"><i class="anchor-icon"></i></a>Solid pattern wallpapers</h4>
|
|
<p>Used for <a href="/api/wallpapers#pattern-wallpapers">pattern wallpapers »</a> with a <a href="/api/wallpapers#solid-fill">solid fill »</a>. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/bg/<slug>?intensity=<intensity>&bg_color=<bg_color>&mode=<mode></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://bg?slug=<slug>&intensity=<intensity>&bg_color=<bg_color>&mode=<mode></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>slug</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Wallpaper slug used to obtain the pattern file using <a href="/method/account.getWallPaper">account.getWallPaper</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>intensity</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>A value ranging from -100 to 100, used to combine the pattern with the fill <a href="/api/wallpapers#pattern-wallpapers">as specified in the docs</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>bg_color</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Fill color in hex RGB format.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>mode</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td><code>motion</code> to enable parallax motion as specified in the <a href="/api/wallpapers#image-wallpapers">docs</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" href="#gradient-pattern-wallpapers" id="gradient-pattern-wallpapers" name="gradient-pattern-wallpapers"><i class="anchor-icon"></i></a>Gradient pattern wallpapers</h4>
|
|
<p>Used for <a href="/api/wallpapers#pattern-wallpapers">pattern wallpapers »</a> with a <a href="/api/wallpapers#gradient-fill">gradient fill »</a>. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/bg/<slug>?intensity=<intensity>&bg_color=<top_color>-<bottom_color>&rotation=<rotation>&mode=<mode></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://bg?slug=<slug>&intensity=<intensity>&bg_color=<top_color>-<bottom_color>&rotation=<rotation>&mode=<mode></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>slug</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Wallpaper slug used to obtain the pattern file using <a href="/method/account.getWallPaper">account.getWallPaper</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>intensity</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>A value ranging from -100 to 100, used to combine the pattern with the fill <a href="/api/wallpapers#pattern-wallpapers">as specified in the docs</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>top_color</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Top gradient color in hex RGB format.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>bottom_color</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Bottom gradient color in hex RGB format.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>rotation</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>Clockwise rotation angle of the gradient, in degrees; 0-359. Must be always divisible by 45, default to 0 if not set.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>mode</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td><code>motion</code> to enable parallax motion as specified in the <a href="/api/wallpapers#image-wallpapers">docs</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" href="#freeform-gradient-pattern-wallpapers" id="freeform-gradient-pattern-wallpapers" name="freeform-gradient-pattern-wallpapers"><i class="anchor-icon"></i></a>Freeform gradient pattern wallpapers</h4>
|
|
<p>Used for <a href="/api/wallpapers#pattern-wallpapers">pattern wallpapers »</a> with a <a href="/api/wallpapers#freeform-gradient-fill">freeform gradient fill »</a>. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/bg/<slug>?intensity=<intensity>&bg_color=<hex_color1>~<hex_color2>~<hex_color3>&mode=<mode>
|
|
t.me/bg/<slug>?intensity=<intensity>&bg_color=<hex_color1>~<hex_color2>~<hex_color3>~<hex_color4>&mode=<mode></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://bg?slug=<slug>&intensity=<intensity>&bg_color=<hex_color1>~<hex_color2>~<hex_color3>&mode=<mode>
|
|
tg://bg?slug=<slug>&intensity=<intensity>&bg_color=<hex_color1>~<hex_color2>~<hex_color3>~<hex_color4>&mode=<mode></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>slug</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Wallpaper slug used to obtain the pattern file using <a href="/method/account.getWallPaper">account.getWallPaper</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>intensity</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>A value ranging from -100 to 100, used to combine the pattern with the fill <a href="/api/wallpapers#pattern-wallpapers">as specified in the docs</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>hex_color1</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>First gradient color in hex RGB format.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>hex_color2</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Second gradient color in hex RGB format.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>hex_color3</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Third gradient color in hex RGB format.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>hex_color4</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>Fourth gradient color in hex RGB format.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>mode</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td><code>motion</code> to enable parallax motion as specified in the <a href="/api/wallpapers#image-wallpapers">docs</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#bot-links" id="bot-links" name="bot-links"><i class="anchor-icon"></i></a>Bot links</h3>
|
|
<p>Used to link to bots.</p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/<bot_username>?start=<parameter></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://resolve?domain=<bot_username>&start=<parameter></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>bot_username</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Bot username</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>parameter</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>Start parameter, up to 64 <a href="https://en.wikipedia.org/wiki/Base64#The_URL_applications">base64url</a> characters: if provided and the <code>bot_username</code> is indeed a bot, the text input bar should be replaced with a <code>Start</code> button (even if the user has already started the bot) that should invoke <a href="/method/messages.startBot">messages.startBot</a> with the appropriate <code>parameter</code> once clicked. Note that if the <code>bot_username</code> is equal to the <a href="/api/config#premium-bot-username"><code>premium_bot_username</code> configuration value »</a>, clicking on this link should immediately invoke <a href="/method/messages.startBot">messages.startBot</a> with the appropriate <code>parameter</code>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#group-channel-bot-links" id="group-channel-bot-links" name="group-channel-bot-links"><i class="anchor-icon"></i></a>Group/channel bot links</h3>
|
|
<p>Used to add bots to groups or channels.<br>
|
|
First of all, check that the <code><bot_username></code> indeed links to a bot.<br>
|
|
Then, for group links:</p>
|
|
<ul>
|
|
<li>If the <code>admin</code> parameter is not provided:<ul>
|
|
<li>Bring up a dialog selection of groups where the user can add members</li>
|
|
<li>Add the bot to the group</li>
|
|
<li>If a <code>parameter</code> is provided, invoke <a href="/method/messages.startBot">messages.startBot</a> with the appropriate <code>parameter</code></li>
|
|
</ul>
|
|
</li>
|
|
<li>If the <code>admin</code> parameter is provided:<ul>
|
|
<li>Bring up a dialog selection of groups where the user can add/edit admins</li>
|
|
<li>If the bot is already an admin of the group, combine existing admin rights with the admin rights in <code>admin</code></li>
|
|
<li>Add the bot as admin/modify admin permissions to the new rights</li>
|
|
<li>If a <code>parameter</code> is provided, invoke <a href="/method/messages.startBot">messages.startBot</a> with the appropriate <code>parameter</code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<p>For channel links:</p>
|
|
<ul>
|
|
<li>Bring up a dialog selection of channels where the user can add/edit admins</li>
|
|
<li>If the bot is already an admin of the channel, combine existing admin rights with the admin rights in <code>admin</code></li>
|
|
<li>Add the bot as admin/modify admin permissions to the new rights</li>
|
|
</ul>
|
|
<p><code>t.me</code> syntax (groups):</p>
|
|
<pre><code>t.me/<bot_username>?startgroup=<parameter>&admin=<permissions>
|
|
t.me/<bot_username>?startgroup&admin=<permissions></code></pre>
|
|
<p><code>tg:</code> syntax (groups):</p>
|
|
<pre><code>tg://resolve?domain=<bot_username>&startgroup=<parameter>&admin=<permissions>
|
|
tg://resolve?domain=<bot_username>&startgroup&admin=<permissions></code></pre>
|
|
<p><code>t.me</code> syntax (channels):</p>
|
|
<pre><code>t.me/<bot_username>?startchannel&admin=<permissions></code></pre>
|
|
<p><code>tg:</code> syntax (channels):</p>
|
|
<pre><code>tg://resolve?domain=<bot_username>&startchannel&admin=<permissions></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>bot_username</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Bot username</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>parameter</code></td>
|
|
<td style="text-align: center;">Optional for group links, absent in channel links</td>
|
|
<td>Start parameter, only for group links, up to 64 <a href="https://en.wikipedia.org/wiki/Base64#The_URL_applications">base64url</a> characters: if provided and the <code>bot_username</code> is indeed a bot, <a href="/method/messages.startBot">messages.startBot</a> with the appropriate <code>parameter</code> should be invoked after adding the bot to the group.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>admin</code></td>
|
|
<td style="text-align: center;">Optional for group links, required for channel links</td>
|
|
<td>A combination of the following identifiers separated by <code>+</code>, each corresponding to the appropriate flag in the <a href="/constructor/chatAdminRights">chatAdminRights »</a> constructor: <br>- <code>change_info</code> - <a href="/constructor/chatAdminRights">chatAdminRights.change_info</a> <br>- <code>post_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.post_messages</a> <br>- <code>edit_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.edit_messages</a> <br>- <code>delete_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.delete_messages</a> <br>- <code>restrict_members</code> - <a href="/constructor/chatAdminRights">chatAdminRights.ban_users</a> <br>- <code>invite_users</code> - <a href="/constructor/chatAdminRights">chatAdminRights.invite_users</a> <br>- <code>pin_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.pin_messages</a> <br>- <code>manage_topics</code> - <a href="/constructor/chatAdminRights">chatAdminRights.manage_topics</a> <br>- <code>promote_members</code> - <a href="/constructor/chatAdminRights">chatAdminRights.add_admins</a> <br>- <code>manage_video_chats</code> - <a href="/constructor/chatAdminRights">chatAdminRights.manage_call</a> <br>- <code>anonymous</code> - <a href="/constructor/chatAdminRights">chatAdminRights.anonymous</a> <br>- <code>manage_chat</code> - <a href="/constructor/chatAdminRights">chatAdminRights.other</a> <br>- <code>post_stories</code> - <a href="/constructor/chatAdminRights">chatAdminRights.post_stories</a> <br>- <code>edit_stories</code> - <a href="/constructor/chatAdminRights">chatAdminRights.edit_stories</a> <br>- <code>delete_stories</code> - <a href="/constructor/chatAdminRights">chatAdminRights.delete_stories</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#game-links" id="game-links" name="game-links"><i class="anchor-icon"></i></a>Game links</h3>
|
|
<p>Used to share <a href="/api/bots/games">games</a>. </p>
|
|
<p>These links should be handled as follows: </p>
|
|
<ul>
|
|
<li>Check if <code>bot_username</code> is indeed a bot username, if so then</li>
|
|
<li>Bring up a dialog selection prompt</li>
|
|
<li>Send the game to the selected dialog using an <a href="/constructor/inputMediaGame">inputMediaGame</a> with an <a href="/constructor/inputGameShortName">inputGameShortName</a> as specified in the <a href="/api/bots/games#sending-a-game">game docs</a>. </li>
|
|
</ul>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/<bot_username>?game=<short_name></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://resolve?domain=<bot_username>&game=<short_name></code></pre>
|
|
<p>Parameters: </p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>bot_username</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Username of the bot that owns the <a href="/api/bots/games">game</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>short_name</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Game short name</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#settings-links" id="settings-links" name="settings-links"><i class="anchor-icon"></i></a>Settings links</h3>
|
|
<h4><a class="anchor" href="#settings-link" id="settings-link" name="settings-link"><i class="anchor-icon"></i></a>Settings link</h4>
|
|
<p>Used to bring the user to the app settings. </p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://settings</code></pre>
|
|
<p>No parameters.</p>
|
|
<h4><a class="anchor" href="#change-phone-number-link" id="change-phone-number-link" name="change-phone-number-link"><i class="anchor-icon"></i></a>Change phone number link</h4>
|
|
<p>Used to bring the user to the phone number modification page, invoking <a href="/method/account.sendChangePhoneCode">account.sendChangePhoneCode</a> and <a href="/method/account.changePhone">account.changePhone</a>.</p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://settings/change_number</code></pre>
|
|
<p>No parameters.</p>
|
|
<h4><a class="anchor" href="#active-sessions-link" id="active-sessions-link" name="active-sessions-link"><i class="anchor-icon"></i></a>Active sessions link</h4>
|
|
<p>Used to bring the user to the active sessions page, calling <a href="/method/account.getAuthorizations">account.getAuthorizations</a>. </p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://settings/devices</code></pre>
|
|
<p>No parameters.</p>
|
|
<h4><a class="anchor" href="#folder-settings-link" id="folder-settings-link" name="folder-settings-link"><i class="anchor-icon"></i></a>Folder settings link</h4>
|
|
<p>Used to bring the user to the <a href="/api/folders">folder settings</a>. </p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://settings/folders</code></pre>
|
|
<p>No parameters.</p>
|
|
<h4><a class="anchor" href="#language-settings-link" id="language-settings-link" name="language-settings-link"><i class="anchor-icon"></i></a>Language settings link</h4>
|
|
<p>Used to bring the user to the language settings. </p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://settings/language</code></pre>
|
|
<p>No parameters.</p>
|
|
<h4><a class="anchor" href="#privacy-and-security-settings-link" id="privacy-and-security-settings-link" name="privacy-and-security-settings-link"><i class="anchor-icon"></i></a>Privacy and security settings link</h4>
|
|
<p>Used to bring the user to the privacy and security settings. </p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://settings/privacy</code></pre>
|
|
<p>No parameters.</p>
|
|
<h4><a class="anchor" href="#autodelete-settings-link" id="autodelete-settings-link" name="autodelete-settings-link"><i class="anchor-icon"></i></a>Autodelete settings link</h4>
|
|
<p>Used to bring the user to the message autodeletion settings. </p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://settings/auto_delete</code></pre>
|
|
<p>No parameters.</p>
|
|
<h4><a class="anchor" href="#profile-settings-link" id="profile-settings-link" name="profile-settings-link"><i class="anchor-icon"></i></a>Profile settings link</h4>
|
|
<p>Used to bring the user to the profile settings menu. </p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://settings/edit_profile</code></pre>
|
|
<p>No parameters.</p>
|
|
<h4><a class="anchor" href="#theme-settings-link" id="theme-settings-link" name="theme-settings-link"><i class="anchor-icon"></i></a>Theme settings link</h4>
|
|
<p>Used to bring the user to the theme settings section of the app. </p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://settings/theme</code></pre>
|
|
<p>No parameters.</p>
|
|
<h3><a class="anchor" href="#login-code-link" id="login-code-link" name="login-code-link"><i class="anchor-icon"></i></a>Login code link</h3>
|
|
<p>Contains the phone number verification code to use during <a href="/api/auth">user authorization »</a>. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/login/<code></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://login?code=<code></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>code</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Login code.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#invoice-links" id="invoice-links" name="invoice-links"><i class="anchor-icon"></i></a>Invoice links</h3>
|
|
<p>Used to initiate <a href="/api/payments">payment of an invoice »</a>, generated using <a href="/constructor/payments.exportedInvoice">payments.exportedInvoice</a>. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/invoice/<slug>
|
|
t.me/$<slug></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://invoice?slug=<slug></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>slug</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>The invoice slug to be used <a href="/api/payments">during payment »</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#language-pack-links" id="language-pack-links" name="language-pack-links"><i class="anchor-icon"></i></a>Language pack links</h3>
|
|
<p>Used to import custom language packs using <a href="/method/langpack.getLangPack">langpack.getLangPack</a>.</p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/setlanguage/<slug></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://setlanguage?lang=<slug></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>slug</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Name of language pack to import using <a href="/method/langpack.getLangPack">langpack.getLangPack</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#telegram-passport-links" id="telegram-passport-links" name="telegram-passport-links"><i class="anchor-icon"></i></a>Telegram Passport links</h3>
|
|
<p>See <a href="/api/passport#uri-format">the Telegram Passport documentation for parameters and usage »</a>. </p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://passport?params
|
|
tg://resolve?domain=telegrampassport&params</code></pre>
|
|
<h3><a class="anchor" href="#phone-confirmation-links" id="phone-confirmation-links" name="phone-confirmation-links"><i class="anchor-icon"></i></a>Phone confirmation links</h3>
|
|
<p>Different from <a href="#login-code-link">login code links</a>.<br>
|
|
These links are used to confirm ownership of the phone number, to prevent account deletion: see <a href="/api/account-deletion">the account deletion docs for more info on how to handle them »</a>.</p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/confirmphone?phone=<phone>&hash=<hash></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://confirmphone?phone=<phone>&hash=<hash></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>phone</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Phone number</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>hash</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Confirmation hash to handle <a href="/api/account-deletion">as described here »</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#premium-multigift-links" id="premium-multigift-links" name="premium-multigift-links"><i class="anchor-icon"></i></a>Premium multigift links</h3>
|
|
<p>Used to bring the user to the screen used for gifting Telegram Premium subscriptions to friends, see <a href="/api/giveaways">here for more info on gifting Telegram Premium to multiple users »</a>. </p>
|
|
<p>This link is used to invite users to gift Premium subscription to other users, see <a href="#premium-giftcode-links">here »</a> for the different link type containing the actual giftcodes that can be used to import a gifted Telegram Premium subscription. </p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://premium_multigift?ref=<referrer></code></pre>
|
|
<p>Parameters: </p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>referrer</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>Used by official apps for analytics using <a href="/method/help.saveAppLog">help.saveAppLog</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#premium-referrer-links" id="premium-referrer-links" name="premium-referrer-links"><i class="anchor-icon"></i></a>Premium referrer links</h3>
|
|
<p>Used by official apps to show the <a href="/api/premium">Telegram Premium</a> subscription page. </p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://premium_offer?ref=<referrer></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>referrer</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>Used by official apps for analytics using <a href="/method/help.saveAppLog">help.saveAppLog</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#premium-giftcode-links" id="premium-giftcode-links" name="premium-giftcode-links"><i class="anchor-icon"></i></a>Premium giftcode links</h3>
|
|
<p>Used to process <a href="/api/giveaways">Telegram Premium giftcode links</a>. </p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://giftcode?slug=<slug></code></pre>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/giftcode/<slug></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>slug</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>Gift code slug to be passed to <a href="/method/payments.checkGiftCode">payments.checkGiftCode</a> to obtain further info, and eventually to <a href="/method/payments.applyGiftCode">payments.applyGiftCode</a> to apply it. See the <a href="/api/giveaways">giveaways</a> documentation for more info.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#qr-code-login-links" id="qr-code-login-links" name="qr-code-login-links"><i class="anchor-icon"></i></a>QR code login links</h3>
|
|
<p>Used by the <a href="/api/qr-login">QR code login flow »</a>.</p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://login?token=<base64encodedtoken></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>server</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Base64URL-encoded <a href="/api/qr-login">QR code login token</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#mini-app-links" id="mini-app-links" name="mini-app-links"><i class="anchor-icon"></i></a>Mini App links</h3>
|
|
<p>Used to install and open a <a href="/api/bots/attach">bot attachment or side menu »</a>.<br>
|
|
Clients should first <a href="/api/bots/attach">install the associated bot attachment or side menu entry as specified here »</a>, and if the user accepts the installation prompt, open the Mini App using the following logic. </p>
|
|
<p>After installing the attachment/side menu entry globally, opens the associated mini app using <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> with the <code>from_side_menu</code> flag set, regardless of the currently open Telegram chat (in fact, the Mini App should opened with that flag even if the client itself is minimized). </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/<bot_username>?startapp
|
|
t.me/<bot_username>?startapp=<start_parameter></code></pre>
|
|
<p>Note that <a href="#direct-mini-app-links">Direct Mini App links</a> have a similar syntax, with an additional <code>short_name</code> parameter to identify a specific Mini App owned by the bot. </p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://resolve?domain=<bot_username>&startapp
|
|
tg://resolve?domain=<bot_username>&startapp=<start_parameter></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>bot_username</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Username of the bot that owns the <a href="/api/bots/attach">attachment/side menu entry</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>start_parameter</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>If provided, should be passed to <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a>.<code>start_param</code></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#direct-mini-app-links" id="direct-mini-app-links" name="direct-mini-app-links"><i class="anchor-icon"></i></a>Direct mini app links</h3>
|
|
<p>Used to share <a href="/api/bots/webapps#direct-link-mini-apps">Direct link Mini apps</a>. </p>
|
|
<p>These links are different from <a href="#bot-attachment-or-side-menu-links">bot attachment menu deep links</a>, because they don't require the user to install an attachment menu, and a single bot can offer multiple named mini apps, distinguished by their <code>short_name</code>. </p>
|
|
<p>These links should be handled as specified in the <a href="/api/bots/webapps#direct-link-mini-apps">direct link Mini Apps documentation »</a>. </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/<bot_username>/<short_name>?startapp=<start_parameter></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://resolve?domain=<bot_username>&appname=<short_name>&startapp=<start_parameter></code></pre>
|
|
<p>Note that <a href="#mini-app-links">Mini App links</a> have a similar syntax, <em>without</em> a <code>short_name</code> parameter. </p>
|
|
<p>Parameters: </p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>bot_username</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Username of the bot that owns the <a href="/api/bots/games">game</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>appname</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Mini app short name, to pass to <a href="/constructor/inputBotAppShortName">inputBotAppShortName</a>.<code>short_name</code> when invoking <a href="/method/messages.getBotApp">messages.getBotApp</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>startapp</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td><code>start_param</code> to pass to <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#bot-attachment-or-side-menu-links" id="bot-attachment-or-side-menu-links" name="bot-attachment-or-side-menu-links"><i class="anchor-icon"></i></a>Bot attachment or side menu links</h3>
|
|
<p>Used to install and open a <a href="/api/bots/attach">bot attachment or side menu »</a> in a certain chat.<br>
|
|
For all link types, clients should first <a href="/api/bots/attach">install the associated bot attachment or side menu entry as specified here »</a>, and if the user accepts the installation prompt, open the Mini App using the following logic, depending on the link subtype:</p>
|
|
<h4><a class="anchor" href="#open-in-current-chat" id="open-in-current-chat" name="open-in-current-chat"><i class="anchor-icon"></i></a>Open in current chat</h4>
|
|
<p>After installing the attachment/side menu entry globally, opens the associated mini app using <a href="/method/messages.requestWebView">messages.requestWebView</a> in the currently open chat, by passing it to the <code>peer</code> parameter of <a href="/method/messages.requestWebView">messages.requestWebView</a>. </p>
|
|
<p>If the current chat is not supported by the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>peer_types</code> field: </p>
|
|
<ul>
|
|
<li>If the user has just installed the attachment menu in the previous step, notify the user that the attachment menu was installed successfully.</li>
|
|
<li>Otherwise, notify the user that the attachment menu webapp can't be opened in the specified chat.</li>
|
|
</ul>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/<bot_username>?startattach
|
|
t.me/<bot_username>?startattach=<start_parameter></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://resolve?domain=<bot_username>&startattach
|
|
tg://resolve?domain=<bot_username>&startattach=<start_parameter></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>bot_username</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Username of the bot that owns the <a href="/api/bots/attach">attachment/side menu entry</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>start_parameter</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>If provided, should be passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>start_param</code></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" href="#open-in-specific-chat" id="open-in-specific-chat" name="open-in-specific-chat"><i class="anchor-icon"></i></a>Open in specific chat</h4>
|
|
<p>After installing the attachment/side menu entry globally, opens the associated mini app using <a href="/method/messages.requestWebView">messages.requestWebView</a> in a specific chat (passed to the <code>peer</code> parameter of <a href="/method/messages.requestWebView">messages.requestWebView</a>). </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/<username>?attach=<bot_username>
|
|
t.me/<username>?attach=<bot_username>&startattach=<start_parameter>
|
|
t.me/+<phone_number>?attach=<bot_username>
|
|
t.me/+<phone_number>?attach=<bot_username>&startattach=<start_parameter></code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://resolve?domain=<username>&attach=<bot_username>
|
|
tg://resolve?domain=<username>&attach=<bot_username>&startattach=<start_parameter>
|
|
tg://resolve?phone=<phone_number>&attach=<bot_username>
|
|
tg://resolve?phone=<phone_number>&attach=<bot_username>&startattach=<start_parameter></code></pre>
|
|
<p>If the specified chat is not supported by the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>peer_types</code> field: </p>
|
|
<ul>
|
|
<li>If the user has just installed the attachment menu in the previous step, notify the user that the attachment menu was installed successfully.</li>
|
|
<li>Otherwise, notify the user that the attachment menu webapp can't be opened in the specified chat.</li>
|
|
</ul>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>username</code></td>
|
|
<td style="text-align: center;">Required for <a href="#public-username-links">username links</a></td>
|
|
<td>Username of chat where to open the mini app</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>phone_number</code></td>
|
|
<td style="text-align: center;">Required for <a href="#phone-number-links">phone number links</a></td>
|
|
<td>Phone number of private chat where to the open mini app</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>bot_username</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Username of the bot that owns the <a href="/api/bots/attach">attachment/side menu</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>start_parameter</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>If provided, should be passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>start_param</code></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" href="#open-in-any-chat" id="open-in-any-chat" name="open-in-any-chat"><i class="anchor-icon"></i></a>Open in any chat</h4>
|
|
<p>After installing the attachment/side menu entry globally, opens a dialog selection form that will open the attachment menu mini app using <a href="/method/messages.requestWebView">messages.requestWebView</a> in a specific chat (passed it to the <code>peer</code> parameter of <a href="/method/messages.requestWebView">messages.requestWebView</a>). </p>
|
|
<p><code>t.me</code> syntax:</p>
|
|
<pre><code>t.me/<bot_username>?startattach&choose=users+bots+groups+channels
|
|
t.me/<bot_username>?startattach=<start_parameter>&choose=users+bots+groups+channels</code></pre>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://resolve?domain=<bot_username>&startattach&choose=users+bots+groups+channels
|
|
tg://resolve?domain=<bot_username>&startattach=<start_parameter>&choose=users+bots+groups+channels</code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>bot_username</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>Username of the bot that owns the <a href="/api/bots/attach">attachment/side menu</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>start_parameter</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>If provided, should be passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>start_param</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>choose</code></td>
|
|
<td style="text-align: center;">Optional</td>
|
|
<td>A combination of <code>users</code>, <code>bots</code>, <code>groups</code>, <code>channels</code> separated by <code>+</code>: indicates the dialog types to show in the dialog selection popup: must be intersected with the dialog types contained in the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>peer_types</code> field before use.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#id-links" id="id-links" name="id-links"><i class="anchor-icon"></i></a>ID links</h3>
|
|
<p>ID links are merely an abstraction offered by the <a href="/bots/api">bot API</a> to simplify construction of <a href="/constructor/inputMessageEntityMentionName">inputMessageEntityMentionName</a> and <a href="/constructor/inputKeyboardButtonUserProfile">inputKeyboardButtonUserProfile</a> constructors, and should be ignored by normal clients. </p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://user?id=<id></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>id</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td>User ID</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#emoji-links" id="emoji-links" name="emoji-links"><i class="anchor-icon"></i></a>Emoji links</h3>
|
|
<p>Emoji links are merely an abstraction offered by the <a href="/bots/api">bot API</a> to simplify construction of <a href="/constructor/messageEntityCustomEmoji">messageEntityCustomEmoji</a> constructors, and should be ignored by normal clients. </p>
|
|
<p><code>tg:</code> syntax:</p>
|
|
<pre><code>tg://emoji?id=<id></code></pre>
|
|
<p>Parameters:</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th style="text-align: center;">Optional</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>id</code></td>
|
|
<td style="text-align: center;">Required</td>
|
|
<td><a href="/api/custom-emoji">Custom emoji ID</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" href="#unsupported-links" id="unsupported-links" name="unsupported-links"><i class="anchor-icon"></i></a>Unsupported links</h3>
|
|
<p>If a client encounters a <code>tg:</code> link type not listed on this page, <a href="/method/help.getDeepLinkInfo">help.getDeepLinkInfo</a> should be invoked with just the <code>path</code> component of the link. </p>
|
|
<p>Schema:</p>
|
|
<pre><code><a href='/constructor/help.deepLinkInfoEmpty'>help.deepLinkInfoEmpty</a>#66afa166 = <a href='/type/help.DeepLinkInfo'>help.DeepLinkInfo</a>;
|
|
<a href='/constructor/help.deepLinkInfo'>help.deepLinkInfo</a>#6a4ee832 flags:<a href='/type/%23'>#</a> update_app:flags.0?<a href='/constructor/true'>true</a> message:<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a><<a href='/type/MessageEntity'>MessageEntity</a>> = <a href='/type/help.DeepLinkInfo'>help.DeepLinkInfo</a>;
|
|
|
|
---functions---
|
|
|
|
<a href='/method/help.getDeepLinkInfo'>help.getDeepLinkInfo</a>#3fedc75f path:<a href='/type/string'>string</a> = <a href='/type/help.DeepLinkInfo'>help.DeepLinkInfo</a>;</code></pre>
|
|
<p>The method may return formatted text, containing for example: </p>
|
|
<ul>
|
|
<li>A description of what the link does or,</li>
|
|
<li>An explanation of why a certain link isn't supported by the app;</li>
|
|
</ul>
|
|
<p>And/or an invitation to upgrade to the latest version of the client app to be able to use the link: in this case, the result <code>update_app</code> flag will also be set, and the app should directly link to a store or attempt updating to the latest version. </p>
|
|
<p>Example links that can be used for testing: </p>
|
|
<ul>
|
|
<li><code>tg://need_update_for_some_feature?test=a</code></li>
|
|
<li><code>tg:some_unsupported_feature?test=b</code></li>
|
|
</ul>
|
|
<p>In these cases, <a href="/method/help.getDeepLinkInfo">help.getDeepLinkInfo</a> should be invoked with the following parameters:</p>
|
|
<ul>
|
|
<li><code>help.getDeepLinkInfo({path: "need_update_for_some_feature"})</code></li>
|
|
<li><code>help.getDeepLinkInfo({path: "some_unsupported_feature"})</code></li>
|
|
</ul>
|
|
<p>Note that this method should not be called for unrecognized <code>t.me</code> links, the usual HTTP link handling logic should be used, instead.</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/privacy">Privacy</a></li>
|
|
<li><a href="//telegram.org/press">Press</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/android">Android</a></li>
|
|
<li><a href="//telegram.org/dl/web">Mobile Web</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="//telegram.org/press">Press</a></h5>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="/js/main.js?47"></script>
|
|
<script src="/js/jquery.min.js?1"></script>
|
|
<script src="/js/bootstrap.min.js?1"></script>
|
|
|
|
<script>window.initDevPageNav&&initDevPageNav();
|
|
backToTopInit("Go up");
|
|
removePreloadInit();
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|