Your First Telegram Bot

Your First Telegram Bot

Ever wanted to create your own Telegram-based bot application? Here’s where your first step should begin.

Telegram describes themselves as a cloud-based mobile and desktop messaging app with a focus on security and speed. For these reasons, they are loved (and hated at the same time) by the users around the world. Another reasons why Telegram has so many users is because the capability to create robot using their service.

Robot (or usually just called bot) is a computer program that works automatically. Depending on the bot’s purpose, they can perform many tasks like web crawling, chatting, traffic monitoring, etc. In fact, bots are getting smarter everyday and getting better at performing our routine tasks. It underlies a saying that robots will take over our jobs within several years. Artificial Intelligence, machine learning and natural language processing are some popular terms that are closely related to this area and many scientists are competing in this area.

But that’s not what we will discuss in this article.

I am planning to write articles that utilize Telegram bot, and I’ll put a link to this article in case you are still wondering how to create one, so I don’t have to rewrite the guide everytime I write those kind of articles. Let’s begin!

Talk to the mighty one, the BotFather!

As you can read in the description, BotFather is the one bot to rule them all. Use it to create new bot accounts and manage your existing bots. BotFather is the only thing you need to create Telegram bots.

You can find him by searching BotFather in the search bar or by clicking this URL: t.me/BotFather

First thing to do (if you have never chat with BotFather before) is tapping the “Start” button. It will initiate /start command.

The bot will respond immediately with available commands and you can start sending commands.

Here are the full commands list, followed by the steps of how to create a Telegram bot.

Available commands for [BotFather](https://t.me/BotFather) Available commands for BotFather

  1. /newbot send this command to begin creating bot. You will be asked to give a name to your soon-to-be bot. Just reply with your desired name, for example we’re creating a bot named “Hey Medium!

  2. Next, you will be asked to give it a username. Please remember that the username should end with bot. I gave this bot HeyMediumBot as its username.

  3. Congratulations! Your first Telegram bot has been created! You can find your bot by typing its username in search bar or by following a link in this format: http://t.me/YourBotUsername.

BotFather will give you a bot token to be used in your application. Please keep the token secret for yourself so nobody can control your bot. The token looks like this:

123456789:some_random_generated_alphanumeric_HdjU8371JHnwu7

Customizing your bot

After you work with your bot for some time, you might feel that your bot is hollow. There’s no profile picture nor any text explaining what your bot able to do. Just come back to BotFather and send these commands:

  1. /setname to change your bot’s name.

  2. /setdescription to change your bot’s description. This is what written when someone open chat with your bot for the first time.

  3. /setabouttext to change your bot’s about info. This is shown either in the about page or in the link preview/description when we share the bot’s public link.

  4. /setuserpic to change the bot’s profile picture.

  5. /setcommands if you want to add a specific command for your bot.

  6. /deletebot if you’re get betrayed by your own bot, nothing better than a high five. With a chair. In the face.

That’s all! If you managed to finally create your own bot application, I presume that you already understand how to work with BotFather. If you still don’t, you can read the online documentation.

Next, I want to hear your story of your Telegram bot project!


This story is imported from my Medium; and the featured image in this post is edited using my Spotify Photo Filter which you can use for free from my Mini Product.