mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-12-18 12:49:16 +01:00
188 lines
16 KiB
HTML
188 lines
16 KiB
HTML
<!DOCTYPE html>
|
|
<html class="">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Bot attachment menu and side menu entries</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta property="description" content="Bots can install attachment menu and side menu entries, offering conveniently accessible, versatile web apps.">
|
|
<meta property="og:title" content="Bot attachment menu and side menu entries">
|
|
<meta property="og:image" content="">
|
|
<meta property="og:description" content="Bots can install attachment menu and side menu entries, offering conveniently accessible, versatile web apps.">
|
|
<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?239" 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/bots%2Fattach" >Bot attachment menu and side menu entries</a></li></ul></div>
|
|
<h1 id="dev_page_title">Bot attachment menu and side menu entries</h1>
|
|
|
|
<div id="dev_page_content"><!-- scroll_nav -->
|
|
|
|
<p>Bots can install attachment menu and side menu entries, offering conveniently accessible, versatile <a href="/api/bots/webapps#attachment-menu-mini-apps">mini apps</a>.</p>
|
|
<p>Schema:</p>
|
|
<pre><code><a href='/constructor/user'>user</a>#215c4438 flags:<a href='/type/%23'>#</a> self:flags.10?<a href='/constructor/true'>true</a> contact:flags.11?<a href='/constructor/true'>true</a> mutual_contact:flags.12?<a href='/constructor/true'>true</a> deleted:flags.13?<a href='/constructor/true'>true</a> bot:flags.14?<a href='/constructor/true'>true</a> bot_chat_history:flags.15?<a href='/constructor/true'>true</a> bot_nochats:flags.16?<a href='/constructor/true'>true</a> verified:flags.17?<a href='/constructor/true'>true</a> restricted:flags.18?<a href='/constructor/true'>true</a> min:flags.20?<a href='/constructor/true'>true</a> bot_inline_geo:flags.21?<a href='/constructor/true'>true</a> support:flags.23?<a href='/constructor/true'>true</a> scam:flags.24?<a href='/constructor/true'>true</a> apply_min_photo:flags.25?<a href='/constructor/true'>true</a> fake:flags.26?<a href='/constructor/true'>true</a> bot_attach_menu:flags.27?<a href='/constructor/true'>true</a> premium:flags.28?<a href='/constructor/true'>true</a> attach_menu_enabled:flags.29?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> bot_can_edit:flags2.1?<a href='/constructor/true'>true</a> close_friend:flags2.2?<a href='/constructor/true'>true</a> stories_hidden:flags2.3?<a href='/constructor/true'>true</a> stories_unavailable:flags2.4?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> access_hash:flags.0?<a href='/type/long'>long</a> first_name:flags.1?<a href='/type/string'>string</a> last_name:flags.2?<a href='/type/string'>string</a> username:flags.3?<a href='/type/string'>string</a> phone:flags.4?<a href='/type/string'>string</a> photo:flags.5?<a href='/type/UserProfilePhoto'>UserProfilePhoto</a> status:flags.6?<a href='/type/UserStatus'>UserStatus</a> bot_info_version:flags.14?<a href='/type/int'>int</a> restriction_reason:flags.18?<a href='/type/Vector%20t'>Vector</a><<a href='/type/RestrictionReason'>RestrictionReason</a>> bot_inline_placeholder:flags.19?<a href='/type/string'>string</a> lang_code:flags.22?<a href='/type/string'>string</a> emoji_status:flags.30?<a href='/type/EmojiStatus'>EmojiStatus</a> usernames:flags2.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/Username'>Username</a>> stories_max_id:flags2.5?<a href='/type/int'>int</a> color:flags2.8?<a href='/type/PeerColor'>PeerColor</a> profile_color:flags2.9?<a href='/type/PeerColor'>PeerColor</a> = <a href='/type/User'>User</a>;
|
|
|
|
<a href='/constructor/attachMenuBotsBot'>attachMenuBotsBot</a>#93bf667f bot:<a href='/type/AttachMenuBot'>AttachMenuBot</a> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/AttachMenuBotsBot'>AttachMenuBotsBot</a>;
|
|
|
|
<a href='/constructor/attachMenuBot'>attachMenuBot</a>#d90d8dfe flags:<a href='/type/%23'>#</a> inactive:flags.0?<a href='/constructor/true'>true</a> has_settings:flags.1?<a href='/constructor/true'>true</a> request_write_access:flags.2?<a href='/constructor/true'>true</a> show_in_attach_menu:flags.3?<a href='/constructor/true'>true</a> show_in_side_menu:flags.4?<a href='/constructor/true'>true</a> side_menu_disclaimer_needed:flags.5?<a href='/constructor/true'>true</a> bot_id:<a href='/type/long'>long</a> short_name:<a href='/type/string'>string</a> peer_types:flags.3?<a href='/type/Vector%20t'>Vector</a><<a href='/type/AttachMenuPeerType'>AttachMenuPeerType</a>> icons:<a href='/type/Vector%20t'>Vector</a><<a href='/type/AttachMenuBotIcon'>AttachMenuBotIcon</a>> = <a href='/type/AttachMenuBot'>AttachMenuBot</a>;
|
|
|
|
<a href='/constructor/attachMenuPeerTypeSameBotPM'>attachMenuPeerTypeSameBotPM</a>#7d6be90e = <a href='/type/AttachMenuPeerType'>AttachMenuPeerType</a>;
|
|
<a href='/constructor/attachMenuPeerTypeBotPM'>attachMenuPeerTypeBotPM</a>#c32bfa1a = <a href='/type/AttachMenuPeerType'>AttachMenuPeerType</a>;
|
|
<a href='/constructor/attachMenuPeerTypePM'>attachMenuPeerTypePM</a>#f146d31f = <a href='/type/AttachMenuPeerType'>AttachMenuPeerType</a>;
|
|
<a href='/constructor/attachMenuPeerTypeChat'>attachMenuPeerTypeChat</a>#509113f = <a href='/type/AttachMenuPeerType'>AttachMenuPeerType</a>;
|
|
<a href='/constructor/attachMenuPeerTypeBroadcast'>attachMenuPeerTypeBroadcast</a>#7bfbdefc = <a href='/type/AttachMenuPeerType'>AttachMenuPeerType</a>;
|
|
|
|
<a href='/constructor/attachMenuBotIcon'>attachMenuBotIcon</a>#b2a7386b flags:<a href='/type/%23'>#</a> name:<a href='/type/string'>string</a> icon:<a href='/type/Document'>Document</a> colors:flags.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/AttachMenuBotIconColor'>AttachMenuBotIconColor</a>> = <a href='/type/AttachMenuBotIcon'>AttachMenuBotIcon</a>;
|
|
|
|
<a href='/constructor/attachMenuBotIconColor'>attachMenuBotIconColor</a>#4576f3f0 name:<a href='/type/string'>string</a> color:<a href='/type/int'>int</a> = <a href='/type/AttachMenuBotIconColor'>AttachMenuBotIconColor</a>;
|
|
|
|
|
|
<a href='/constructor/updateAttachMenuBots'>updateAttachMenuBots</a>#17b7a20b = <a href='/type/Update'>Update</a>;
|
|
|
|
<a href='/constructor/attachMenuBotsNotModified'>attachMenuBotsNotModified</a>#f1d88a5c = <a href='/type/AttachMenuBots'>AttachMenuBots</a>;
|
|
<a href='/constructor/attachMenuBots'>attachMenuBots</a>#3c4301c0 hash:<a href='/type/long'>long</a> bots:<a href='/type/Vector%20t'>Vector</a><<a href='/type/AttachMenuBot'>AttachMenuBot</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/AttachMenuBots'>AttachMenuBots</a>;
|
|
|
|
|
|
---functions---
|
|
|
|
<a href='/method/messages.getAttachMenuBot'>messages.getAttachMenuBot</a>#77216192 bot:<a href='/type/InputUser'>InputUser</a> = <a href='/type/AttachMenuBotsBot'>AttachMenuBotsBot</a>;
|
|
|
|
<a href='/method/messages.toggleBotInAttachMenu'>messages.toggleBotInAttachMenu</a>#69f59d69 flags:<a href='/type/%23'>#</a> write_allowed:flags.0?<a href='/constructor/true'>true</a> bot:<a href='/type/InputUser'>InputUser</a> enabled:<a href='/type/Bool'>Bool</a> = <a href='/type/Bool'>Bool</a>;
|
|
|
|
<a href='/method/messages.getAttachMenuBots'>messages.getAttachMenuBots</a>#16fcc2cb hash:<a href='/type/long'>long</a> = <a href='/type/AttachMenuBots'>AttachMenuBots</a>;</code></pre>
|
|
<p>Bots that have the <code>bot_attach_menu</code> flag set offer an attachment or side menu entry that can be added to the in-app attachment menu or main view side menu. </p>
|
|
<p>Use <a href="/method/messages.getAttachMenuBot">messages.getAttachMenuBot</a> to get info about the attachment/side menu entry of a given bot, see the <a href="/constructor/attachMenuBot">attachMenuBot constructor page for more info »</a>. </p>
|
|
<p>The currently installed attachment/side menu list can be fetched using <a href="/method/messages.getAttachMenuBots">messages.getAttachMenuBots</a>. </p>
|
|
<p>Use <a href="/method/messages.toggleBotInAttachMenu">messages.toggleBotInAttachMenu</a> to enable or disable the attachment and/or side menu of a given bot (the entries that must be installed or uninstalled depend on the values of the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>show_in_attach_menu</code> and <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>show_in_side_menu</code> flags).<br>
|
|
Changes made using this method will trigger an <a href="/constructor/updateAttachMenuBots">updateAttachMenuBots</a> update in other clients, which should trigger a <a href="/method/messages.getAttachMenuBots">messages.getAttachMenuBots</a> call to fetch the full updated list of installed attachment/side menu entries.<br>
|
|
The attachment/side menu list should also be refreshed if the user changes the app's language in the settings. </p>
|
|
<p>Once an attachment/side menu is enabled for a certain user, the <a href="/constructor/user">user</a>.<code>attach_menu_enabled</code> flag will be set <em>for the bot</em>, and the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>inactive</code> flag will be unset. </p>
|
|
<p>Clicking on the attachment/side menu entry should open the related <a href="/api/bots/webapps#attachment-menu-mini-apps">attachment menu mini app</a>, see <a href="/api/bots/webapps#attachment-menu-mini-apps">here »</a> and <a href="/api/bots/webapps#side-menu-mini-apps">here »</a> for more info on the required steps.</p>
|
|
<p>Attachment menus can be installed and opened through <a href="/api/links#bot-attachment-or-side-menu-links">attachment/side menu deep links</a> and through <a href="/api/links#mini-app-links">mini app links</a>.</p>
|
|
<p>In particular, when clicking on such a link, <a href="/method/messages.getAttachMenuBot">messages.getAttachMenuBot</a> should be invoked to check if the bot has an associated attachment/side menu entry, and if yes: </p>
|
|
<ul>
|
|
<li>If the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>inactive</code> flag:<ul>
|
|
<li>...is set, the attachment/side menu entry is not installed.<br>
|
|
Thus, before launching the mini app when clicking on a <a href="/api/links#bot-attachment-or-side-menu-links">attachment/side menu deep link</a>, the client should show a prompt to the user, asking to add the mini app to the attachment/side menu.<br>
|
|
Note that if the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>side_menu_disclaimer_needed</code> flag is set, an additional mandatory checkbox to accept the <a href="https://telegram.org/tos/mini-apps">mini apps TOS</a> and a disclaimer indicating that this Mini App is not affiliated to Telegram should be shown in the installation prompt.<br>
|
|
If the user accepts, invoke <a href="/method/messages.toggleBotInAttachMenu">messages.toggleBotInAttachMenu</a> with the <code>write_allowed</code> flag set and proceed to the next step, otherwise abort the process. </li>
|
|
<li>...is not set, and the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>side_menu_disclaimer_needed</code> flag is still set, an additional mandatory checkbox to accept the <a href="https://telegram.org/tos/mini-apps">mini apps TOS</a> and a disclaimer indicating that this Mini App is not affiliated to Telegram should be shown.<br>
|
|
If the user accepts, proceed to the next step, otherwise abort the process. </li>
|
|
</ul>
|
|
</li>
|
|
<li>Open the Mini App:<ul>
|
|
<li>If the link is a <a href="/api/links#direct-mini-app-links">direct mini app link</a>, open the Mini App regardless of the currently open Telegram chat (in fact, the Mini App should opened even if the client itself is minimized), as specified <a href="/api/bots/webapps#direct-link-mini-apps">here »</a>. </li>
|
|
<li>For <a href="/api/links#bot-attachment-or-side-menu-links">attachment/side menu links</a>, check that the attachment menu can be opened in the chosen chat type by checking the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>peer_types</code> field. <ul>
|
|
<li>If the chosen chat is supported, open the <a href="/api/bots/webapps#attachment-menu-mini-apps">attachment menu mini app »</a> as specified <a href="/api/bots/webapps#attachment-menu-mini-apps">here »</a>.</li>
|
|
<li>Otherwise:<ul>
|
|
<li>If the user has just installed the attachment menu @ step 1, 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>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul></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>
|
|
|