Telegram Integration
Connect Fleet agents to Telegram so you can chat with them from your phone or desktop.
Overview
Fleet can connect to Telegram, letting you message your agents from anywhere. Messages you send to your Telegram bot are forwarded to Fleet, and agent responses are sent back to Telegram.
How it works:
- You create a Telegram bot via @BotFather
- Fleet polls the Telegram API for new messages (no webhook setup required)
- When you message your bot, Fleet receives it and wakes up the subscribed agent
- The agent's response is sent back to your Telegram chat
Step 1: Create a Telegram Bot
First, create a bot using Telegram's official @BotFather.
Open BotFather
- Open Telegram on your phone or desktop
- Search for @BotFather or go to t.me/BotFather
- Start a chat with BotFather
Create the Bot
- Send
/newbotto BotFather - Enter a name for your bot (e.g., "My Fleet Assistant")
- Enter a username for your bot (must end in
bot, e.g.,my_fleet_bot)
BotFather will respond with your bot token:
Done! Congratulations on your new bot. You will find it at t.me/my_fleet_bot.
Use this token to access the HTTP API:
123456789:ABCdefGHIjklMNOpqrsTUVwxyz
Keep your token secure and store it safely.
Copy the token (the part that looks like 123456789:ABCdefGHIjklMNOpqrsTUVwxyz). You'll need it in the next step.
Optional: Customize Your Bot
While in BotFather, you can also:
/setdescription— Set a description shown when users open the bot/setabouttext— Set the "About" text in the bot's profile/setuserpic— Upload a profile picture for your bot
Step 2: Create a Telegram Trigger in Fleet
Now connect your bot to Fleet.
Open Triggers
- In Fleet, go to Settings → Triggers
- Click New Trigger
- Select Telegram as the trigger type
Store Your Bot Token
Your bot token is a secret that should be stored securely in Fleet's vault:
- In the Bot Token Secret dropdown, select + Create new secret
- Enter a name for the secret (e.g.,
my-telegram-bot) - Paste your bot token from BotFather
- Click Save Secret
The token is now stored encrypted in Fleet's vault and will be used to authenticate with Telegram.
Configure Chat Permissions
Choose how your bot should respond:
| Setting | Description |
|---|---|
| Allow Private Chats | Bot responds to direct messages |
| Allow Group Chats | Bot responds in groups where it's added |
| Require @mention | In groups, only respond when the bot is @mentioned |
Recommended for personal use: Enable "Allow Private Chats" only. This limits the bot to just you.
Enable User Approval (Recommended)
Toggle Require User Approval to block unknown users until you approve them. This prevents random people from using your bot if they discover it.
When enabled:
- New users who message your bot see "pending approval"
- They appear in Fleet's UI for you to approve or reject
- Only approved users can interact with the agent
Save the Trigger
- Give your trigger a name (e.g.,
telegram-bot) - Click Save
Step 3: Subscribe an Agent
Connect an agent to receive Telegram messages.
Subscribe to the Trigger
- Open the agent you want to connect
- Go to Agent Settings → Triggers
- Click Add Subscription
- Select your Telegram trigger
- Set a prompt template that tells the agent how to handle messages:
You received a Telegram message from :
Respond helpfully and concisely. Keep responses under 4000 characters (Telegram's limit).
- Click Save
The agent will now receive messages from your Telegram bot.
Step 4: Start the Bot
The Telegram trigger needs to be started to begin receiving messages.
- Go to Settings → Triggers
- Find your Telegram trigger
- Click Start Polling
You should see:
- Status changes to Polling with a green indicator
- The bot's username appears (e.g.,
@my_fleet_bot)
The bot is now listening for messages.
Step 5: Message Your Bot
Open Telegram and start chatting with your bot.
Find Your Bot
- In Telegram, search for your bot's username (e.g.,
@my_fleet_bot) - Click Start to begin the conversation
- Send a message
If User Approval is Enabled
The first time you message the bot, you'll see:
"Your request to interact with this bot is pending approval. Please wait for the administrator to approve your access."
Approve Yourself in Fleet
- Go to Settings → Triggers in Fleet
- Open your Telegram trigger
- Under Pending Approval, you'll see your Telegram user
- Click the checkmark to approve yourself
You'll receive a message in Telegram:
"You've been approved! You can now interact with this bot."
Now your messages will be forwarded to Fleet and the agent will respond.
Configuration Options
Chat Types
| Option | When to Use |
|---|---|
| Private chats only | Personal assistant, just for you |
| Group chats only | Team bot in a specific group |
| Both | Flexible access from anywhere |
Group Chat Behavior
When "Allow Group Chats" is enabled, you can add your bot to Telegram groups. By default, it responds to every message. Enable Require @mention to make it only respond when someone mentions @your_bot_username.
The bot also responds to replies — if someone replies to a bot message, it counts as a mention.
User Management
With "Require User Approval" enabled:
- Pending users — Shown with name, username, and approve/reject buttons
- Approved users — Shown as a list of user IDs with remove buttons
- Rejected users — Removed from pending and won't be prompted again (until they message again)
Approved user IDs are persisted in the trigger configuration, so they survive restarts.
Troubleshooting
Bot Not Responding
- Check trigger status — Go to Settings → Triggers and verify it shows "Polling"
- Check user approval — If enabled, make sure you're approved
- Check agent subscription — Verify the agent is subscribed to the trigger
- Check agent state — The agent might be paused or in an error state
"Failed to create Telegram bot" Error
- Verify your bot token is correct (copy it again from BotFather)
- Make sure the secret name in the vault matches what's selected in the trigger
Messages Delayed
Fleet uses long-polling with a 60-second timeout. Messages should arrive within a few seconds. If delays persist:
- Stop and restart the trigger
- Check your network connection
- Check Fleet's logs for errors
Bot Token Compromised
If you think your token was exposed:
- Go to @BotFather in Telegram
- Send
/revoke - Select your bot
- BotFather will generate a new token
- Update the secret in Fleet's vault with the new token
- Restart the trigger
Next Steps
- Create specialized agents for different Telegram conversations
- Build skills that your Telegram-connected agents can use
- Set up other triggers like webhooks and scripts