How to create a bot in Telegram yourself - step-by-step instructions in pictures. General points for setting up telegram bots What telegram bots write on

I decided to talk in more detail about one of the ways to create a bot in the messenger and share your personal experience of creating, designing and customizing.

Background of creation:

Since I am fond of playing Pokémon GO, choosing a theme was not difficult, all that remained was to choose exactly how I would create it. After surfing the Internet and realizing that I don’t havenoknowledge of programming came to the conclusion that I would use it completelyfree bot -

In order not to torment you in the dark about my successes over 3 months of work, here it is:

Creating a bot:

To begin with, I must definitely warn you about the limited functionality of the bot, which should be enough for you, but further expansion is possible through programming, which I did not resort to.

The process of creating a bot takes no more than one minute.

Stages:


The bot has been created, but it needs to be designed and configured.

Decor:

Everything is simple here too.To do this you need 4 commands:

  • /setuserpic- to change the bot’s avatar;
  • /setdescription- to change the text that users see before clicking Start;
  • /setabouttext- to change the text inside the bot profile;
  • /setname- to change the bot name;

We send all commands

If you still have difficulties, here is a video tutorial


Settings:

This section could be at timesmore, but I'll stick to the basics like creating teams, auto-posting, and forms.

First, I’ll explain why commands are needed. They are the basis of all bots. This is what they will look like:


They can also be called via “slash”.

Let's get started:

  1. In your bot’s menu, click on the command “ Custom Commands
  2. Select the section “ Create a team
  3. We send the team name, for example “ /photo" or " /sites
  4. Send the text and/or photo (the command can always be changed and deleted) and click save. Or select one of the following:

“Add a question” - in other words, a form. A form is a command within which there are questions.
When a user calls such a command, he is asked questions in order, and the answers are sent back to administrators.
Why are forms needed?

Bots are special Telegram accounts created to automatically process and send messages. Users can interact with bots using messages sent through regular or group chats. The bot logic is controlled using HTTPS requests to our bot API.

General information

What can bots do?

Here are some examples of using bots:

  • Integration with other services. For example, a bot can send comments or control a smart home. Or, for example, send you notifications when some action or event is performed (Examples: GitHub Bot, Image Bot).
  • Utilities and tools. The bot can display the weather, translate texts, or warn about upcoming events at your request (For example: poll bot).
  • Single and multiplayer games. The bot can play checkers or chess with you, conduct quizzes, and so on. (Example: Trivia bot).
  • Social services. The bot can find you a conversation partner based on your common interests and hobbies. (Example: HotOrBot).
  • Whatever you want. The bot can be programmed to do anything. Unless they can't wash the dishes.

How do bots work?

As mentioned earlier, robots are special accounts that do not require a phone number when created. Essentially, these accounts act as an interface to your service, which runs on a remote server.

The most interesting thing about robots is that to create them you do not need to learn low-level methods of working with MTProto and encryption - communication with the robot is organized using a regular HTTPS interface with simplified Telegram API methods. We called it Bot API.

How to create a bot?

For this there is... A bot. Just message @BotFather and follow his instructions. Once you've created your bot and received your authorization key (token), head to the Bot API documentation section to start setting up your bot.

How is a bot different from a regular account?

Super abilities

Telegram robots have many unique features - for example, additional interfaces for, and special ones for groups.

Inline mode

Users can chat with your bot directly from the message input field - from any chat or group. To do this, you just need to type your bot's username and search query. After receiving a request, the bot can return some results. As soon as the user clicks on one of them, he will immediately be sent to the chat. This way you can request content from the bot in chats, groups or channels.


Games

With the help of bots, users can play HTML5 games in groups or private chats. The Telegram gaming platform will help create a table of records and notify users about rating changes.



The games have HTML5 under the hood, so you can create games of any complexity. At the moment, the Telegram team has created several demo games:

Keyboards

One of the most unusual features of the Bot API is custom keyboards. When the server sends a response, it is possible to send a command to display a special keyboard with preset response options (see ReplyKeyboardMarkup). The Telegram client, upon receiving the message, will display your keyboard to the user. Pressing a key will immediately send the corresponding command to the server. In this way, the interaction between the robot and the user can be significantly simplified. Currently, emoji and text can be used to display on the key. Here are some examples of such keyboards:


For more information, see the description of the sendMessage method.

Teams

Commands are a more flexible way to communicate with a bot. The following syntax is recommended:

/command [optional] [argument]

The command must begin with a forward slash "/" and cannot be longer than 32 characters. Commands can consist of letters of the Latin alphabet, numbers and underscores. A few examples:

/get_messages_stats /set_timer 10min Alarm! /get_timezone London, UK

Messages starting with a slash will always be delivered to the bot (just like when replying to its messages and to bot mentions in chat). Telegram applications will:

If there are several bots in the group, you can add the bot's name after the command to avoid collisions in common commands:

/start@TriviaBot /start@ApocalypseBot

This happens automatically if you select a command from the list of available ones.

Global Teams

To make it easier for users to work with bots, we ask all developers to implement support for a few simple commands. The Telegram application interface will have shortcuts(quick links) for these commands.

When trying to start communicating with the robot, the user will see a button START. Links will also be available on the bot's profile page Help And Settings.

Privacy mode

Bots are often added to groups to receive various information - news, notifications, etc. However, when adding a bot, you probably asked yourself: “What if this little asshole forwards all group correspondence somewhere “to the left”?” This is why robots have privacy modes.

A robot with privacy mode enabled will not receive all messages, but only messages that meet these conditions:

This is a good thing on all sides: firstly, some people will sleep soundly (in their tin foil hats) without fear of being bugged. Secondly, privacy mode saves developers from having to process hundreds of unnecessary messages from group chats.

Privacy mode is enabled by default in all bots. It can be turned off - then the bot will start receiving all messages, like a regular user. All conference participants can see the current privacy mode status in the list of group participants.

We recommend turning off privacy mode only when absolutely necessary. In the vast majority of cases, requesting a forced response to a bot message will be sufficient.

External binding

Creating a token

If you have lost or lost access to a token, issue the /token command to generate a new one.

Settings

  • /setname- Change the robot's name.
  • /setdescription- Change description robot, which is a short text describing the bot. Users will see it at the very beginning, under the heading “What can this robot do?”
  • /setabouttext- Change information about the bot, even shorter text displayed in the bot’s profile. Also, if someone shares your bot, this text will be sent along with a link to it.
  • /setuserpic- Change the bot's avatar. Pictures are always good.
  • /setcommands- Change the list of bot commands. Each command consists of the command word itself, beginning with a forward slash ("/") and a short description. Users will see a list of commands when they enter the "/" character.
  • /setjoingroups- Determines whether your bot can be added to groups.
  • /setprivacy- Determines whether your bot sees all messages in groups. When turned off, all messages will be sent to the robot.
  • /deletebot- Delete the bot and its username.

Advice

Please keep in mind that it may take some time for the settings to take effect on the server.

Good afternoon everyone. Vasily Blinov is in touch again. Today you will learn how to create a bot in Telegram. I have written a lot about their useful functions, now the time has come to get your own assistant.

Telegram is now in great demand and its popularity is growing day by day. We will not leave bots for it without attention.

How are they useful?

Bots have become one of the main trends on Telegram. Let me remind you that they are robotic dialogues inside the messenger, capable of quickly solving many problems:

  • show news on a given topic,
  • find and download any information,
  • answer frequently asked questions,
  • send updates from the site,
  • replace or supplement email newsletters,
  • can conduct surveys
  • play with visitors, etc.

Thus, the user subscribes to topics that are relevant to him and quickly finds the information he needs, receiving an answer to his question from the bot.

