Skip to main content

Connecting to Telegram

Before your bot can work, you need to connect it to Telegram using a Bot Token. This guide walks you through the process.


What is a Bot Token?

A bot token is like a password that lets BotGami control your Telegram bot. It's a long string that looks like this:

123456789:ABCdefGhIJKlmnopQRSTuvwxyz12345
Keep It Secret!

Your bot token is private. Never share it publicly or commit it to public code repositories. Anyone with your token can control your bot.


Creating a New Bot on Telegram

Step 1: Open BotFather

  1. Open Telegram (on your phone or desktop)
  2. Search for @BotFather
  3. Start a conversation by clicking Start

BotFather is Telegram's official bot for creating and managing bots.


Step 2: Create Your Bot

  1. Send the command: /newbot
  2. BotFather will ask for a name — this is the display name users see (e.g., "My Awesome Bot")
  3. Then it asks for a username — this must end in "bot" (e.g., "my_awesome_bot" or "MyAwesomeBot")

Step 3: Get Your Token

After creating the bot, BotFather will send you a message containing your bot token. It looks like:

Done! Congratulations on your new bot. You will find it at t.me/MyAwesomeBot.

Use this token to access the HTTP API:
123456789:ABCdefGhIJKlmnopQRSTuvwxyz12345

Copy the token — you'll need it in the next step.


Adding the Token to BotGami

  1. Open BotGami
  2. Go to your bot's Settings (gear icon)
  3. Find the Bot Token field
  4. Paste your token
  5. Click Save

That's it! Your bot is now connected to Telegram.


Testing the Connection

To verify everything works:

  1. Open Telegram
  2. Search for your bot by its @username
  3. Click Start
  4. If your bot has a /start command set up, you should see a response!

Troubleshooting

"Invalid Token" Error

  • Make sure you copied the entire token, including any numbers before the colon
  • Check that there are no extra spaces at the beginning or end
  • Try generating a new token (see below)

Regenerating a Token

If your token is compromised or not working:

  1. Go back to @BotFather
  2. Send /mybots
  3. Select your bot
  4. Choose API TokenRevoke current token
  5. Copy the new token and update it in BotGami
Token Changed?

Each time you revoke and generate a new token, you must update it in BotGami for your bot to continue working.


Next Steps

Now that your bot is connected: