Bots

Working with bots, using the MTProto API.

See here for more info about bots.

Please note that you can also use the simplified HTTP Bot API to use bots, see here for more info ».

Login

---functions---

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

In order to login as a bot, instead of using the standard login code flow, simply provide the bot token generated by @botfather.
You must still provide your API ID, as per user logins.

After successful authorization, you will be able to use most MTProto API methods, just as any normal user.
Methods that can be called by bots will have a Bots can use this method notice.

Commands

Bots offer a set of commands that can be used by users in private, or in a chat.

Buttons

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

Inline queries

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

Games

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.

Ir arriba