Mine will allow you to get to know them better.

Creation methods

Write code with pens

To do this, you need to know programming languages ​​(Python, PHP or Java), and there are also a lot of nuances such as registration of hosting and other things. This can be a huge problem for some.

Fortunately, there is an easy way to make a bot for ordinary users who do not have programming skills.

Use a special service

Our savior is Manybot.io.

It was there that I found the Russian interface, clear instructions and the functionality I needed in the first stages. Robots on this platform can:

  • send messages to subscribers,
  • make beautiful menus,
  • carry out auto-posting from RSS of your resources.

Registration

First of all, let's open @Manybot in the messenger. Click the “Start” button.

Let's select Russian from the proposed list.

Click “Add new bot”.

We follow further instructions. We need to register with @BotFather.

Let's enter the command /newbot.

Coming up with a common and technical name with a tail bot. The most important thing is to remember to copy the received key-token.

Let's go back to Manybot and show it this code by clicking “I copied the token.”

Let's come up with a description.

Congratulations, registration is completed. Now you are the rightful owner of your own Telegram robot.

Settings

Let's start creating the menu and the first commands. To do this, you need to find your robot; to do this, enter its name in the search bar. I have this @iklife_bot.

Creating a simple command

The whole principle of bota is to answer human questions, so you need to write down commands and answers to them.

To do this, call the settings menu - /commands.

Enter the name of the command and the text that it will produce in response to a click on it.

We are waiting for a message about the successful creation of the team.

Making a menu

It is much more convenient when visitors can quickly select all commands directly from the menu. To create it, go back to /commands and then “Configure ch. menu".

Then “Add menu item”. We name it, select the previously created command.

The menu item is ready!

Let's check it out and see what happens. Everything is working. Other commands with menu items are created similarly.

Autoposting

The main advantage of @Manybot is the instant setup of auto-posting posts from a site with an RSS feed or from social media. networks, or YouTube directly into the chat. Thus, readers will always be aware of updates without leaving Telegram.

Let's launch it!

Enter /autoposting.

We are waiting for verification and a message about successful completion.

Now you will see my articles right inside @iklife_bot.

Conclusion

That's all, I hope this article will help you create your first bot. If you still know simple ways to create them, please share them in the comments.

Thank you for your attention!

Robots in Telegram are programs that automatically perform certain actions and respond to user commands. The messenger developers encourage their creation, which is why it is the leader in the number of robots. How to create a Telegram bot for your business or for regular use? Let's consider the possibilities and technologies.

Existing options

There are three ways to create a bot in Telegram:

  1. Create in the constructor. This could be another messenger service, for example @manybot. Or an online shell such as Chatfuel.
  2. Independent development. To do this, you must have skills in programming and deploying server applications, starting with installing the software.
  3. Purchase. Nowadays there are many companies and private developers offering customized products. Prices start at 500 rubles, but average 10-15 thousand.

If you have time and some software skills, we recommend trying to create it in the designer. This will help you understand how the programs function, which will be useful when ordering if you decide to do so.

Programming process

Many services are designed to simplify the online shopping process. The development uses Payment API methods, which allow you to link payment systems to the program. The process is carried out according to the algorithm:

  1. The developer embeds the keys and selects a provider connected to the system to perform transactions.
  2. The “Pay” button appears in the bot.
  3. The robot user can make payments by providing their details. They are linked to his account. Mobile payments have also become available.
  4. Financial transactions are carried out directly between the client and the payment system. Telegram is not involved in this process. Its task is to provide a platform for implementing functions. Due to this, payment data is not available to third parties.
  5. The customer receives a transaction report that includes all purchase details.

At the same time, the messenger developers do not accept any claims, shifting all responsibility to the payment system and the user himself.

But they promise to block unreliable providers based on reviews. Today you can create a bot in Telegram to sell for Qiwi and Yandex.Money.

