Update content of files

This commit is contained in:
GitHub Action 2022-10-14 11:59:21 +00:00
parent 596b53adbd
commit ca2b5c3581
2 changed files with 15 additions and 14 deletions

View file

@ -226,23 +226,24 @@ t.me/share/url?url=&lt;url&gt;&amp;text=&lt;text&gt;</code></pre>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<h3><a class="anchor" href="#voice-chatvideo-chatlivestream-links" id="voice-chatvideo-chatlivestream-links" name="voice-chatvideo-chatlivestream-links"><i class="anchor-icon"></i></a>Voice chat/Video chat/Livestream links</h3> <h3><a class="anchor" href="#video-chatlivestream-links" id="video-chatlivestream-links" name="video-chatlivestream-links"><i class="anchor-icon"></i></a>Video chat/Livestream links</h3>
<p>Used to join voice chats and video chats in groups, and livestreams in channels.<br> <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>. </p> 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 even for voice chats, clients should support parsing the old link format only for backwards compatibility. </p>
<p><code>t.me</code> syntax:</p> <p><code>t.me</code> syntax:</p>
<pre><code>t.me/&lt;username&gt;?voicechat <pre><code>t.me/&lt;username&gt;?videochat
t.me/&lt;username&gt;?voicechat=&lt;invite_hash&gt;
t.me/&lt;username&gt;?videochat
t.me/&lt;username&gt;?videochat=&lt;invite_hash&gt; t.me/&lt;username&gt;?videochat=&lt;invite_hash&gt;
t.me/&lt;username&gt;?livestream t.me/&lt;username&gt;?livestream
t.me/&lt;username&gt;?livestream=&lt;invite_hash&gt;</code></pre> t.me/&lt;username&gt;?livestream=&lt;invite_hash&gt;
t.me/&lt;username&gt;?voicechat
t.me/&lt;username&gt;?voicechat=&lt;invite_hash&gt;</code></pre>
<p><code>tg:</code> syntax:</p> <p><code>tg:</code> syntax:</p>
<pre><code>tg://resolve?domain=&lt;username&gt;&amp;voicechat <pre><code>tg://resolve?domain=&lt;username&gt;&amp;videochat
tg://resolve?domain=&lt;username&gt;&amp;voicechat=&lt;invite_hash&gt;
tg://resolve?domain=&lt;username&gt;&amp;videochat
tg://resolve?domain=&lt;username&gt;&amp;videochat=&lt;invite_hash&gt; tg://resolve?domain=&lt;username&gt;&amp;videochat=&lt;invite_hash&gt;
tg://resolve?domain=&lt;username&gt;&amp;livestream tg://resolve?domain=&lt;username&gt;&amp;livestream
tg://resolve?domain=&lt;username&gt;&amp;livestream=&lt;invite_hash&gt;</code></pre> tg://resolve?domain=&lt;username&gt;&amp;livestream=&lt;invite_hash&gt;
tg://resolve?domain=&lt;username&gt;&amp;voicechat
tg://resolve?domain=&lt;username&gt;&amp;voicechat=&lt;invite_hash&gt;</code></pre>
<p>Parameters:</p> <p>Parameters:</p>
<table class="table"> <table class="table">
<thead> <thead>

View file

@ -46,7 +46,7 @@
<p>When interacting with HTML5 games, websites of payment gateways and <a href="/api/bots/webapps">bot web apps</a>, Telegram apps should expose APIs to allow receiving data and events from the websites.</p> <p>When interacting with HTML5 games, websites of payment gateways and <a href="/api/bots/webapps">bot web apps</a>, Telegram apps should expose APIs to allow receiving data and events from the websites.</p>
<h3><a class="anchor" href="#event-apis" id="event-apis" name="event-apis"><i class="anchor-icon"></i></a>Event APIs</h3> <h3><a class="anchor" href="#event-apis" id="event-apis" name="event-apis"><i class="anchor-icon"></i></a>Event APIs</h3>
<p>Games and payment gateways can generate events that are meant to be received by the Telegram apps. <p>Games, payment gateways and <a href="/api/bots/webapps">bot web apps</a> can generate events that are meant to be received by the Telegram apps.
Typically events are generated by using the <code>postEvent</code> method of the <a href="https://github.com/TelegramMessenger/GamingCommunication/blob/master/games.js">GamingCommunication library</a>, or by the <a href="/bots/webapps#initializing-web-apps">bot web apps library</a>.<br> Typically events are generated by using the <code>postEvent</code> method of the <a href="https://github.com/TelegramMessenger/GamingCommunication/blob/master/games.js">GamingCommunication library</a>, or by the <a href="/bots/webapps#initializing-web-apps">bot web apps library</a>.<br>
The <code>postEvent</code> function will try sending the event to the Telegram app in a number of different ways.</p> The <code>postEvent</code> function will try sending the event to the Telegram app in a number of different ways.</p>
<h4><a class="anchor" href="#webviewproxy" id="webviewproxy" name="webviewproxy"><i class="anchor-icon"></i></a>WebviewProxy</h4> <h4><a class="anchor" href="#webviewproxy" id="webviewproxy" name="webviewproxy"><i class="anchor-icon"></i></a>WebviewProxy</h4>
@ -56,8 +56,8 @@ The <code>postEvent</code> function will try sending the event to the Telegram a
<p>Alternatively, a <code>window.external.notify</code> method can be exposed, accepting a string JSON payload with the event type and payload:</p> <p>Alternatively, a <code>window.external.notify</code> method can be exposed, accepting a string JSON payload with the event type and payload:</p>
<pre><code>window.external.notify(JSON.stringify({eventType: eventType, eventData: eventData}));</code></pre> <pre><code>window.external.notify(JSON.stringify({eventType: eventType, eventData: eventData}));</code></pre>
<h4><a class="anchor" href="#postmessage-api" id="postmessage-api" name="postmessage-api"><i class="anchor-icon"></i></a>postMessage API</h4> <h4><a class="anchor" href="#postmessage-api" id="postmessage-api" name="postmessage-api"><i class="anchor-icon"></i></a>postMessage API</h4>
<p>Finally, web MTProto clients that need to open a game or process a payment in an iframe can use the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage">postMessage API</a> to receive events from iframes. <p>Finally, web MTProto clients that need to open a game, open a <a href="/api/bots/webapps">bot web app</a> or process a payment in an iframe can use the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage">postMessage API</a> to receive events from iframes.<br>
The GamingCommunication and bot web app libraries by default will use <code>'*'</code> as <code>targetOrigin</code>, sending messages to parent pages regardless of the origin of the embedder.</p> The GamingCommunication and bot web apps libraries by default will use <code>'*'</code> as <code>targetOrigin</code>, sending messages to parent pages regardless of the origin of the embedder.</p>
<pre><code>window.parent.postMessage(JSON.stringify({eventType: eventType, eventData: eventData}), targetOrigin);</code></pre> <pre><code>window.parent.postMessage(JSON.stringify({eventType: eventType, eventData: eventData}), targetOrigin);</code></pre>
<h3><a class="anchor" href="#event-types" id="event-types" name="event-types"><i class="anchor-icon"></i></a>Event types</h3> <h3><a class="anchor" href="#event-types" id="event-types" name="event-types"><i class="anchor-icon"></i></a>Event types</h3>
<p><code>eventType</code> is a simple string indicating the event type, and <code>eventData</code> is a payload with an object that will be parsed by the Telegram app.</p> <p><code>eventType</code> is a simple string indicating the event type, and <code>eventData</code> is a payload with an object that will be parsed by the Telegram app.</p>