mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-12-29 07:52:37 +01:00
Update content of files
This commit is contained in:
parent
1bd19e435b
commit
66418a5d3a
3 changed files with 9 additions and 8 deletions
|
@ -111,14 +111,15 @@ Note that eventual errors will not be sent as a <code>failed</code> event if the
|
|||
<p>Simple webapps can only send back data to the bot through the MTProto API via a <a href="/api/web-events#web-app-data-send"><code>web_app_data_send</code> JS event »</a>. </p>
|
||||
<p>Simple webapps can be opened from a <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> button contained in a reply keyboard identified by a <a href="/constructor/replyKeyboardMarkup">replyKeyboardMarkup</a> constructor, or by clicking on the <a href="/constructor/inlineBotWebView">inlineBotWebView</a> button on top of the inline result list, contained in <a href="/constructor/messages.botResults">messages.botResults</a>.<code>switch_webview</code>, returned by <a href="/method/messages.getInlineBotResults">messages.getInlineBotResults</a>. </p>
|
||||
<p>To open them, users should call <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> passing the original <code>url</code>, and then open a webview using the <code>url</code> contained in the returned <a href="/constructor/simpleWebViewResultUrl">simpleWebViewResultUrl</a>. </p>
|
||||
<p>Upon receiving a <a href="/api/web-events#web-app-data-send"><code>web_app_data_send</code> JS event »</a> from the web app, clients should invoke <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a>, passing the following arguments:</p>
|
||||
<p>If and only if the webapp was opened from a <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> reply keyboard button, upon receiving a <a href="/api/web-events#web-app-data-send"><code>web_app_data_send</code> JS event »</a> from the web app, clients should invoke <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a>, passing the following arguments:</p>
|
||||
<ul>
|
||||
<li><code>bot</code> - Bot ID</li>
|
||||
<li><code>random_id</code> - Unique random ID to avoid resending the same event multiple times</li>
|
||||
<li><code>button_text</code> - Text of the <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> that was pressed to open the simple web app</li>
|
||||
<li><code>data</code> - Contents of the <code>data</code> field of the JS event. </li>
|
||||
</ul>
|
||||
<p>Make sure to ignore all <code>web_app_data_send</code> events sent after the first one, <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a> must be called only once.<br>
|
||||
<p>Always ignore all <code>web_app_data_send</code> events received from <a href="/constructor/inlineBotWebView">inlineBotWebView</a> webapps, as only <a href="/constructor/keyboardButtonSimpleWebView">keyboardButtonSimpleWebView</a> webapps can send this event.<br>
|
||||
Make sure to ignore all <code>web_app_data_send</code> events sent after the first one, <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a> must be called only once.<br>
|
||||
The webview must be closed after invoking the <a href="/method/messages.sendWebViewData">messages.sendWebViewData</a> method. </p>
|
||||
<p>This will generate a <a href="/constructor/messageActionWebViewDataSent">messageActionWebViewDataSent</a> update for the user, and a <a href="/constructor/messageActionWebViewDataSentMe">messageActionWebViewDataSentMe</a> update for the bot, containing the event data. </p>
|
||||
<h3><a class="anchor" href="#normal-web-apps" id="normal-web-apps" name="normal-web-apps"><i class="anchor-icon"></i></a>Normal web apps</h3>
|
||||
|
@ -169,9 +170,7 @@ The webview must be closed after invoking the <a href="/method/messages.sendWebV
|
|||
|
||||
<a href='/method/messages.getBotApp'>messages.getBotApp</a>#34fdc5c3 app:<a href='/type/InputBotApp'>InputBotApp</a> hash:<a href='/type/long'>long</a> = <a href='/type/messages.BotApp'>messages.BotApp</a>;
|
||||
|
||||
<a href='/method/messages.requestAppWebView'>messages.requestAppWebView</a>#8c5a3b3c flags:<a href='/type/%23'>#</a> write_allowed:flags.0?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> app:<a href='/type/InputBotApp'>InputBotApp</a> start_param:flags.1?<a href='/type/string'>string</a> theme_params:flags.2?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> = <a href='/type/AppWebViewResult'>AppWebViewResult</a>;
|
||||
|
||||
<a href='/method/messages.prolongWebView'>messages.prolongWebView</a>#7ff34309 flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> bot:<a href='/type/InputUser'>InputUser</a> query_id:<a href='/type/long'>long</a> reply_to_msg_id:flags.0?<a href='/type/int'>int</a> top_msg_id:flags.9?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<a href='/method/messages.requestAppWebView'>messages.requestAppWebView</a>#8c5a3b3c flags:<a href='/type/%23'>#</a> write_allowed:flags.0?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> app:<a href='/type/InputBotApp'>InputBotApp</a> start_param:flags.1?<a href='/type/string'>string</a> theme_params:flags.2?<a href='/type/DataJSON'>DataJSON</a> platform:<a href='/type/string'>string</a> = <a href='/type/AppWebViewResult'>AppWebViewResult</a>;</code></pre>
|
||||
<p>Another way to open web apps is by using <a href="/api/links#named-bot-web-app-links">named bot web app links »</a>. </p>
|
||||
<p>These links are different from <a href="/api/links#bot-attachment-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 web apps, distinguished by their <code>short_name</code>. </p>
|
||||
<p>These links should be handled as follows: </p>
|
||||
|
@ -179,6 +178,8 @@ The webview must be closed after invoking the <a href="/method/messages.sendWebV
|
|||
<li>Check if <code>bot_username</code> parameter of the link is indeed a bot username, if so then</li>
|
||||
<li>Invoke <a href="/method/messages.getBotApp">messages.getBotApp</a>, passing an <a href="/constructor/inputBotAppShortName">inputBotAppShortName</a> with the <code>short_name</code> contained in the <code>appname</code> query string parameter.
|
||||
If the client has already encountered an app with this short name from the same bot before, pass the <code>hash</code> of the cached <a href="/constructor/botApp">botApp</a> constructor to <a href="/method/messages.getBotApp">messages.getBotApp</a>.</li>
|
||||
<li>If a <a href="/constructor/messages.botApp">messages.botApp</a> constructor is returned and its <code>request_write_access</code> flag is set, show a prompt to the user, indicating that the bot is asking permission to send messages to the user.<br>
|
||||
If the user agrees, set the <code>write_allowed</code> flag when invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a> in the next step.</li>
|
||||
<li>If a <a href="/constructor/messages.botApp">messages.botApp</a> constructor is returned, open the web app by invoking <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>, generating an <a href="/constructor/inputBotAppID">inputBotAppID</a> constructor from <code>id</code> and <code>access_hash</code> of the returned <a href="/constructor/botApp">botApp</a>, or from previously cached information if we already met the bot app and <a href="/constructor/botAppNotModified">botAppNotModified</a> was returned. <ul>
|
||||
<li>If the client has clicked on the link in a Telegram chat, pass the chat's peer information into <code>peer</code>; otherwise pass the bot's peer information, instead.</li>
|
||||
<li>If the <a href="/constructor/messages.botApp">messages.botApp</a>.<code>inactive</code> flag is set, ask confirmation from the user before opening the web app.</li>
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
The first username in the <code>usernames</code> vector must be shown in-UI as the main username.</p>
|
||||
<p>Immediately after association, a username is marked as not <code>active</code> (i.e. only the owner can see it in the <code>usernames</code> list): use <a href="/method/account.toggleUsername">account.toggleUsername</a>, <a href="/method/bots.toggleUsername">bots.toggleUsername</a> or <a href="/method/channels.toggleUsername">channels.toggleUsername</a> to mark it as active.<br>
|
||||
Note that you can't mark as inactive the basic (non-collectible) username, if any. </p>
|
||||
<p><a href="/method/channels.deactivateAllUsernames">channels.deactivateAllUsernames</a> may also be used to mark as inactive all collectible usernames associated to a certain supergroup or channel.</p>
|
||||
<p><a href="/method/channels.deactivateAllUsernames">channels.deactivateAllUsernames</a> may also be used to mark as inactive all collectible usernames associated to a certain supergroup or channel: useful for example when making a group or channel private, by first invoking <a href="/method/channels.updateUsername">channels.updateUsername</a> with an empty username to remove the editable username (if present), and then invoking this method to remove all associated collectible usernames. </p>
|
||||
<p>Use <a href="/method/account.reorderUsernames">account.reorderUsernames</a>/<a href="/method/bots.reorderUsernames">bots.reorderUsernames</a>/<a href="/method/channels.reorderUsernames">channels.reorderUsernames</a> to change the order of the usernames associated to an account, channel or supergroup: all currently active usernames must be specified.</p></div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<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/channels.updateUsername" >channels.updateUsername</a></li></ul></div>
|
||||
<h1 id="dev_page_title">channels.updateUsername</h1>
|
||||
|
||||
<div id="dev_page_content"><p>Change the username of a supergroup/channel</p>
|
||||
<div id="dev_page_content"><p>Change or remove the username of a supergroup/channel</p>
|
||||
<p><div class="clearfix">
|
||||
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
|
||||
<li class="dropdown">
|
||||
|
@ -77,7 +77,7 @@
|
|||
<tr>
|
||||
<td><strong>username</strong></td>
|
||||
<td style="text-align: center;"><a href="/type/string">string</a></td>
|
||||
<td>New username</td>
|
||||
<td>New username, pass an empty string to remove the username</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
Loading…
Reference in a new issue