Telegram Integration
This guide walks you through connecting an Aigentic agent to Telegram as a bot.
Prerequisites
Section titled “Prerequisites”- An Aigentic agent already created
- A Telegram account
Step 1: Create a Bot with BotFather
Section titled “Step 1: Create a Bot with BotFather”- Open Telegram and search for @BotFather.
- Start a conversation and send
/newbot. - Follow the prompts:
- Enter a display name for your bot (e.g., “My AI Agent”).
- Enter a username for your bot (must end in
bot, e.g.,my_ai_agent_bot).
- BotFather responds with your bot token. Copy it.
Use this token to access the HTTP API:7123456789:AAHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxStep 2: Configure the Bot Profile (Optional)
Section titled “Step 2: Configure the Bot Profile (Optional)”While still talking to BotFather, you can customize your bot:
| Command | Purpose |
|---|---|
/setdescription | Short description shown when users find your bot |
/setabouttext | Text shown on the bot’s profile page |
/setuserpic | Upload a profile photo |
/setcommands | Define command menu entries |
Setting commands is recommended:
/start - Start a conversation/help - Show available commands/reset - Clear conversation historyStep 3: Configure in Aigentic
Section titled “Step 3: Configure in Aigentic”- Open Channels from the sidebar.
- Click Configure on the Telegram card.
- Click Add New Bot.
- Paste the bot token from BotFather.
- Optionally click Test Token to verify the token is valid.
- Choose the response mode — Single Agent or Swarm (routes messages to a swarm’s orchestrator).
- Select the responding agent (or swarm) from the dropdown.
- Click Add Bot.
The token is encrypted and stored in the credential vault. You can add multiple Telegram bots — each appears in the “Active Bots” list where you can start, stop, or delete them individually.
Step 4: Test the Connection
Section titled “Step 4: Test the Connection”- Open Telegram and find your bot by searching for its username.
- Click Start or send
/start. - Send a message:
Hello! What can you do?
- The bot should respond within a few seconds.
Telegram Features
Section titled “Telegram Features”Private Chats
Section titled “Private Chats”In private (1-on-1) chats, the agent receives every message and responds directly. Conversation context is maintained per user.
Group Chats
Section titled “Group Chats”In group chats, the bot’s behavior depends on its privacy mode:
- Privacy mode ON (default): The bot only sees messages that are commands (start with
/), directly reply to the bot’s messages, or mention the bot by @username. - Privacy mode OFF: The bot sees all messages in the group. Disable via BotFather with
/setprivacy.
Message Formatting
Section titled “Message Formatting”Telegram supports Markdown formatting. Aigentic automatically formats agent responses with bold, italic, code, and code blocks. Long responses are split into multiple messages if they exceed Telegram’s 4096-character limit.
Troubleshooting
Section titled “Troubleshooting”Bot not responding
Section titled “Bot not responding”- Verify the bot token is correct (click Configure on the Telegram card in the Channels page).
- Check that the agent is active.
- Send
/startto the bot to initialize the conversation.
Bot responds in private chat but not in groups
Section titled “Bot responds in private chat but not in groups”- Check the group privacy mode setting.
- In groups with privacy mode enabled, the bot only sees commands and replies to its messages.
- Make sure the bot was added to the group as a member.
Slow responses
Section titled “Slow responses”- Check the agent’s model — larger models produce slower responses.
- The agent may be processing a complex request that requires tool invocations.
”Conflict: terminated by other getUpdates request”
Section titled “”Conflict: terminated by other getUpdates request””This error means another instance is polling the same bot token. Ensure only one connection is using this bot token at a time. If you have Server-Side Polling enabled, the daemon may conflict with a browser-tab bridge — use one or the other.