telegram-crawler/data/web/blogfork.telegram.org/api/bots/attach.html
2023-10-22 15:31:15 +00:00

163 lines
12 KiB
HTML

<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Bot attachment menu entries</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Bots can install attachment menu entries, offering conveniently accessible, versatile web apps.">
<meta property="og:title" content="Bot attachment menu entries">
<meta property="og:image" content="">
<meta property="og:description" content="Bots can install attachment 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?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/bots%2Fattach" >Bot attachment menu entries</a></li></ul></div>
<h1 id="dev_page_title">Bot attachment menu entries</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p>Bots can install attachment menu entries, offering conveniently accessible, versatile <a href="/api/bots/webapps#normal-web-apps">web apps</a>.</p>
<p>Schema:</p>
<pre><code><a href='/constructor/user'>user</a>#8f97c628 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> 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>&lt;<a href='/type/RestrictionReason'>RestrictionReason</a>&gt; 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>&lt;<a href='/type/Username'>Username</a>&gt; = <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>&lt;<a href='/type/User'>User</a>&gt; = <a href='/type/AttachMenuBotsBot'>AttachMenuBotsBot</a>;
<a href='/constructor/attachMenuBot'>attachMenuBot</a>#c8aa2cd2 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> bot_id:<a href='/type/long'>long</a> short_name:<a href='/type/string'>string</a> peer_types:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/AttachMenuPeerType'>AttachMenuPeerType</a>&gt; icons:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/AttachMenuBotIcon'>AttachMenuBotIcon</a>&gt; = <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>&lt;<a href='/type/AttachMenuBotIconColor'>AttachMenuBotIconColor</a>&gt; = <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>&lt;<a href='/type/AttachMenuBot'>AttachMenuBot</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; = <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 menu entry that can be added to the attachment menu. </p>
<p>Use <a href="/method/messages.getAttachMenuBot">messages.getAttachMenuBot</a> to get info about the attachment menu entry of a given bot, see the <a href="/constructor/attachMenuBot">attachMenuBot constructor page for more info »</a>.</p>
<p>The installed attachment 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 menu of a given bot.<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 menu entries.<br>
The attachment menu list should also be refreshed if the user changes the app's language in the settings. </p>
<p>Once an attachment 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 menu entry should open the related <a href="/api/bots/webapps#normal-web-apps">bot web app</a>, see <a href="/api/bots/webapps#normal-web-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-menu-links">attachment menu deep links</a>.</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>