How to Create a Custom Telegram Bot with BotFather and Get the API Token
This guide covers the full process of creating a bot in Telegram's BotFather, getting your API token safely, and connecting it to TwitGram so your crypto alerts route through your own dedicated delivery bot instead of the shared bot.
If you are here because TwitGram Bot prompted you to set up a custom bot, start at Step 1. If you want to understand why a custom bot matters before you set one up, read the section below first.
Why a Custom Bot?
Your custom bot handles outbound alerts to your DMs, groups, channels, and topic threads. The official TwitGram Bot bot handles commands and configuration. That separation matters when you are routing alerts to multiple destinations simultaneously, and it is the architecture TwitGram is built around.
What BotFather Is and What You Actually Get After /newbot
Official BotFather vs Fake Lookalikes
BotFather is Telegram's official bot creation interface. There is one official account: @BotFather.
Fake lookalikes exist and are designed to harvest your token the moment you paste it. Before interacting, verify both:
- Username is exactly
@BotFather, no extra letters, no underscores, no spaces - Blue verified checkmark from Telegram is present
Display Name vs Username (...bot) Explained
BotFather asks for two things when creating a new bot:
| Field | What it is | Rules |
|---|---|---|
| Display name | What appears in Telegram UI | No restrictions - any text |
| Username | How the bot is addressed via the API | Must be unique across Telegram; must end in bot |
The username must end in either bot or _bot (e.g., myalerts_bot). If your chosen username is already taken, BotFather rejects it and asks for another. Have two or three options ready before you start.
Token Format Basics: bot_id :secr.et
After successful creation, BotFather sends your API token in this format:
123456789:ABCDefGhIJKlmNoPQRsTUVwXYZ
- The number before the colon is your bot's unique ID
- The string after the colon is the secret
- There is always exactly one colon - if you see more, something went wrong in the copy
Step-by-Step: How to Create Your Telegram Bot and Get the API Token
Step 1: Open @BotFather and Run /newbot
- Open Telegram and search for
@BotFather. - Verify the blue checkmark. Open the chat.
- Send
/newbot.
BotFather responds with a prompt asking for your bot's display name.
Step 2: Choose a Bot Name and Unique Username
- Send your display name (example:
My Alert Bot). - Send your chosen username ending in
bot(example:myalerts_bot).
If the username is taken, BotFather returns an error. Try a variation with your initials, a number, or a secondary descriptor. This is normal.
Step 3: Copy and Store Your Token
- BotFather confirms creation and sends your token in the format
bot_id:secret. - Copy the entire token, including the numeric ID and the colon.
Do not screenshot it. Do not paste it into a Telegram chat to save it.
Step 4: Optional Settings: Description, Avatar
After storing your token, you can optionally configure the bot's appearance in BotFather:
/setdescription- adds a description shown when someone opens the bot/setuserpic- sets a profile image
For a delivery-only alert bot connected to TwitGram Bot, these are cosmetic and do not affect delivery performance. Skip them on first setup.
How to Add Your BotFather Token Inside TwitGram Bot (Official Custom Bot Flow)
Once you have created your bot with @BotFather and copied the API token, the next step is to connect it to TwitGram correctly.
In TwitGram Bot, this is done through the Configure Custom Bot flow inside the official bot UI.
1) Open the Official TwitGram Bot and Go to Configure Custom Bot
From the main interface, open the custom bot configuration option.
TwitGram will show a setup screen and a button to continue.
Important context:
- Your custom bot is used for alerts delivery.
- Core commands and workflow setup still run through the official TwitGram bot.
2) Start Token Input and Paste the Full BotFather Token
Tap Configure Custom Bot (or Update Bot Token if one is already connected).
TwitGram will prompt you to paste the token in standard format:
123456:ABCdef...
Paste the full token exactly as sent by BotFather.
3) Know the Entitlement Rule Before You Proceed
TwitGram checks plan eligibility during this flow.
Custom bot setup is available on all paid tiers. If you are on Free Trial, setup is blocked and you will be prompted to upgrade before activation.
4) First Setup vs Replacing an Existing Custom Bot
If this is your first custom bot, TwitGram saves it directly once validation passes.
If you already have a different bot connected, TwitGram stages a replacement and asks you to explicitly confirm:
- Confirm Replace to switch to the new bot
- Cancel to keep your current bot unchanged
This prevents accidental overwrite of a working delivery bot.
5) Complete the Critical Activation Step for DM Delivery
After a successful save/update, open your custom bot and tap Start.
This step is required for reliable DM alert/notification delivery via your custom bot context.
6) Verify Setup and Continue with Routing
After activation:
- Keep operating command/setup flows in official TwitGram.
- Use your custom bot delivery path for destination alerts (groups/channels/DM contexts).
- Run one live test alert to confirm your routing behaves as expected.
If you ever suspect token compromise, revoke it in BotFather and repeat this setup flow with the new token.
TwitGram-Specific Setup Best Practices for Crypto Teams
Keep Commands/Setup in the Official TwitGram Bot
The most common mistake is trying to run everything through the custom bot. The split is intentional:
- Official TwitGram bot - watchlists, filters, plan management, routing configuration
- Your custom bot - outbound alert delivery only
Do your watchlist setup, filter changes, and destination configuration inside the official bot. Let your custom bot do its one job.
Use Your Custom Bot for Destination-Specific Alert Delivery
What it does:
Routes all outbound alerts through your own dedicated Telegram bot instead of shared delivery infrastructure.
Why it matters:
You get a clean, uncontested delivery path on your own bot lane. Shared infrastructure congestion does not affect your alert timing. For a trader whose edge depends on catching moves in the first seconds, that separation is the whole point.
How to enable:
In TwitGram Bot, open Home, tap Configure Custom Bot, paste your BotFather token, complete validation, and tap Start in your custom bot.
Routing Strategy: DMs, Groups, Channels, and Topic Threads
Three common setups based on operator type:
Solo operator - Keep alerts to your private DM. Simple, fast, zero noise. Pair with tight whitelist filters so every alert is worth reading.
Alpha team - Route to a private group. Everyone sees the same alerts in real time. Set monitored accounts and filters around the signals your team actually acts on.
Trading desk - Route to separate channels or topic threads by signal type: Breaking News to one thread, KOLs tracking to another, Projects to a third. Use TwitGram's whitelist/blacklist filters to make routing surgical rather than high-volume.
Common Setup Issues and Fast Fixes
Invalid Token Format Errors
Symptom: TwitGram rejects the token immediately after pasting.
Cause: Truncated paste - the token was cut off before the full secret segment was copied.
Fix: Open @BotFather, send /token, select your bot, and copy the full string again. Verify there is exactly one colon and the segment before it is a number.
"Telegram Could Not Validate This Token."
Symptom: Token format passed,s but Telegram API validation fails.
Cause: The bot may have been deleted or the token revoked.
Fix: Open @BotFather, send /mybots, and confirm your bot still exists. If it does, use /token to get a fresh string. If the bot is gone, create a new one from Step 1.
Replacement Request Expired or Canceled
Symptom: You started a replacement flow, and it timed out, or you hit Cancel by mistake.
Fix: Restart the flow. Open TwitGram Bot, go to Configure Custom Bot, tap Update Bot Token, and paste the new token again. Previous expired or canceled replacements do not affect new attempts.
From Setup to Trade-Ready Signal Workflow
Your custom bot is connected. Now configure the signal layer that feeds it.
Build Your First Watchlist Around High-Impact Accounts
Start narrow. Add 5β10 accounts that consistently post actionable tweets - project devs, on-chain analysts, launchpad deployers, KOLs whose posts have historically preceded moves you cared about. Route this watchlist to your custom bot.
Getting in early is not about watching more accounts. It is about watching the right accounts with the right filters, getting the alert fast, and acting before the broader CT echo chamber catches up.
Add Whitelist/Blacklist Filters to Cut Noise
A raw feed from 10 active CT accounts is still noisy. Use TwitGram's keyword filters:
- Whitelist
0xto surface EVM contract drops across all monitored accounts - Whitelist
pumpto catch Pump.fun token references - Whitelist
presale,live,launchingfor event-driven signals - Blacklist
gm,giveaway,airdropto suppress low-signal noise
Pro Tip π‘: To catch Pump.fun token contracts on X, add
pumpto your whitelist β TwitGram filters alerts to only matchpumpin tweet content. Same approach for EVM addresses: add0xto surface contract drops across all monitored accounts.
Route Alerts by Use Case (Solo, Desk, Alpha Group)
Once your first watchlist is clean and custom bot delivery is confirmed, replicate the structure for other use cases:
| Use case | Destination | Notes |
|---|---|---|
| Solo position tracking | DM | Fastest, most private |
| Alpha group sharing | Private group | Shared real-time feed |
| Historical record | Private channel | Searchable archive |
Each watchlist gets its own destination. Your custom bot handles all of them through the same delivery lane.
Final Takeaway
You now have a dedicated delivery path for your crypto alerts - your own bot, your own lane, no shared congestion.
The setup takes under five minutes. The operational steps are:
- Create your bot in
@BotFatherand copy the token - Store the token securely
- Connect it in TwitGram via Configure Custom Bot
- Tap Start in your custom bot to activate DM delivery
- Build your first watchlist and run a live test
No API key. No X account connection. Telegram-first execution.
Start here: TwitGram Bot Β· twitgram.xyz