Skip to content
OrqLabs
Mesajlaşma & Chatbot

Creating a Telegram Bot: Step-by-Step Guide with BotFather

Learn how to create a Telegram bot with BotFather, get your API token, and configure basic settings step-by-step for beginners.

OrqLabs TeamPublished:6 min readTürkçe oku(Türkçe)
Abstract robot and key illustration symbolizing the Telegram bot creation process
Contents
  1. What is BotFather and Why Do You Need It?
  2. Creating a Telegram Bot Step-by-Step
  3. Bot Name and Username Rules
  4. What is a Token and How to Keep It Secure?
  5. After Creating Your Bot: Configuration and Integration
  6. Basic Setup vs. Developer Setup Comparison
  7. Key Takeaways
  8. Conclusion
  9. Frequently asked questions
  10. Sources

The easiest way to create a Telegram bot is to send the /newbot command to BotFather, Telegram's official bot, and then set a name, username, and API token. In this guide, we walk you through the steps of creating a bot with BotFather, securely storing your token, and making your bot ready to use. You can get started without writing any code, and later you can transition to programming if you want to develop your bot further.

What is BotFather and Why Do You Need It?

BotFather is an official Telegram bot used to create and manage Telegram bots (TeknoTower). All administrative tasks—such as opening a new bot, changing an existing bot's name, adding a profile picture, or renewing a token—are performed through BotFather. In other words, it's the only official gateway to bot creation in the Telegram ecosystem; you don't need any third-party tools.

To reach BotFather, simply type "BotFather" in the search box of the Telegram app or open the link telegram.me/BotFather directly. When you start the bot, you'll see a command list that covers all operations—creating, editing, and deleting bots.

Practical tip: We recommend storing your token in a secure note app or password manager.

Creating a Telegram Bot Step-by-Step

The bot creation process typically takes seven simple steps for beginners (Tutkit). Here's a practical summary of these steps:

  1. Open the Telegram app and type "BotFather" in the search bar.
  2. Start the BotFather chat and send the /start command.
  3. Type the /newbot command to create a new bot (TeknoTower).
  4. Set a display name for your bot (this name doesn't need to be unique).
  5. Set a username for your bot; this must be unique and end with "bot".
  6. BotFather sends you an API token; copy and save it in a secure location.
  7. If desired, customize your bot's profile with commands like /setdescription, /setabouttext, or /setuserpic.

For example, an e-commerce company could create a bot named "My Store Support Bot" to check order status, with the username mystoresupport_bot. The display name can align with marketing language on the visible side, while the username remains technical and fixed.

Bot Name and Username Rules

When creating a bot, you'll encounter two different fields: display name and username. The display name is the title that users will see on the chat screen and doesn't need to be unique (TeknoTower). For example, multiple people can use the name "Support Bot".

The username is different: it must be unique across Telegram and must always end with "bot". For example, usernames like ordertracking_bot or OrqlabsSupportBot are valid. If the username you enter is already taken by someone else, BotFather will notify you immediately and suggest alternatives.

As a tip, choosing a username that matches your brand and is memorable will make it easier to share your bot and create referral links. Selecting a username aligned with your brand and easy to remember simplifies bot sharing.

What is a Token and How to Keep It Secure?

A token is a unique authentication string that verifies your bot through the Bot API (Telegram Bots Tutorial). An example token looks like this: 4839574812:AAFD39kkdpWt3ywyRZergyOLMaJhac60qc (Telegram Bots Tutorial). This string is used to authenticate your bot in API requests.

Locked key card illustration symbolizing Telegram bot token security
Your bot token should be kept secure like a password.

Your token should be treated like a password and never shared with anyone (Telegram Bots Tutorial). Uploading your token to a code repository (such as a public GitHub repo) could result in your bot being compromised. If you think your token is leaked, you can revoke it at any time through BotFather and create a new one.

Practical advice: Store your token as an environment variable, not directly in your code. If you need to share it within your team, using an encrypted password manager enhances security.

After Creating Your Bot: Configuration and Integration

Once your bot is created, it's time to configure it. With BotFather commands, you can add a description to your bot (/setdescription), a profile picture (/setuserpic), and a command list (/setcommands). When adding your bot as an admin to a channel, you need to grant the necessary permissions; otherwise, the bot won't be able to send messages or manage members in the channel (Tutkit).

To have real interaction with your bot, you use the Telegram Bot API. This API is software that provides JSON-encoded responses through HTTPS requests (Telegram Bots Tutorial). For simple tests, you can send HTTPS requests directly through your browser to check if the API is working (Telegram Bots Tutorial).

For those who want to code, libraries like telegram-bot-api can be used in a Node.js environment to communicate with the bot (TeknoTower). Similar libraries are available for Python, PHP, and other languages; your choice of language depends on your team's existing infrastructure. For more complex scenarios—such as lead generation or automated response workflows—evaluating no-code automation platforms is also an option; at this point, it's helpful to check out how AI agents are used in marketing.

Basic Setup vs. Developer Setup Comparison

The table below compares two fundamental approaches you can follow when setting up a Telegram bot:

FeatureBasic Setup with BotFather OnlyDeveloper Setup with Code/API
Required knowledgeBasic Telegram usageProgramming (Node.js, Python, etc.)
Setup timeA few simple stepsCoding and testing required
CustomizationName, description, profile pictureCommand logic, auto-responses, integrations
Suitable forSimple announcement/info botsOrder tracking, support bots, CRM integration
MaintenanceLowCode updates and server maintenance required

Source: TeknoTower, Telegram Bots Tutorial

Small businesses typically start with basic setup and enrich the bot with developer support as needs grow. If you want to follow a similar progression on WhatsApp, check out our WhatsApp business account setup guide.

Key Takeaways

  • BotFather is the only official way to create a Telegram bot; the process starts with the /newbot command.
  • A bot username must be unique and must end with "bot"; the display name, however, doesn't require uniqueness.
  • A token is a critical piece of information that authenticates your bot; it should be treated like a password, never shared, and can be revoked through BotFather if needed.
  • The Bot API provides JSON responses over HTTPS; simple tests can even be done through your browser.
  • Basic setup doesn't require coding knowledge; for advanced automation, libraries in languages like Node.js can be used.

Conclusion

Creating a Telegram bot with BotFather is a straightforward process that can be completed in just a few steps, even for users with minimal technical knowledge. By following the steps in this guide—from selecting your name and username to securing your token—you can get your bot ready for use. If you want to integrate your bot into a broader marketing workflow for customer support, lead generation, or social media announcements, explore OrqLabs' no-code automation tools to discover how to integrate your Telegram bot with your other channels.

Frequently asked questions

What command is used in BotFather to create a Telegram bot?

To create a new bot, you send the /newbot command in the BotFather chat. After this command, BotFather will ask you for the bot's name and username in sequence, and once the process is complete, it will provide you with an API token.

How should a bot username be set and how should it end?

The username must be unique across Telegram and must always end with the letters 'bot', for example siparistakip_bot. The display name, however, doesn't require uniqueness and can be chosen freely.

What is a Telegram Bot Token and how should it be kept secure?

A token is a unique authentication string that verifies your bot through the API and should be treated like a password. You should never share it with anyone, shouldn't upload it to code repositories, and should revoke it and get a new one through BotFather if you suspect it's been compromised.

Which programming languages can be used in Telegram Bot setup?

Since the Telegram Bot API provides JSON responses over HTTPS, it can be used with practically any programming language. Libraries like telegram-bot-api are commonly used in Node.js environments, while similar libraries are available for Python and PHP.

What should be done after creating a bot with BotFather?

You should store your token in a secure location, and if desired, customize your bot's profile using commands like /setdescription and /setuserpic. You should also properly grant admin permissions when adding your bot to a channel.

How do you communicate with the Telegram Bot API?

The Telegram Bot API is software that provides JSON-encoded responses through HTTPS requests. For a simple test, you can send an HTTPS request directly through your browser to check if the API responds.

Sources

Sources used while preparing this article.

  1. 10 Dakikada Telegram Botu Nasıl Oluşturulur? | TeknoTowerteknotower.com
  2. From BotFather to 'Hello World'core.telegram.org
  3. Telegram Botu kurulumu: Yeni başlayanlar için kapsamlı bir kılavuztutkit.com

Tags

  • #Telegram Bot
  • #BotFather
  • #Chatbot Setup
  • #Messaging Automation

Share

All articles →