Skip to content
Try Free →

Telegram bot setup via BotFather

Last updated: · 3 min read

Why Telegram

Three patterns where Telegram fits:

  1. International audience. Telegram is dominant in Eastern Europe, Iran, parts of Southeast Asia, and growing in India. About 950 million monthly active users globally.
  2. Group support. Add the bot to a Telegram group; group members can /ask it. Works for community-driven products.
  3. Free messaging. Unlike WhatsApp, Telegram doesn't charge per message. Useful for high-volume B2C support.

Trade-off: Telegram has lower per-user trust than WhatsApp in some markets. Pick the channel matching your audience.

What BotFather is

BotFather is Telegram's official bot for creating other bots. You message it; it issues you a bot token. Standard onboarding tool for all Telegram bots.

Find it at @BotFather in any Telegram client (mobile, desktop, web).

Setup walkthrough

About 10 minutes:

Step 1: open BotFather

In Telegram, search for @BotFather. Click "Start" or send /start.

You'll see a list of bot management commands.

Step 2: create a new bot

Send /newbot.

BotFather asks for:

  1. Display name. What users see (e.g., "Acme Support"). Can include spaces, emoji, special characters.
  2. Username. Must end in bot, lowercase, 5-32 characters (e.g., acme_support_bot).

If the username is taken, BotFather asks for another. Pick something unique.

Step 3: copy the bot token

BotFather replies with the token, looking like:

1234567890:AAEhBP0av54bSeJ4-ZuPe_a8eXJSL7Z9OsM

Copy it. Keep it secret; this token grants full bot control. Never check it into git or share publicly.

Step 4: paste into AskVault

In your dashboard:

  1. Open Deploy Hub > Telegram > Connect.
  2. Paste the bot token.
  3. Click "Verify & Connect".

AskVault sets the webhook URL automatically (pointing at https://api.askvault.co/api/telegram/webhook). You should see "Connected" within 30 seconds.

Step 5: test

Open Telegram, search your bot's username (e.g., @acme_support_bot), click Start.

Send "hello" or any question your knowledge base covers. Bot replies within 2 seconds.

Configuring bot settings

Optional but recommended via BotFather:

/setdescription · Short description users see before clicking Start.

"Get instant answers to your Acme account questions. Powered by AskVault."

/setabouttext · Longer about text on the bot's profile.

/setuserpic · Profile picture (your company logo).

/setcommands · Custom slash commands users see in the menu:

help - Show how to use this bot
ask - Ask a question
escalate - Talk to a human agent
status - Check order status

AskVault syncs the command list from your Telegram skill triggers. Customize under Deploy Hub > Telegram > Commands.

Privacy mode

Telegram bots have a "privacy mode" toggle:

  • Privacy mode ON (default). Bot only sees messages addressed to it directly or via slash commands. Good for noisy group chats.
  • Privacy mode OFF. Bot sees every message in groups it's in. Useful when the bot should listen for keywords across all messages.

Set via BotFather: /setprivacy then pick your bot, then Enable or Disable.

For AskVault, privacy mode ON is the default. Change only if you have a specific need.

Adding the bot to groups

Two patterns:

Group chat support. Add the bot to a group. Members can mention @your_bot_name [question] or use slash commands. Useful for community Q&A.

Direct messages. Users DM the bot directly. Typical 1:1 support flow.

Both work; combine as needed.

Webhook configuration

AskVault sets the webhook automatically. For debugging:

Get current webhook info:

Terminal window
curl https://api.telegram.org/bot{your_token}/getWebhookInfo

Manually set webhook:

Terminal window
curl -X POST https://api.telegram.org/bot{your_token}/setWebhook \
-d "url=https://api.askvault.co/api/telegram/webhook"

If the webhook gets de-synced (rare), use the manual command to restore.

Bot token security

The token is sensitive:

  • Never commit to git. Use environment variables.
  • Rotate if leaked. BotFather > /revoke to invalidate the old token; /token to get a new one.
  • AskVault stores it encrypted at rest. Never logged or exposed in error messages.

Rotation takes about 60 seconds. Update AskVault with the new token immediately to avoid downtime.

Common pitfalls

Bot doesn't respond. Webhook not set correctly. Run /setwebhook manually or click "Re-verify" in AskVault.

Bot responds in groups but not DMs. Privacy mode flipped. Check via BotFather /setprivacy.

Slash commands don't autocomplete. Command list not registered. Set via BotFather /setcommands or sync from AskVault dashboard.

"Conflict" error. Two bots or two AskVault workspaces both registered the same token. Revoke the duplicate webhook.

Bot management commands (BotFather)

Common commands to remember:

  • /mybots · list your bots and pick one to manage.
  • /setname · change display name.
  • /setdescription · change description.
  • /setcommands · set slash command list.
  • /setprivacy · toggle privacy mode.
  • /revoke · invalidate the current token.
  • /token · get the current token (or a new one after revoke).
  • /deletebot · delete the bot entirely.

Every command works on any bot you own.

Planned features (on the roadmap)

Documented for accuracy:

  • Inline mode. Today, AskVault handles standard message and slash commands. Telegram inline-bot mode (e.g., typing @your_bot query in any chat) planned.
  • Voice message handling. Today, text-only. Voice transcription planned.
  • Stickers and rich media. Today, AskVault sends text and links. Stickers, custom media planned.

Limits

  • Bots per Telegram account. 20 (Telegram limit).
  • Bots per AskVault workspace. No hard cap; one common per workspace.
  • Messages per second. Telegram allows 30 messages per second per bot.
  • Message length. 4,096 characters; AskVault splits longer responses.

FAQ

Is Telegram free?

Yes. Telegram doesn't charge for bot messages. No per-message cost like WhatsApp.

Can I use the same bot for multiple workspaces?

No. One Telegram bot maps to one AskVault workspace. Create separate bots for separate workspaces.

What if my bot username is taken?

Pick another. Telegram bot usernames must be unique globally and end in bot.

Can users send images or files to my bot?

Yes for inbound. The bot can receive images, files, voice messages. AskVault stores them in the conversation history. Voice transcription is planned.

Can I migrate from another Telegram bot platform?

Yes. Revoke the old platform's webhook, set AskVault's webhook via BotFather, paste the same token into AskVault. Existing user conversations continue.

Was this page helpful?