<p>Howdy! This text assumes that you‘re familiar with Telegram’s bot platform.<br>If this is not the case, kindly check out our <ahref="/bots"><strong>Introduction to Bots</strong></a>.</p>
<p>Today we‘re introducing the biggest change to Telegram’s Bot Platform since June 2015. These new tools will help you create fluid and intuitive interfaces for your bots. And bots are becoming a lot more capable. They can now send any type of content supported on Telegram, provide location-based services and integrate with other services deeply based on users' phone numbers.</p>
<p>If you'd like a more concise changelog, you can find one in the <ahref="/bots/api#recent-changes"><strong>Bot API Manual</strong></a>.</p>
<p>To begin with, we're adding a new type of keyboard that is integrated directly into the message it belongs to. Inline keyboards are available for messages sent both in chat mode and inline mode.</p>
<p>Unlike with custom reply keyboards, pressing buttons on inline keyboards doesn't result in messages sent to the chat. Instead, inline keyboards support buttons that work behind the scenes: <ahref="#callback-buttons">callback buttons</a>, <ahref="#url-buttons">URL buttons</a> and <ahref="#switch-to-inline-buttons">switch to inline buttons</a>.</p>
<p>When a user presses a <strong>callback button</strong>, no messages are sent to the chat. Instead, your bot simply receives the relevant query. Upon receiving the query, your bot can display some <ahref="/bots/api#answercallbackquery">result in a notification</a> at the top of the chat screen or in an alert.</p>
<ahref="/file/811140423/1/6BVlO7dWPeo/64d0d842ff73ff3dc8"target="_blank"><imgsrc="/file/811140423/1/6BVlO7dWPeo/64d0d842ff73ff3dc8"title="Notification at the top"style="width:295px; padding:10px 20px"/></a></center><br>
<p><strong>Sample bot</strong><br><ahref="https://telegram.me/music">@music</a>– This sample music bot uses inline callback buttons to flip pages and reload random results.</p>
<p>Buttons of this type have a small arrow icon to help the user understand that tapping on a <strong>URL button</strong> will open an external link. Naturally, we'll show them a confirmation alert before opening the link in the browser.</p>
<h4><aclass="anchor"name="switch-to-inline-buttons"href="#switch-to-inline-buttons"><iclass="anchor-icon"></i></a>Switch to Inline buttons</h4>
<p>Pressing a switch to inline button prompts the user to select a chat, opens it and inserts the bot's username into the input field. You can also pass a query that will be inserted along with the username – this way your users will immediately get some inline results they can share.</p>
<p><strong>Sample bot</strong><br><ahref="https://telegram.me/sticker">@sticker</a>– This sticker search bot offers a <ahref="#switch-to-inline-buttons">‘switch to inline’ button</a> to teach users how to use it in inline mode. </p>
<p>Since inline keyboards don‘t send additional messages to the chat, it made sense to give bots a way of manipulating their existing messages, so that they don’t have to send a new message each time they need to update something. This helps reduce clutter and build more fluid interfaces.</p>
<p><strong>Sample bot</strong><br><ahref="https://telegram.me/music">@music</a>– Watch how the music bot updates its messages with search results when you press the navigation buttons.</p>
<h3><aclass="anchor"name="locations-and-numbers"href="#locations-and-numbers"><iclass="anchor-icon"></i></a>Locations and Numbers</h3>
<p>Some bots need extra data from the user to work properly. For example, knowing the user‘s location helps provide more relevant geo-specific results. The user’s phone number can be very useful for integrations with other services, like banks, etc.</p>
<p>We've added an easy way for bots to ask the user for their <strong>location</strong> and <strong>phone number</strong> using special buttons. Note that both phone number and location request buttons will only work in private chats.</p>
<ahref="/file/811140587/2/jaowDLZg2l0/5ba3f7d7fd5c6c28dc"target="_blank"><imgsrc="/file/811140587/2/jaowDLZg2l0/5ba3f7d7fd5c6c28dc"title="Phone number and location sharing buttons"style="width: 295px; padding: 10px 20px;"/></a></center><br>
<p><ahref="/bots/api#keyboardbutton">Manual: Number and location buttons »</a></p>
</blockquote>
<p>Inline bots can also request location data from their users. Use the <code>/setinlinegeo</code> command with <ahref="https://telegram.me/botfather">@BotFather</a> to enable this. Your bot will ask the user for permission to access their location whenever they send an inline request.</p>
<p><strong>Sample bot</strong><br><ahref="https://telegram.me/foursquare">@foursquare</a>– This bot will ask for permission to access the user's location, then provide geo-targeted results.</p>
<p>Inline bots now support <strong>all types of content</strong> available in Telegram (19 in all), they are now capable of sending stickers, videos, music, locations, documents and more. </p>
<p><strong>Sample bots</strong><br><ahref="https://telegram.me/sticker">@sticker</a>– This sticker bot will accept one or more emoji and search for relevant stickers.<br><ahref="https://telegram.me/music">@music</a>– The music bot allows users to send mp3 tracks from a database of public domain classical music.</p>
<h4><aclass="anchor"name="switching-between-inline-mode-and-private-chat"href="#switching-between-inline-mode-and-private-chat"><iclass="anchor-icon"></i></a>Switching between inline mode and private chat</h4>
<p>Some inline bots can benefit from an initial setup process, like connecting them to an account on an external service (e.g., YouTube). We've added an easy way of switching between the private chat with a bot and whatever chat the user wants to share inline results in.</p>
<p>You can now display a special ‘Switch to PM’ button above the inline results (or instead of them). This button will open a private chat with the bot and pass a parameter of your choosing, so that you can prompt the user for the relevant setup actions. Once done, you can use an inline keyboard with a <ahref="/bots/api#inlinekeyboardmarkup"><em>switch_inline_query</em></a> button to send the user back to the original chat. </p>
<p><strong>Sample bots</strong><br><ahref="https://telegram.me/youtube">@youtube</a>– Shows a ‘Sign in to YouTube’ button, then suggests personalized results.</p>
<p>Since sending content via inline bots works differently from sending ordinary messages, we‘ve changed the interface a little. There’s hardly a more effective way of explaining that there‘s no need to hit ’Send':</p>
<p>As a dessert, we‘re beginning to roll out tools that will allow you to create bot solutions for group admins. As the first step, we’ve added methods to remove members from groups and supergroups.</p>
<p>And that's about it for now. Stay tuned for more updates and subscribe to our official <ahref="https://telegram.me/botnews">@Botnews</a> channel on Telegram.</p>