2022-02-24 19:51:11 +01:00
<!DOCTYPE html>
< html class = "" >
< head >
< meta charset = "utf-8" >
< title > Bots< / title >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
2022-11-15 00:55:37 +01:00
< meta property = "description" content = "Working with bots, using the MTProto API." >
2022-02-24 19:51:11 +01:00
< meta property = "og:title" content = "Bots" >
< meta property = "og:image" content = "" >
2022-11-15 00:55:37 +01:00
< meta property = "og:description" content = "Working with bots, using the MTProto API." >
2022-04-21 15:52:36 +02:00
< 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" / >
2022-02-24 19:51:11 +01:00
< link href = "/css/bootstrap.min.css?3" rel = "stylesheet" >
2022-11-21 13:10:26 +01:00
< link href = "/css/telegram.css?233" rel = "stylesheet" media = "screen" >
2022-02-24 19:51:11 +01:00
< 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" > Bots< / a > < / li > < / ul > < / div >
< h1 id = "dev_page_title" > Bots< / h1 >
< div id = "dev_page_content" > <!-- scroll_nav -->
< p > Working with bots, using the MTProto API.< / p >
< p > See < a href = "/bots" > here< / a > for more info about bots. < / p >
< p > Please note that you can also use the simplified < a href = "/bots/api" > HTTP Bot API< / a > to use bots, see < a href = "/bots" > here for more info »< / a > .< / p >
< h3 > < a class = "anchor" href = "#login" id = "login" name = "login" > < i class = "anchor-icon" > < / i > < / a > Login< / h3 >
< pre > < code > ---functions---
< a href = '/method/auth.importBotAuthorization' > auth.importBotAuthorization< / a > #67a3ff2c flags:< a href = '/type/int' > int< / a > api_id:< a href = '/type/int' > int< / a > api_hash:< a href = '/type/string' > string< / a > bot_auth_token:< a href = '/type/string' > string< / a > = < a href = '/type/auth.Authorization' > auth.Authorization< / a > ;< / code > < / pre >
< p > In order to login as a bot, instead of using the < a href = "/api/auth" > standard login code flow< / a > , simply provide the < a href = "/bots#creating-a-new-bot" > bot token< / a > generated by < a href = "https://t.me/botfather" > @botfather< / a > .< br >
You must still provide your < a href = "/api/obtaining_api_id#obtaining-api-id" > API ID< / a > , as per user logins. < / p >
< p > After successful authorization, you will be able to use < a href = "/methods" > most MTProto API methods< / a > , just as any normal user.< br >
Methods that can be called by bots will have a < strong > Bots can use this method< / strong > notice. < / p >
< h3 > < a class = "anchor" href = "#commands" id = "commands" name = "commands" > < i class = "anchor-icon" > < / i > < / a > < a href = "/api/bots/commands" > Commands< / a > < / h3 >
< p > < a href = "/bots" > Bots< / a > offer a set of commands that can be used by users in private, or in a chat. < / p >
< h3 > < a class = "anchor" href = "#buttons" id = "buttons" name = "buttons" > < i class = "anchor-icon" > < / i > < / a > < a href = "/api/bots/buttons" > Buttons< / a > < / h3 >
< p > Users can interact with your bot via < strong > buttons< / strong > or even < strong > inline buttons< / strong > , straight from inline < strong > messages< / strong > in < strong > any< / strong > chat. < / p >
2022-11-15 00:55:37 +01:00
< h3 > < a class = "anchor" href = "#menu-button" id = "menu-button" name = "menu-button" > < i class = "anchor-icon" > < / i > < / a > < a href = "/api/bots/menu" > Menu button< / a > < / h3 >
< p > Bots can choose the behavior of the menu button shown next to the text input field. < / p >
< h3 > < a class = "anchor" href = "#suggested-bot-admin-rights" id = "suggested-bot-admin-rights" name = "suggested-bot-admin-rights" > < i class = "anchor-icon" > < / i > < / a > < a href = "/api/rights#suggested-bot-rights" > Suggested bot admin rights< / a > < / h3 >
< p > Bots can suggest a set of admin rights when being added to groups and channels.< / p >
2022-02-24 19:51:11 +01:00
< h3 > < a class = "anchor" href = "#inline-queries" id = "inline-queries" name = "inline-queries" > < i class = "anchor-icon" > < / i > < / a > < a href = "/api/bots/inline" > Inline queries< / a > < / h3 >
< p > Users can interact with your bot via < strong > inline queries< / strong > , straight from the < strong > text input field< / strong > in < strong > any< / strong > chat. < / p >
< h3 > < a class = "anchor" href = "#games" id = "games" name = "games" > < i class = "anchor-icon" > < / i > < / a > < a href = "/api/bots/games" > Games< / a > < / h3 >
2022-11-15 00:55:37 +01:00
< p > Bots can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats; how to work with games in the MTProto API.< / p >
< h3 > < a class = "anchor" href = "#web-apps" id = "web-apps" name = "web-apps" > < i class = "anchor-icon" > < / i > < / a > < a href = "/api/bots/webapps" > Web apps< / a > < / h3 >
< p > Bots can offer users interactive < a href = "/bots/webapps" > HTML5 web apps< / a > to completely replace < strong > any website< / strong > . < / p >
< h3 > < a class = "anchor" href = "#attachment-menu" id = "attachment-menu" name = "attachment-menu" > < i class = "anchor-icon" > < / i > < / a > < a href = "/api/bots/attach" > Attachment menu< / a > < / h3 >
< p > Bots can install attachment menu entries, offering conveniently accessible, versatile web apps.< / p > < / div >
2022-02-24 19:51:11 +01:00
< / 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 >
2022-09-09 12:10:24 +02:00
< li > < a href = "//telegram.org/privacy" > Privacy< / a > < / li >
2022-09-09 23:58:59 +02:00
< li > < a href = "//telegram.org/press" > Press< / a > < / li >
2022-02-24 19:51:11 +01:00
< / 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 >
2022-09-09 23:58:59 +02:00
< li > < a href = "//telegram.org/android" > Android< / a > < / li >
< li > < a href = "//telegram.org/dl/web" > Mobile Web< / a > < / li >
2022-02-24 19:51:11 +01:00
< / 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 = "https://twitter.com/telegram" target = "_blank" data-track = "Follow/Twitter" onclick = "trackDlClick(this, event)" > Twitter< / a > < / h5 >
< / div >
< / div >
< / div >
< / div >
2022-04-19 13:29:30 +02:00
< script src = "/js/main.js?46" > < / script >
2022-02-24 19:51:11 +01:00
< script src = "/js/jquery.min.js?1" > < / script >
< script src = "/js/bootstrap.min.js?1" > < / script >
< script > w i n d o w . i n i t D e v P a g e N a v & & i n i t D e v P a g e N a v ( ) ;
backToTopInit("Go up");
removePreloadInit();
< / script >
< / body >
< / html >