How to Get a Telegram Bot Token
Step-by-step guide to creating a Telegram bot and obtaining your bot token using BotFather. Essential for OpenClaw and OpenClaw Telegram integration.
What is a Bot Token?
A Telegram bot token is a unique identifier that authenticates your bot with Telegram's API. It looks like:
123456789:ABCdefGHIjklMNOpqrsTUVwxyz
You need this token to connect OpenClaw or OpenClaw to Telegram.
Step 1: Find BotFather
- Open Telegram (mobile or desktop)
- Search for
@BotFather - Look for the verified account with blue checkmark
- Click "Start" to begin
Step 2: Create New Bot
Send the command:
/newbot
BotFather will ask for:
Bot Name (Display Name)
This is what users see. Examples:
- "My AI Assistant"
- "Support Helper Bot"
- "Community Chat Bot"
Bot Username
Must be unique and end in bot. Examples:
MyAIAssistant_botCommunityHelper_botSupport_ai_bot
Tips:
- Keep it short and memorable
- Avoid special characters (only letters, numbers, underscore)
- Check availability before committing
Step 3: Get Your Token
After successful creation, BotFather sends:
Done! Congratulations on your new bot. You will find it at t.me/YourBot_bot.
Use this token to access the HTTP API:
123456789:ABCdefGHIjklMNOpqrsTUVwxyz
Keep your token secure and store it safely.
Copy this token immediately! You'll need it for your bot configuration.
Step 4: Configure Your Bot (Optional)
While in BotFather, set up your bot profile:
Set Description
/setdescription
Brief text shown when users discover your bot.
Set About
/setabouttext
Shown in the bot's profile.
Set Profile Picture
/setuserpic
Send an image to use as avatar.
Set Commands
/setcommands
Define available commands:
start - Start the bot
help - Get help information
settings - Open settings
Privacy Settings
/setprivacy
- Enabled (default): Bot only sees messages starting with
/in groups - Disabled: Bot sees all messages in groups (required for AI bots)
For OpenClaw/OpenClaw, disable privacy mode.
Using Your Token
With OpenClaw
nano /opt/openclaw/.env
Add:
TELEGRAM_ENABLED=true
TELEGRAM_TOKEN=123456789:ABCdefGHIjklMNOpqrsTUVwxyz
With OpenClaw
nano /opt/openclaw/.env
Add:
TELEGRAM_ENABLED=true
TELEGRAM_BOT_TOKEN=123456789:ABCdefGHIjklMNOpqrsTUVwxyz
Token Security
Do's
- Store in environment variables
- Keep backups in secure location
- Use
.gitignoreto exclude.envfiles - Rotate if compromised
Don'ts
- Never commit tokens to Git
- Don't share publicly
- Avoid sending in unencrypted messages
- Don't reuse across unrelated projects
Regenerating Tokens
If your token is compromised:
- Message BotFather
- Send
/revoke - Select the bot
- Get new token
- Update your configuration
- Restart your bot
Old token stops working immediately.
Multiple Bots
You can create multiple bots with different tokens:
/newbot
Each bot has a unique token. Useful for:
- Separate development/production bots
- Different communities
- Testing purposes
BotFather Commands Reference
| Command | Description |
|---------|-------------|
| /newbot | Create new bot |
| /mybots | List your bots |
| /setname | Change display name |
| /setdescription | Set description |
| /setabouttext | Set about text |
| /setuserpic | Set profile picture |
| /setcommands | Set command list |
| /deletebot | Delete a bot |
| /revoke | Regenerate token |
| /setprivacy | Toggle privacy mode |
Troubleshooting
"Username is already taken"
Try variations:
- Add numbers:
MyBot123_bot - Add underscores:
My_AI_Bot - Try different names
Token not working
- Check for extra spaces when copying
- Ensure complete token (includes
:and everything after) - Try regenerating with
/revoke
Bot not responding in groups
- Disable privacy mode:
/setprivacy→ Disable - Make bot admin in group
- Check your bot configuration
Next Steps
Now that you have your token:
Need Help?
Our setup service handles complete Telegram bot configuration with UK-based support.
Need a VPS for Your Bot?
We recommend Hostinger KVM 2 VPS - reliable, fast, and perfect for AI chatbots. Get started with our recommended setup.
Get Hostinger VPSNeed Help With Setup?
Got your VPS? Let us handle the technical work. Professional setup and maintenance for OpenClaw (formerly Clawd.bot).