# Working with bots


Working with bots, using the MTProto API.

See [here](/bots.md) for more info about bots.  

Please note that you can also use the simplified [HTTP Bot API](/bots/api.md) to use bots, see [here for more info&nbsp;&raquo;](/bots.md).

### Login

    ---functions---

    auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization;

In order to log in as a bot, instead of using the [standard login code flow](/api/auth.md), simply provide the [bot token](/bots.md#how-do-i-create-a-bot) generated by [@botfather](https://t.me/botfather).  
You must still provide your [API ID](/api/obtaining_api_id.md#obtaining-api-id), as per user logins.  

After successful authorization, you will be able to use [most MTProto API methods](/methods.md), just as any normal user.  
Methods that can be called by bots will have a **Both users and bots can use this method** or **Only bots can use this method** notice.  

### [Managed bots](/api/bots/managed-bots.md)

Users can create **managed** bots (which are controlled by a specific manager bot) directly through the MTProto API, without interacting with [@BotFather](https://t.me/botfather).

### [AI features](/api/bots/ai.md)

Telegram bots offer a number of features for AI chatbots.

### [Edit bot information&nbsp;&raquo;](/api/bots/info.md)

Users can edit and localize the profile picture, name, about text and description of bots they own; the same can be done by the bots themselves.  

### [Commands&nbsp;&raquo;](/api/bots/commands.md)

[Bots](/bots.md) offer a set of commands that can be used by users in private, or in a chat.  

### [Buttons&nbsp;&raquo;](/api/bots/buttons.md)

Users can interact with your bot via **buttons** or even **inline buttons**, straight from inline **messages** in **any** chat.  

### [Menu button&nbsp;&raquo;](/api/bots/menu.md)

Bots can choose the behavior of the menu button shown next to the text input field.  

### [Suggested bot admin rights&nbsp;&raquo;](/api/rights.md#suggested-bot-rights)

Bots can suggest a set of admin rights when being added to groups and channels.

### [Inline queries&nbsp;&raquo;](/api/bots/inline.md)

Users can interact with your bot via **inline queries**, straight from the **text input field** in **any** chat.  

### [Guest mode&nbsp;&raquo;](/api/bots/guest-mode.md)

Guest bots can be queried by username from **any** non-secret chat, posting their results into the chat on behalf of the user that invoked them.  

### [Bot-to-bot communication&nbsp;&raquo;](/api/bots/bot-to-bot.md)

Bots may receive and send messages to and from other bots in groups, private chats and chats, if Bot-to-Bot Communication Mode is enabled.

### [Games&nbsp;&raquo;](/api/bots/games.md)

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.

### [Web apps&nbsp;&raquo;](/api/bots/webapps.md)

Bots can offer users interactive [HTML5 web apps](/bots/webapps.md) to completely replace **any website**.  

#### [Affiliate programs](/api/bots/referrals.md)

Developers can open affiliate programs for their [mini app](/api/bots/webapps.md) – allowing **content creators**, other **mini app developers** and **any Telegram user** to promote it and earn commissions on purchases made by people they referred.

### [Attachment menu&nbsp;&raquo;](/api/bots/attach.md)

Bots can install attachment menu entries, offering conveniently accessible, versatile web apps.

### [Business bots&nbsp;&raquo;](/api/bots/connected-business-bots.md)

Users can connect Telegram bots that will process and answer messages **on their behalf**. This allows them to **seamlessly integrate** any existing tools and workflows, or add **AI assistants** that manage their chats.  

### [Bot API dialog IDs](/api/bots/ids.md)

How to convert MTProto peer IDs to bot API dialog IDs and vice versa.

### [Third-party verification](/api/bots/verification.md)

To further improve transparency on Telegram, **official third-party services** are able to assign **extra verification icons** to user accounts and chats — in order to **prevent scams** and **reduce misinformation**.