Create a bot yourself

The Telegram interlocutor simulator is a program that launches and works on your side. It sends requests to the Telegram Bot API, which is quite simple:

  • The program accesses the set parameters by reference;
  • Telegram responds with a JSON array.

In Telegram, instead of manually uploading messages, you can install a webhook so that they send each letter themselves. To create a Telegram bot in Python, it is better to use some kind of reactor, for example, tornado.web.

Before you create a telegram bot and launch it, you need to go to the desired address and catch the output signal. This is done in order to return the behavior of manually unloading events.

The logic will be in the tornado.web.RequestHandler class, which the reactor accepts to process requests.

CMD stands for a dictionary of all available commands. Send_reply is the function for sending a reply. It accepts a ready-made Message array.

Teams

First you need to teach the Telegram bot program the /start and /help constants:

The message['from'] object is an array of type User. From it the bot receives user data, his ID and name. It will be better if the response function belongs to message['chat']['id']. So when communicating there will be a User, and in the case of a chat - the id of the latter.

The /start installation has two functions at once:

A command without parameters is needed to display data about the bot;
with parameters – for identification.

Now you can create any custom task. For example, /base64.

For those who use mobile Telegram, it will be useful to give @BotFather a list of commands that the new virtual interlocutor should accept:

If a Telegram user wants to see a list of available tasks (for example, to find out how to kill a program after completing a task), he will need to write “/”.

How to teach a bot to speak

Telegram sends the entire message. The restriction on the need to precede commands with a slash was created only for the convenience of users. This allows you to teach the program to respond like a human being. In order to give her the opportunity to receive all messages in groups, you need to write /setprivacy to the @BotFather assistant, thus disabling privacy.

You should add a handler to Handler:

The list of commands should include speech:

The value of 75 here represents the probability of what the user wants to say. The format_map constant is convenient for describing strings that require substitution.

This way the bot will be able to respond to greetings and address the interlocutor by name.

Sent messages can be not only text

Now that you know how to create a telegram bot, you can make it possible not only to write phrases, but also to share images and audio files.

For example, you can expand the RESPONSES dictionary like this.

Everyone knows Pavel Durov, the creator of the social network VKontakte. In 2013, after the sale of the previous project, he and his team founded the Telegram messenger. Using this portal you can read books, download music, check the weather, encrypt data, and so on. Telegram has many other useful functions.

Advantages of Telegram over other instant messengers

What is good about the project and how to make a bot in Telegram? First of all, the social network is multi-platform. It is unlikely that you will find another free, high-quality messenger and even without advertising on absolutely all platforms. It is much more convenient and practical than browser portals.

Recently, one of the features of this messenger is the creation of personal bots. What it is? How to make a bot in Telegram without programming skills? Why are they even needed? This and much more will be discussed in this article.

Telegram bots

Bots in Telegram are a kind of chat bot, but in the form of a registered user. These users' names end with the word bot. They are capable of performing various actions. Wide multifunctionality in competent hands will greatly simplify the life of other users.

How to start communicating with bots?

It's very easy to get started. After finding the desired bot, launch it. The bot number in Telegram differs depending on the functions. The virtual keyboard below will help you do this. After this, the bot sends a list of information and commands available to it.

Creating a bot without programming skills

How to make a bot in Telegram? In just five minutes after reading the creation instructions, you can repeat the process and create your own, even without programming skills:

  1. In your browser you should find the site manybot, which allows you to create your own bot for free.
  2. On the site you will see a large button: “Create a bot”.
  3. Then you need to click “Open Telegram” a little lower.
  4. Next, you need to register in the messenger.
  5. When you log into Telegram, you will see two windows: Chats and New message. Under the name of the second window in the search bar, type Botfather.
  6. Click on the found bot. You have entered the chat, under which there is a Start button, you need to press it.
  7. To create a new bot, write to the chat /newbot, after which the interlocutor will respond with a request to come up with a name for the new assistant. For example, let's call the bot Nonprog.
  8. After this, you are asked to come up with a nickname for your bot, which must end in bot. It will look like this: Nonprogbot.
  9. After the above operations, the interlocutor will send a token. It will look something like this: 493493:AAEOrog63 (this is the bot’s number in Telegram, but you can find it later using a different number). This line needs to be copied to the clipboard with the mouse or the hot keys Ctrl+C.
  10. In the search bar, enter the phrase manybot, followed by /Addbot, and then /start.
  11. A new bot begins a dialogue with you. After reading his message, click the button at the bottom “Add a new bot”. He will send instructions, the response to which will be the “I copied the token” button.
  12. Paste the token.
  13. Next, you can come up with a description for your bot, or you can do it later by clicking the “Skip” button.
  14. Returning to the window with the search line, enter the name of your assistant in it. If everything is correct, then the creation of the bot in Telegram is completed. Go into dialogue with him and activate him with the Start button.

This fairly detailed instruction is guaranteed to help you create a bot and start interacting with it. It is also possible to create additional functions by recording the names of commands and responses to these requests.

If everything is more or less clear about how to create a bot in Telegram, then the question can then be considered from a more relevant point of view, namely from the side of earnings.

Is it possible to make money from bots?

Today, Telegram is progressing very quickly, surpassing its competitors. So, it is logical to assume that the value of bots is also increasing. Unfortunately, you are unlikely to find an easy way to make money by creating bots. This requires knowledge of programming. What is earnings?

Creation and sale of bots for companies

How to create a bot in Telegram for sales? This topic is not widely popular yet, so by creating bots for different companies, you can easily hit the jackpot. If you learn to program well, many company owners will notice you and become interested in it.

How to make a bot in Telegram? If you are a beginner, then try to take programming courses, because without it it will be very difficult for you.

It may be strange to hear this, but messengers will soon become more popular than social networks, because it is much more convenient to go into a chat and give a command than to waste time on not always convenient applications. Here are some interesting bots in Telegram:

  1. Weathermen - this great bot will replace all weather widgets and applications for you. Despite up-to-date information reports for five days in advance, this bot automatically notifies you about weather conditions, you just need to write which day you are interested in.
  2. Mycoocbot will replace the collection of food recipes. Just write down the ingredients you have in your refrigerator and get several dinner options.
  3. To PDF is a bot with a narrow specialization. It converts documents into PDF files. It’s a small thing, but it’s nice; you don’t have to look for special services on the Internet, which are also mostly paid.
  4. Pronunciationbot is an indispensable friend when learning foreign languages. Don't know what the correct English word is? Just enter it and the bot will send you a voiceover. Supports many languages.
  5. YouTube Downloader is a chat bot with which you can download any video from YouTube. There are already many ways to do this on the Internet, but why bother if there is such a bot. Just enter the video link and it will send you download links in different formats.

Useful bots for business and work

Telegram bots are not just for entertainment. Many of them will help in business, study and work:

  1. RussionPost is perhaps one of the most non-standard bots, since through it you can communicate with Russian Post employees. Forget about different email applications and clients. This bot will replace them all.
  2. Exchange Rates bot is a very useful bot in the accounting field. It allows you to monitor exchange rates and transfer different amounts from one currency to another. Provides extensive information, including graphs.
  3. Taxigram is a chatbot that will help you order a taxi or find out where you can do it. Several companies are currently operating this service, but soon your taxi will definitely get there. Just enter point A and point B, after which the bot will send you a photo of the map with your route.
  4. Yandeks is one of the most powerful bots. It has a very wide functionality, from reading books to searching for specific information. In addition, this bot displays news in many areas of life.
  5. SberBank - there is no need to say much about this assistant. The official bot of Sberbank, with which you can carry out all operations by sending messages to the chat. It will certainly be useful to many entrepreneurs.