When you’re thinking on how to create a Telegram bot, start with this idea – it can be divided into two main parts: the technical creation or ‘birth’ of the bot itself, and then – the implementation of its logic. In this article, we will describe those steps.

The creation of a bot in Telegram is as follows:

  • Create the “entity” of the bot
  • Connect it to some bot management service/bot builder (or write your own)
  • Implement the logic of the bot in that service/builder

We suggest that you START FROM THE END, and there is a good reason for this. Technically it’s easy to make a bot (after reading this article, you’ll do it in 5 minutes). But first – it is important to think of the logic of the bot, and perhaps – plan for the possible future – that is, consider what features in general you’re going to need some day. This depends on what bot builder you choose, or maybe you decide to order a completely custom solution development.

Any subsequent moves from one platform to the other will then be significantly complicated, especially if you already have an accumulated base of bot subscribers.

What is a bot’s ‘logic’?

It is what a bot does in what cases. For example, a person enters a Telegram bot, clicks the “Start” button – what should the bot do in response? Message what? Show the buttons? What buttons? What happens when the user clicks one of them? etc etc

You can draw it even with arrows on the paper, but you should have a rough idea how/when bot should respond on what.

Choosing a bot builder

All bot management services (bot builders) are different, somewhere you can implement something, somewhere you cannot. You have to start from what you want the bot to do (the logic of operation). DETAILS are also important.

This is important! After creating a bot, any subsequent “move” to another designer / another bot control system is a huge amount of work and time, the possible loss of some of the functionality that you are used to, so it is extremely important to decide on this “for a long time”.

Example: do you want the bot to address a person by their name (which they have in their messenger)? Some bots don’t know how to do that. This limits your choices.

Let’s go a little further – what if the person’s messenger name is “Elina’s Hairdresser”? (such cases are by no means uncommon). Do you want to be able to edit it somehow, to address him as “Ivan”? That further limits your choices. Or just decide not to mess with names then? Resolve these questions before choosing a bot builder.

What is important to consider when choosing a bot builder service

Which social networks/messengers the bot should support. Yes, this article is about Telegram – but still. Before you create a bot in Telegram, you need to decide whether you want or want the bot to work in other social media/messengers as well in the near future. Keeping a “zoo” of different systems – like here we have a bot for Telegram, here we have a bot for Facebook, and here – for Whatsapp – is very difficult for someone who will support it – you or your social media person.

What functions you want the bot to have (determined from the logic of the bot). Write out straight for example “I want it to be possible for the bot to ask the person what their name is, wait for input, and put what the person entered – in the “name” field, and use that in the future”. Write out all such nuances.

Consider the following functionality:

  • Working with bot subscriber names: are they picked up, can you edit?
  • Work with comments – do you want the bot to respond to comments on social networks? The vast majority of constructors are tuned ONLY to work with messages (private). If you need to work with comments, it limits you very much.
  • Do you need integration with CRM, which one?
  • The ability to export dialogs or data from the bot to calculate statistics. For example, how many people in the last month answered yes or no to the question “did you like it here today”.
  • The ability to respond to the bot in different ways depending on the time. This is very useful for making an “auto-responder” for cases when employees are not online.
  • Allowing the bot to randomly respond with one of several options. This creates some illusion of human communication and makes your bot less “wooden”.

The usability of the bot builder itself. This can only be determined by trying it out. Believe me, it’s not all that obvious. There are proven visual solutions in the form of blocks and arrows, which are more or less understandable to people, but even this does not work for everyone and not equally convenient. And in some bot builders, the settings are just so weirdly organized that only the creator can figure them out.

The quality of support service. This is often forgotten, but it comes up in the most critical moments. Something stopped working, you don’t understand why and support doesn’t answer. It’s a living hell. Take advantage of the test periods in your several bot builders you’ve selected to test and ask questions of support, see how they respond.

How to create a Telegram bot (give it a ‘birth’) via BotFather

In Telegram bots are created via internal bot called BotFather.

  1. Open Telegram and using internal search, find BotFather bot – it will be with blue mark, showing that it’s official.
  2. Click Start at the bottom of the screen to start working with this bot (just like any other)
  3. Enter /newbot command to create a new bot.
  4. BotFather will ask you to create a name and ‘handle’ which is like internal name for bots.
  5. After it is done, BotFather will show you the bot token – a special long-form password which will be needed later. Be careful not to spread it around. Anyone who has this token – can manage your bot!
  6. Also, in BotFather you can upload avatar for your bot (typically your company logo, or you can be more creative).

Connecting your bot to bot builder

After you have created your bot, the next step is to connect it to the bot management service or bot builder.

You can order such a system from freelance programmers, but it will be very expensive, and only big companies can afford such custom solutions.

In addition, in many cases – it makes no sense, because there are a huge number of different services for managing bots, which implement the basic functions that may be needed for normal business. But if you want something extrta-ordinary, you’re going to have to go to an individual bot developer.

Connecting to a bot builder is usually not difficult. This will allow you to define the logic of the bot and configure its functionality.

In this article, we will consider an example using the Chotam service.

  • Register on the Chotam website.
  • In the main menu, find the “My Sources” section and select “Add Source” – Telegram – bot.
  • Enter your bot token that you got from @BotFather and click “Start”.
  • Now you can start setting up your bot’s logic. In Chotam you can create different blocks with messages and buttons, as well as set up automatic responses to certain commands or messages from users. These settings are made in the “Bots” section of your project settings. No programming knowledge is required, everything is done in the form of visual blocks with conditions, messages, buttons, and stretching arrows between them.
  • After you set up all the necessary blocks, don’t forget to save the changes. The screenshot below shows an example of setting up a bot in the Chotam visual builder.

Building a bot in a bot builder

And now you can build your bot, using features provided by bot builder – like for example on the screenshot below. This is a typical flow to address ‘hi’ from a bot user.

how to create a telegram bot


Building a bot, implementing its logic is a whole topic in itself, for more articles, so please check our blog.

Creating a bot in Telegram is an interesting and fascinating process that opens up great opportunities for interaction with users and automation of various processes. We hope that this article will help you take the first steps towards creating your own bot.