Update content of files

This commit is contained in:
GitHub Action 2024-08-04 16:21:58 +00:00
parent 0ea4aab4b6
commit a975abd680
4 changed files with 32 additions and 6 deletions

View file

@ -1397,7 +1397,7 @@ tg://resolve?phone=<phone_number>&attach=<bot_username>&star
</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>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 (pass 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/&lt;bot_username&gt;?startattach&amp;choose=users+bots+groups+channels
t.me/&lt;bot_username&gt;?startattach=&lt;start_parameter&gt;&amp;choose=users+bots+groups+channels</code></pre>

View file

@ -72,7 +72,11 @@ To send albums, do <strong>not</strong> use <a href="/method/messages.sendMultiM
<a href='/constructor/updateMessageExtendedMedia'>updateMessageExtendedMedia</a>#d5a41724 peer:<a href='/type/Peer'>Peer</a> msg_id:<a href='/type/int'>int</a> extended_media:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageExtendedMedia'>MessageExtendedMedia</a>&gt; = <a href='/type/Update'>Update</a>;
<a href='/constructor/starsTransaction'>starsTransaction</a>#2db5418f flags:<a href='/type/%23'>#</a> refund:flags.3?<a href='/constructor/true'>true</a> pending:flags.4?<a href='/constructor/true'>true</a> failed:flags.6?<a href='/constructor/true'>true</a> gift:flags.10?<a href='/constructor/true'>true</a> id:<a href='/type/string'>string</a> stars:<a href='/type/long'>long</a> date:<a href='/type/int'>int</a> peer:<a href='/type/StarsTransactionPeer'>StarsTransactionPeer</a> title:flags.0?<a href='/type/string'>string</a> description:flags.1?<a href='/type/string'>string</a> photo:flags.2?<a href='/type/WebDocument'>WebDocument</a> transaction_date:flags.5?<a href='/type/int'>int</a> transaction_url:flags.5?<a href='/type/string'>string</a> bot_payload:flags.7?<a href='/type/bytes'>bytes</a> msg_id:flags.8?<a href='/type/int'>int</a> extended_media:flags.9?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageMedia'>MessageMedia</a>&gt; = <a href='/type/StarsTransaction'>StarsTransaction</a>;</code></pre>
<a href='/constructor/starsTransaction'>starsTransaction</a>#2db5418f flags:<a href='/type/%23'>#</a> refund:flags.3?<a href='/constructor/true'>true</a> pending:flags.4?<a href='/constructor/true'>true</a> failed:flags.6?<a href='/constructor/true'>true</a> gift:flags.10?<a href='/constructor/true'>true</a> id:<a href='/type/string'>string</a> stars:<a href='/type/long'>long</a> date:<a href='/type/int'>int</a> peer:<a href='/type/StarsTransactionPeer'>StarsTransactionPeer</a> title:flags.0?<a href='/type/string'>string</a> description:flags.1?<a href='/type/string'>string</a> photo:flags.2?<a href='/type/WebDocument'>WebDocument</a> transaction_date:flags.5?<a href='/type/int'>int</a> transaction_url:flags.5?<a href='/type/string'>string</a> bot_payload:flags.7?<a href='/type/bytes'>bytes</a> msg_id:flags.8?<a href='/type/int'>int</a> extended_media:flags.9?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageMedia'>MessageMedia</a>&gt; = <a href='/type/StarsTransaction'>StarsTransaction</a>;
---functions---
<a href='/method/messages.getExtendedMedia'>messages.getExtendedMedia</a>#84f80814 peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt; = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>Paid media is represented by a <a href="/constructor/messageMediaPaidMedia">messageMediaPaidMedia</a> constructor, containing:</p>
<ul>
<li>In <code>stars_amount</code>, the price of the media in <a href="/api/stars">Telegram Stars</a></li>
@ -85,6 +89,18 @@ To send albums, do <strong>not</strong> use <a href="/method/messages.sendMultiM
<p>To purchase paid media, follow the <a href="/api/payments#22-getting-invoice-info-about-the-product">usual payment flow »</a>, passing an <a href="/constructor/inputInvoiceMessage">inputInvoiceMessage</a> with the peer and message ID of the paid media. </p>
<p>Once the payment succeds, an <a href="/constructor/updateMessageExtendedMedia">updateMessageExtendedMedia</a> will be emitted, replacing the <a href="/constructor/messageExtendedMediaPreview">messageExtendedMediaPreview</a> constructors associated with the message with <a href="/constructor/messageExtendedMedia">messageExtendedMedia</a> constructors.<br>
No other updates will be emitted (i.e. <strong>no</strong> <a href="/constructor/updateEditChannelMessage">updateEditChannelMessage</a> updates will be emitted for the message containing the paid media, even if re-fetching the same messages through other means like <a href="/method/messages.getHistory">messages.getHistory</a> <em>will</em> return the revealed <a href="/constructor/messageExtendedMedia">messageExtendedMedia</a> constructors).</p>
<p><strong>Note</strong>: the <a href="/constructor/updateMessageExtendedMedia">updateMessageExtendedMedia</a> update does not have a <code>pts</code>/<code>qts</code> field.<br>
This means that this update can only be received passively via the socket (<a href="/api/updates#event-sequences">see here »</a>), and it <strong>cannot</strong> be returned by <a href="/method/updates.getDifference">updates.getDifference</a> or <a href="/method/updates.getChannelDifference">updates.getChannelDifference</a>.<br>
This implies that if a certain client is offline, and another session purchases a paid media, the first client will not receive the revealed <a href="/constructor/messageExtendedMedia">messageExtendedMedia</a> constructors when it reconnects to the server, and it would have no way to know that a paid media can be revealed to the user. </p>
<p>To bypass this issue, if:</p>
<ul>
<li>One or more messages containing not-yet-bought paid media are visible to the user</li>
<li>From the messages selected above, include only messages received <em>before</em> the client last went offline (i.e. exclude paid media messages that were received and cached via updates or getHistory/getMessages N seconds ago, and the client connected to the server M &gt;= N seconds ago)</li>
<li>From the messages selected above, include only messages for which <a href="/method/messages.getExtendedMedia">messages.getExtendedMedia</a> was called more than 15 seconds ago. </li>
<li>For all messages satisfying the above conditions, make a single query to <a href="/method/messages.getExtendedMedia">messages.getExtendedMedia</a>, aggregating matching message IDs in <code>id</code>.<br>
The method will return an array of <a href="/constructor/updateMessageExtendedMedia">updateMessageExtendedMedia</a> updates, only for passed messages containing <strong>already bought</strong> paid media.<br>
No information will be returned for passed messages containing not yet bought paid media, or not containing paid media. </li>
</ul>
<p>The associated <a href="/constructor/starsTransaction">starsTransaction</a> that will be generated will be of type <a href="/constructor/starsTransactionPeer">starsTransactionPeer</a> (with <code>peer</code> equal to the channel), <code>msg_id</code> equal to the message ID of the paid media and <code>extended_media</code> set to the revealed paid media.</p></div>
</div>

View file

@ -42,7 +42,9 @@
<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="/methods" >All Methods</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/method/messages.getExtendedMedia" >messages.getExtendedMedia</a></li></ul></div>
<h1 id="dev_page_title">messages.getExtendedMedia</h1>
<div id="dev_page_content"><p>Get information about extended media</p>
<div id="dev_page_content"><p>Fetch updated information about <a href="/api/paid-media">paid media, see here »</a> for the full flow.</p>
<p>This method will return an array of <a href="/constructor/updateMessageExtendedMedia">updateMessageExtendedMedia</a> updates, only for messages containing <strong>already bought</strong> paid media.<br>
No information will be returned for messages containing not yet bought paid media. </p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
@ -77,12 +79,12 @@
<tr>
<td><strong>peer</strong></td>
<td style="text-align: center;"><a href="/type/InputPeer">InputPeer</a></td>
<td>Peer</td>
<td>Peer with visible paid media messages.</td>
</tr>
<tr>
<td><strong>id</strong></td>
<td style="text-align: center;"><a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/int">int</a>&gt;</td>
<td>Message IDs</td>
<td>IDs of currently visible messages containing paid media.</td>
</tr>
</tbody>
</table>

View file

@ -587,6 +587,8 @@ i.icon {
right: 0;
top: 0;
z-index: 100;
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
background-color: var(--header-bg-color);
-webkit-backdrop-filter: blur(25px);
backdrop-filter: blur(25px);
@ -937,6 +939,7 @@ a.tm-pagination-item.active:focus {
right: 0;
top: 0;
bottom: 0;
padding-bottom: env(safe-area-inset-bottom);
background: var(--bg-color);
transition: transform var(--def-transition);
}
@ -1135,6 +1138,8 @@ a.tm-menu-link:focus {
}
.tm-footer {
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
background-color: var(--footer-bg-color);
}
.tm-footer-links {
@ -1305,7 +1310,7 @@ a.tm-menu-link:focus {
.tm-main {
margin: 0 auto;
width: 100%;
width: auto;
max-width: 480px;
padding-bottom: 70px;
flex-grow: 1;
@ -3816,6 +3821,9 @@ a.tm-table-action-link:hover {
.tm-main {
max-width: 720px;
box-sizing: content-box;
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
}
.tm-main-premium {
max-width: 480px;