# Telegram

> This page is about FlutterFlow (the app builder you use by describing your app), not FlutterFlow Studio.

URL: https://docs.flutterflow.io/ffx/telegram

Connect your Telegram bot with its token from @BotFather, and then ask the agent for a feature that sends messages from your bot to people, groups, and channels.

Send messages from your Telegram bot to people, groups, and channels, such as an alert when something happens in your app. You need a bot that you created with @BotFather in Telegram, and the bot's token.

## Connect Telegram {#connect-telegram}

To connect Telegram, you need your bot's token. @BotFather gives you the token when you create the bot. To see it again, open @BotFather › /mybots › your bot › API Token.

Only a project owner can connect Telegram. If you're a project owner, connect Telegram to your app:

1. Open **Project Settings › Connections**.
2. Turn on the switch for **Telegram**. The **Connect Telegram** dialog opens.

   If you've connected Telegram in another of your apps, the dialog first offers that connection. To use it, click **Use the key from** followed by that app's name. To enter a token instead, click **Paste a bot token**, and then continue with the next step. For more information, see [Reuse a connection](https://docs.flutterflow.io/ffx/connect-a-service#reuse-a-connection-from-another-app).
3. Paste the token into **Bot token**. To open Telegram's help on bot tokens, click **Find it** beside the label.
4. Click **Connect**.

Telegram checks the token before FlutterFlow saves the [connection](https://docs.flutterflow.io/ffx/glossary#backend-and-data). For more information, see [Connect a service](https://docs.flutterflow.io/ffx/connect-a-service).

## What to ask

To ask for a Telegram feature, tell the agent what to send, which chat to send it to, and what triggers the message:

> Example request: "I just sent my Telegram bot a message. Find that chat, and send me a message there when a monthly budget goes over its limit."

> Example request: "When a signed-in person adds a transaction over 500, send the payee and the amount to my Telegram group without a notification sound."

## Who your bot can message {#who-your-bot-can-message}

Telegram lets your bot message a chat only after one of the following happens, depending on the kind of chat:

- **A person:** the person starts a chat with your bot.
- **A group:** you add your bot to the group.
- **A channel:** you make your bot an administrator of the channel.

## Find a chat {#find-a-chat}

Each message goes to a chat ID, which the agent finds for you. To find a chat, the agent reads the chats that messaged or added your bot in the last 24 hours.

Before you ask, send your bot a message, or add the bot to the group or channel. Then ask the agent to find that chat. To send to a public channel, you can also give the agent the channel's @username.

## Agent questions

If Telegram isn't connected, the agent asks you to connect it in a card above the message box, with a **Connect Telegram** button. If you aren't a project owner, ask one to connect it. See [Connect when the agent asks](https://docs.flutterflow.io/ffx/connect-a-service#connect-when-the-agent-asks).

## Review

After the agent finishes, read the turn's [**Summary**](https://docs.flutterflow.io/ffx/what-changed#summary) and review its [**Changes**](https://docs.flutterflow.io/ffx/what-changed#changes-tab). Check the affected screens in **Screens**, and try the change in **Preview**. If the change uses records or sign-in, test it with [the thread's own data in **Data**](https://docs.flutterflow.io/ffx/thread-data).

After you push a backend change, check the result in **Backend**.

While you test the feature, send to your own chat or a test group. See [How connections work](https://docs.flutterflow.io/ffx/connections#preview-calls-are-real).

## Call limit {#call-limit}

Your app and the agent share a limit of 60 calls a minute to Telegram through your app's connection. See [Limits](https://docs.flutterflow.io/ffx/limits#connections).

## Push

After you test the feature, [push the changes to your app](https://docs.flutterflow.io/ffx/push).

## Next steps

- To replace the bot token or disconnect Telegram, see [Manage connections](https://docs.flutterflow.io/ffx/manage-connections).
- For the other services that you can connect, see [Available services](https://docs.flutterflow.io/ffx/services).

## Troubleshooting

- **The dialog says "A bot token is a number, a colon, then a long code, like 123456789:AA….":** copy the whole token from @BotFather › /mybots › your bot › API Token, and paste all of it.
- **Telegram refuses the token:** see [A service refuses your key](https://docs.flutterflow.io/ffx/troubleshoot-connections#key-refused).
- **Telegram stops accepting the token:** the token was revoked or the bot was deleted. Get the bot's current token from @BotFather, and then [replace the token](https://docs.flutterflow.io/ffx/manage-connections#replace-key).
- **Your bot can't message someone:** see [Who your bot can message](#who-your-bot-can-message).
- **The agent can't find your chat:** send your bot a message, and then ask again. If your bot has a webhook set, the agent can't find chats this way, so give the agent the chat ID instead.
- **Your app shows a message about the service:** see [Messages shown in your app](https://docs.flutterflow.io/ffx/troubleshoot-connections#app-messages).
