> ## Documentation Index
> Fetch the complete documentation index at: https://docs.olanna.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Telegram

By the end of this, messages people send you on Telegram will land in Olanna. Your agent will answer them.

This is the easiest channel to connect. There is no Meta account, nothing to approve, and no waiting. Here is the whole job:

1. Make a Telegram bot.
2. Copy two things from Telegram into Olanna.

Set aside about 5 minutes.

### **Before you start**

You need Telegram. It is free. You can use the app on your phone, or go to web.telegram.org on a computer. If you do not have an account, signing up takes a minute and only needs your phone number.

### **What a Telegram bot is**

On Telegram, customers cannot message a business directly. They message a bot.

A bot is a Telegram account that no person types into. A program answers instead. In your case that program is Olanna, so your agent does the talking. To your customer it looks and works like any other Telegram chat.

You make the bot once, using Telegram's own bot-making assistant. It is called BotFather.

### **Part 1: Make your bot**

<Steps>
  <Step title="Search for BotFather">
    Open Telegram. In the search bar at the top, type `BotFather`.
  </Step>

  <Step title="Open the real one">
    Tap the result with the blue tick beside it. The tick means it is the real one. There are copies pretending to be it.

    <Frame caption="The blue tick is how you know it is the real BotFather.">
      <img src="https://mintlify.s3.us-west-1.amazonaws.com/olanna/images/telegram/01-botfather-search.png" alt="Telegram search results showing the official BotFather account with its verified badge" />
    </Frame>
  </Step>

  <Step title="Start the chat">
    Tap **Start**, or type `/start`.
  </Step>

  <Step title="Ask for a new bot">
    Type `/newbot` and send it.
  </Step>

  <Step title="Give your bot a name">
    This is what customers see at the top of the chat, like "Willow Spa". Type it and send.
  </Step>

  <Step title="Give it a username">
    This one has to be different from every other bot on Telegram, and it has to end in the word `bot`. Something like `WillowSpa_bot`. If it is taken, BotFather tells you and you try another.

    <Frame caption="BotFather asks for the name first, then the username.">
      <img src="https://mintlify.s3.us-west-1.amazonaws.com/olanna/images/telegram/02-newbot-chat.png" alt="The BotFather conversation showing the newbot command, name entry and username entry" />
    </Frame>
  </Step>

  <Step title="Copy down your token">
    BotFather replies with a long line of letters and numbers. That is your bot token. Note it down along with the username you just chose, with no `@` in front of it.

    <Frame caption="The token is the long line after your bot is made.">
      <img src="https://mintlify.s3.us-west-1.amazonaws.com/olanna/images/telegram/03-bot-token.png" alt="BotFather's success message showing the bot token" />
    </Frame>

    <Warning>
      Keep this token private. Anyone who has it can control your bot and read its messages. Do not share it or post it anywhere public. If you think someone else has seen it, send BotFather `/revoke` for that bot and make a new one.
    </Warning>
  </Step>
</Steps>

```text theme={null}
Bot username:   (with no @ in front)
Bot token:      (the long line BotFather gave you)
```

### **Part 2: Paste it into Olanna**

<Steps>
  <Step title="Open Channels">
    In Olanna, choose **Channels** in the left menu.
  </Step>

  <Step title="Choose Connect on the Telegram row">
    A form opens with two boxes.
  </Step>

  <Step title="Type in your bot username">
    With no `@` in front of it.
  </Step>

  <Step title="Paste in your bot token">
    Exactly as BotFather gave it to you.
  </Step>

  <Step title="Choose Install">
    <Frame caption="Two boxes. That is the whole form.">
      <img src="https://mintlify.s3.us-west-1.amazonaws.com/olanna/images/telegram/04-olanna-connect-form.png" alt="Olanna's Telegram connect form with the bot username and token filled in" />
    </Frame>
  </Step>
</Steps>

That is the setup finished. In the next couple of seconds Olanna asks Telegram to confirm the token is real and belongs to that username, then tells Telegram where to send your messages.

Other channels make you do that last part by hand. Telegram lets Olanna do it for you, which is why this guide is short.

Telegram then shows as **Active** in your connected apps. If something is wrong, the message tells you what. Troubleshooting is at the bottom of this page.

### **Part 3: Test it**

<Steps>
  <Step title="Open a chat with your bot">
    On Telegram, search for your bot's username.
  </Step>

  <Step title="Start it and send a message">
    Tap **Start**, then send any short message.
  </Step>

  <Step title="Check your Olanna inbox">
    It should be there within a few seconds.
  </Step>
</Steps>

### **Questions**

<AccordionGroup>
  <Accordion title="Do I need a paid or business Telegram account?">
    No. Any free Telegram account can make bots through BotFather.
  </Accordion>

  <Accordion title="Can I use a bot I already made for something else?">
    Yes, as long as you have its username and token. Be aware that connecting it to Olanna changes where its messages go. If something else is already using that bot, it will stop working.
  </Accordion>

  <Accordion title="What if I lose my bot token?">
    Message BotFather again. Send `/mybots`, pick your bot, then choose **API Token** to see it. You can also choose **Revoke current token** to make a brand new one, but then you have to update it in Olanna.
  </Accordion>

  <Accordion title="Can I change my bot's name later?">
    Yes, through BotFather, using `/setname` and `/setusername`. If you change the username, update it in Olanna too so the two match.
  </Accordion>
</AccordionGroup>

### **Troubleshooting**

<AccordionGroup>
  <Accordion title="Bot token is not valid">
    The token was probably mistyped, or it was replaced in BotFather after you copied it. Message BotFather, send `/mybots`, pick your bot, choose **API Token**, and copy the current one carefully into Olanna.
  </Accordion>

  <Accordion title="bot_username does not match the bot this token belongs to">
    The username you typed belongs to a different bot than the token does. Check you copied the exact username BotFather gave you, with no `@` in front. This happens easily if you made more than one bot while trying things out.
  </Accordion>

  <Accordion title="Could not register webhook with Telegram">
    This is usually a brief problem on Telegram's side. Wait a minute and try connecting again. If it keeps failing, check in BotFather that the bot has not been deleted.
  </Accordion>

  <Accordion title="Telegram getMe did not return a valid bot">
    The token is damaged, or the bot no longer exists. Make a fresh bot with `/newbot` in BotFather and use its new token.
  </Accordion>

  <Accordion title="I sent a message to my bot but nothing shows up in Olanna">
    Check you are messaging the bot you actually connected. Usernames are easy to mix up if you made more than one. Check the channel says Active in Olanna.
  </Accordion>

  <Accordion title="Still stuck">
    Contact support. Tell us the exact words of the error you saw after choosing Install.
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.