Creating a Telegram bot with BotFather is the first step when you want to connect Telegram to WordPress, an automation platform, a custom application or your own backend.
BotFather is Telegram’s official bot for creating and managing other bots. It lets you register a new bot account, choose its public name and username, generate the authentication token used by the Telegram Bot API and configure several public and technical settings.
Creating the bot itself only takes a few minutes. The important part is understanding what BotFather actually creates, what the generated token is used for and how to protect it.
In this guide, we will create a Telegram bot from scratch, configure its basic profile, test the Bot API connection and look at the settings you are likely to use when connecting the bot to another application.
What is BotFather?
BotFather is Telegram’s official tool for creating and managing bot accounts.
You interact with it like any other Telegram conversation, but instead of ordinary messaging it provides commands and controls for bot administration.
BotFather can be used to:
- create a new Telegram bot;
- generate an API token;
- change the bot’s display name;
- edit its description and profile information;
- upload a profile picture;
- configure supported commands;
- control whether the bot can join groups;
- configure group privacy behavior;
- enable inline mode;
- generate a new token when necessary;
- delete a bot.
For most integrations, the two most important things BotFather gives you are the bot account itself and its authentication token.
What is a Telegram bot?
A Telegram bot is a special Telegram account controlled by software rather than by a person manually typing every message.
A bot can receive updates from Telegram and use the Telegram Bot API to perform actions such as:
- send text messages;
- send images and documents;
- receive commands;
- respond to users;
- send notifications to groups or channels;
- provide interactive buttons;
- integrate with external applications;
- trigger automated workflows.
BotFather creates and configures the Telegram identity of the bot. It does not automatically create the application logic behind it.
If you want the bot to respond to commands, read data from WordPress or perform automated actions, you still need software that communicates with the Telegram Bot API.
What do you need before creating a Telegram bot?
You need a normal Telegram account to create a bot through BotFather.
Before starting, it is useful to decide:
- what the bot will be used for;
- what its public display name should be;
- what username you want;
- which application will use the bot token;
- where the token will be stored securely.
The display name and username are different, so it helps to plan both before creating the bot.
How to open BotFather
Open Telegram and search for:
@BotFather
Make sure you are interacting with the official BotFather account.
Open the conversation and press Start if you have never used it before.
You can then enter BotFather commands directly in the chat.
How to create a Telegram bot with BotFather
The basic creation process is straightforward.
Step 1: Send the /newbot command
In the BotFather conversation, send:
/newbot
BotFather will begin the bot creation process and ask you to choose a name.
Step 2: Choose the bot’s display name
The display name is the human-readable name users see when they interact with the bot.
For example:
TheOneWP Notifications
or:
Website Support Assistant
The display name does not have to be identical to the bot username.
You can choose something descriptive and readable because this is the public-facing name users are likely to notice first.
Step 3: Choose a bot username
BotFather will then ask you to choose a username.
A Telegram bot username must end in:
bot
For example:
TheOneWPBot
theonewp_notifications_bot
WebsiteAlertsBot
The username is used in Telegram search, mentions and direct links to the bot.
A bot username must be unique. If another Telegram account already uses the name you choose, BotFather will ask you to try another one.
Bot display name vs bot username
The display name and username serve different purposes.
For example:
Display name:
TheOneWP Notifications
Username:
TheOneWPNotificationsBot
The display name is the readable label shown to users.
The username is the unique Telegram identifier used for search, mentions and bot links.
A direct bot link may therefore look like:
https://t.me/TheOneWPNotificationsBot
It is worth choosing the username carefully because it becomes part of how users and integrations reference the bot.
Telegram bot username requirements
BotFather applies specific rules to bot usernames.
The username:
- must be between 5 and 32 characters long;
- can use Latin letters;
- can use numbers;
- can use underscores;
- is not case sensitive;
- must end in
bot.
Examples of valid-style usernames include:
StoreAlertsBot
store_alerts_bot
WPNotifyBot
If BotFather rejects your username, check the format first and then verify whether the name is already in use.
Step 4: Copy the bot token
Once the bot is created successfully, BotFather generates an authentication token.
It will look similar to:
1234567890:AAExampleTokenThatMustRemainPrivate
This token is one of the most important values in the entire setup.
Your application uses it to authenticate requests sent to the Telegram Bot API as your bot.
Conceptually, the token proves:
This request is authorized to act as this Telegram bot.
Treat your Telegram bot token like a password
Do not expose the token publicly.
Anyone who obtains a valid bot token may be able to use the Telegram Bot API as that bot.
Do not place the token in:
- public Git repositories;
- frontend JavaScript;
- HTML source code;
- public screenshots;
- forum posts;
- documentation examples;
- ordinary team chat messages;
- unprotected text files.
Server-side applications should store the token in a protected configuration mechanism.
For example, a custom application may store it as an environment variable:
TELEGRAM_BOT_TOKEN=your_token_here
The exact storage method depends on your application, but the token should never be treated like a harmless public identifier.
What does the Telegram bot token do?
The token is used when sending requests to the Telegram Bot API.
The basic API URL structure is:
https://api.telegram.org/botBOT_TOKEN/METHOD_NAME
For example, to retrieve basic information about the bot, you can use the getMe method:
https://api.telegram.org/botBOT_TOKEN/getMe
Replace:
BOT_TOKEN
with the real token generated by BotFather.
The official Telegram Bot API documentation describes this request format and the available methods.
How to test your new Telegram bot token
A simple way to verify that the token works is to call the Telegram Bot API getMe method.
Open:
https://api.telegram.org/botYOUR_BOT_TOKEN/getMe
If the token is valid, Telegram should return JSON containing information about the bot.
A simplified response might look like:
{
"ok": true,
"result": {
"id": 1234567890,
"is_bot": true,
"first_name": "TheOneWP Notifications",
"username": "TheOneWPNotificationsBot"
}
}
The important part is:
"ok": true
This confirms that Telegram recognized the token and returned information about the corresponding bot.
Testing the Telegram bot token with curl
If you prefer working from the terminal, you can use curl:
curl "https://api.telegram.org/botYOUR_BOT_TOKEN/getMe"
A successful response should contain the bot information in JSON format.
Be careful when using commands containing real tokens because terminal history, screenshots or copied logs may expose them later.
Creating a bot does not make it respond automatically
After BotFather creates the account, you can open your new bot in Telegram and press Start.
However, the bot will not automatically understand messages simply because the Telegram account exists.
You still need an application that:
- receives updates from Telegram;
- examines incoming messages or commands;
- decides what should happen;
- sends a response through the Bot API when necessary.
This application could be:
- a WordPress plugin;
- a PHP application;
- a Laravel application;
- a Node.js application;
- a Python script;
- an automation platform;
- a custom backend service.
BotFather creates the identity. Your application supplies the behavior.
How Telegram bots receive messages
After the bot is connected to an application, incoming Telegram updates are normally received using one of two approaches:
getUpdatesusing long polling;- a webhook.
With long polling, your application repeatedly requests new updates from Telegram and waits for new events.
With a webhook, Telegram sends updates to an HTTPS endpoint configured by your application.
The official Bot API documents both getUpdates and webhook configuration.
You normally choose one approach based on the architecture of your integration.
How to open your new Telegram bot
Once BotFather creates the bot, you can open it through its username.
If the username is:
TheOneWPNotificationsBot
the direct link is:
https://t.me/TheOneWPNotificationsBot
Open that link in Telegram and press:
Start
This begins a private conversation between your Telegram account and the bot.
Starting the bot is especially useful when you later need to retrieve your private chat ID or inspect incoming updates.
How to configure your bot after creation
The initial /newbot process creates the account, but BotFather also provides several options for refining its public profile and behavior.
You can manage existing bots using:
/mybots
BotFather will show the bots associated with your account and provide controls for editing their settings.
Change the bot’s display name
The display name can be changed through BotFather’s bot management interface.
A good display name should clearly communicate what the bot represents.
For example:
Store Order Alerts
is more useful than:
Bot 3
especially once several bots begin occupying the same Telegram account like an increasingly questionable collection of digital pets.
Add a description to your Telegram bot
BotFather lets you define a longer description explaining what the bot does.
This description can appear when users first open the bot.
A simple description could be:
Receive automated WordPress notifications and website alerts through Telegram.
The description should explain the bot’s purpose without requiring users to guess what they have just opened.
Add an About text
Telegram bots can also have shorter profile information, often referred to as the About text.
BotFather provides:
/setabouttext
This short text appears in the bot’s profile and can provide a concise explanation of its role.
For example:
WordPress notifications and security alerts.
Add a profile picture
You can configure a profile image for the bot through BotFather.
A recognizable profile image makes the bot easier to identify in Telegram chats and is particularly useful when a team uses several automation bots.
Avoid using nearly identical profile images for unrelated bots if people need to distinguish them quickly.
Configure Telegram bot commands
BotFather lets you define a list of commands that users can see when interacting with your bot.
You can configure them using:
/setcommands
A command list could look like:
start - Start the bot
help - Show available help
status - Check service status
settings - Open bot settings
These command descriptions improve the Telegram interface, but your backend still needs to implement the behavior of each command.
Defining:
/status
in BotFather does not magically teach the bot what system status means. Somewhere, regrettably, code still has to exist.
What is the /start command?
The /start command is commonly the first command sent when a user begins interacting with a bot.
Your application can detect it and return a welcome message or perform initial setup.
For example, your application might respond with:
Welcome. This bot sends notifications from your WordPress website.
BotFather does not define the response. Your own bot logic does.
Can your Telegram bot join groups?
Telegram bots can be configured to participate in groups.
BotFather provides settings controlling whether a bot can be added to groups.
If your bot is designed only for private notifications, you may not need group access.
If it will send team alerts or respond to commands inside a group, group functionality may be required.
What is Telegram bot privacy mode?
When a bot participates in groups, privacy mode affects which group messages it receives.
With privacy mode enabled, a bot receives a limited subset of group messages relevant to it instead of every ordinary message in the conversation.
BotFather provides:
/setprivacy
Do not disable privacy mode automatically just because the option exists.
If your bot only needs commands or specific interactions, receiving every group message may provide no benefit and may expose more conversation data to the integration than necessary.
Telegram explains group privacy and other bot capabilities in the official Telegram Bot Features documentation.
How to find the bot token again
If you need to manage an existing bot, open BotFather and use:
/mybots
Select the relevant bot and open its token settings.
BotFather can generate a new authentication token when needed.
If an old token is replaced, applications still using the previous value must also be updated.
What if your Telegram bot token is exposed?
If the token becomes public or you suspect somebody else has obtained it, treat it as compromised.
Generate a new token through BotFather and update the applications that use the bot.
Do not simply delete a public Git commit and assume the token is safe again.
Credentials can remain in:
- Git history;
- cached pages;
- build logs;
- deployment logs;
- screenshots;
- third-party indexing systems.
Once a secret has escaped your control, rotation is safer than optimism.
How to generate a new Telegram bot token
BotFather provides token management for bots you own.
You can access the token controls through:
/mybots
and select the relevant bot.
After generating a new token, replace the old value everywhere your application uses it.
Test the integration afterward to confirm the bot can still communicate with Telegram correctly.
Do not hard-code the bot token in frontend JavaScript
A Telegram bot token should not be embedded in browser-side code.
For example, avoid code such as:
const botToken = "123456789:AASecretToken";
inside JavaScript delivered to website visitors.
Anyone can inspect frontend code through browser developer tools.
Requests using the bot token should normally be performed server-side.
Do not commit the bot token to Git
If you are developing a custom integration, keep the token outside version-controlled source code.
Instead of:
$token = '123456789:AASecretToken';
load it from protected configuration.
For example, an application might use:
TELEGRAM_BOT_TOKEN=...
in environment configuration excluded from the repository.
The exact implementation depends on the development stack, but the principle remains the same: code can be shared, credentials should not be.
How to create a separate Telegram bot for testing
If an existing bot is already used in production, creating a separate development bot can make testing safer.
Use BotFather and:
/newbot
to create another bot dedicated to development.
You can then use the test bot’s token in your local or staging application while keeping production messages untouched.
This prevents debugging experiments from suddenly appearing in a real customer channel, which tends to make software testing more socially interesting than necessary.
How to delete a Telegram bot
If a bot is no longer needed, BotFather provides:
/deletebot
Deleting a bot is a significant action and should not be used merely to temporarily disable an integration.
If the application is being retired, also remove or update any systems that still contain its token, chat ID or webhook configuration.
BotFather commands worth knowing
Some useful BotFather commands include:
/newbot
/mybots
/setname
/setdescription
/setabouttext
/setuserpic
/setcommands
/setjoingroups
/setprivacy
/setinline
/deletebot
The exact BotFather interface can evolve, so /mybots is usually the safest entry point for managing an existing bot.
For a simple notification bot, the most important steps are creating the bot, securing its token, configuring its profile and connecting the token to the application that sends messages.
How to find your Telegram chat ID after creating the bot
Creating the bot gives you the bot token, but many integrations also require a destination chat ID.
For example, a WordPress notification integration may require:
Bot Token
Chat ID
The token identifies and authenticates the bot.
The chat ID identifies the private chat, group or channel involved in the request.
To find the ID, start the bot or add it to the required group or channel and inspect the update data returned by Telegram.
For the complete process, see How to find a Telegram chat, group or channel ID.
Testing the bot with getUpdates
After opening the bot in Telegram and sending it a message, you can inspect incoming updates with:
https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates
A response may contain information about:
- the message;
- the user who sent it;
- the chat where it was sent;
- the message text;
- the update ID.
This is useful when building simple integrations or identifying chat IDs.
getUpdates vs webhook
A bot normally receives updates using either long polling through getUpdates or a webhook.
Long polling is convenient for development, command-line applications and services that continuously request updates from Telegram.
Webhooks are useful when a publicly reachable HTTPS endpoint should receive updates from Telegram as they occur.
While a webhook is configured for the bot, getUpdates cannot be used to retrieve updates.
Choose the mechanism that matches the architecture of your application rather than trying to operate both simultaneously.
Creating a Telegram bot for WordPress
Telegram bots are commonly used with WordPress to send automated notifications.
Possible examples include:
- new contact form submissions;
- WooCommerce orders;
- user registrations;
- security warnings;
- failed login notifications;
- backup reports;
- scheduled task results;
- custom administrative alerts.
A typical WordPress integration requires at least:
Telegram bot token
Telegram chat ID
Some integrations may also allow message formatting, event selection, notification rules or different destination chats.
TheOneWP also includes a Telegram User Access Notification feature for WordPress access-related notifications, which is an example of how a BotFather-created bot can become the delivery layer for application events.
Common BotFather mistakes
1. Choosing an invalid bot username
Remember that bot usernames must follow Telegram’s format and end in bot.
2. Confusing the display name with the username
The public display name can contain normal readable text, while the username is the unique Telegram identifier.
3. Publishing the API token
The token is a credential, not a public bot ID.
4. Expecting the bot to work without backend logic
BotFather creates the account but does not implement custom responses or application logic.
5. Putting the token in frontend code
Browser-delivered JavaScript cannot protect a secret token.
6. Using the production bot for every development test
A separate development bot can keep testing isolated from real users and notification channels.
7. Giving the bot unnecessary group access
Configure only the capabilities the bot actually needs.
8. Forgetting to rotate a compromised token
Once a secret is exposed, replacing it is safer than hoping nobody noticed.
Telegram bot creation checklist
- Open the official
@BotFatheraccount. - Send
/newbot. - Choose a clear display name.
- Choose a unique username ending in
bot. - Copy the generated API token.
- Store the token securely.
- Do not commit the token to Git.
- Do not expose the token in frontend code.
- Test the token using
getMe. - Open the new bot and press Start.
- Add a description and About text.
- Add a recognizable profile image if needed.
- Configure bot commands when appropriate.
- Review group and privacy settings.
- Create a separate testing bot for development when useful.
- Find the destination chat ID before configuring notifications.
- Rotate the token immediately if it is exposed.
Official Telegram Bot API documentation
Telegram maintains official documentation covering BotFather, bot configuration and the Bot API.
You can consult the Telegram Bot Features documentation for BotFather configuration options and the Telegram Bot API documentation for the available API methods.
Telegram also provides an official Telegram bot tutorial covering token creation and basic bot development.
Final thoughts on creating a Telegram bot with BotFather
Creating a Telegram bot with BotFather is only the first part of building a Telegram integration, but it establishes the account and credentials everything else depends on.
The process itself is simple: open BotFather, use /newbot, choose a display name and unique username, then securely save the generated API token.
After creation, test the token, configure the bot’s public information and decide how your application will receive updates and send messages.
Most importantly, protect the token as you would any other application credential. A beautifully configured Telegram bot with its token pasted into a public repository is less an integration and more an invitation.
Once the bot is created and the token is safely stored, the next practical step is usually identifying the private chat, group or channel where messages should be delivered.
For that step, continue with How to find a Telegram chat, group or channel ID.
From there, the bot can be connected to WordPress, a custom application or any other system capable of communicating with the Telegram Bot API.

