Telegram Agent Integration
Introduction
Connect your ChatCrafterAI agent to Telegram to communicate with customers through this messaging platform. This guide walks you through the complete setup process.Prerequisites
Before connecting Telegram to ChatCrafterAI, ensure you have:Telegram Account
You need a personal Telegram account to create and manage agents. Download Telegram for iOS, Android, or desktop and register with your phone number.BotFather Access
BotFather is Telegram’s official agent for creating and managing other agents. Every Telegram user automatically has access—simply search for “@BotFather” in Telegram.No Business Verification
Unlike WhatsApp or Instagram, Telegram requires no business verification, company registration, or approval process. You can create an agent instantly, making it the fastest channel to deploy.API Token
BotFather generates an API token when you create your agent. This token authenticates your agent with Telegram’s servers. Store it securely and never share it publicly.Detailed Setup Process
Step 1: Create Agent with BotFather
BotFather guides you through agent creation using simple chat commands:-
Open Telegram:
- Launch Telegram on any device
- Ensure you’re logged into your account
-
Find BotFather:
- Tap the search icon
- Type “BotFather” (or @BotFather)
- Select the verified BotFather account (it has a blue checkmark)
-
Start Conversation:
- Tap “Start” to begin
- BotFather lists available commands
-
Create New Agent:
- Send command:
/newbot - BotFather asks for an agent name
- Send command:
-
Choose Agent Name:
- Enter a display name (can include spaces and special characters)
- Example: “Acme Support Agent” or “TechHelp Assistant”
- This name appears in chat headers and search results
-
Choose Username:
- Enter a unique username (alphanumeric only, must end in “agent”)
- Example: “acmesupport_bot” or “techhelp_bot”
- Username must be globally unique across all Telegram agents
- If taken, BotFather prompts you to try another
-
Receive API Token:
- BotFather confirms creation and displays your API token
- Example format:
1234567890:ABCdefGHIjklMNOpqrsTUVwxyz-1234567 - CRITICAL: Copy this token immediately and store securely
- You can retrieve it later with
/tokencommand, but save it now
-
Save Agent Link:
- BotFather provides a direct link:
t.me/yourbot_bot - Save this link for sharing with customers
- BotFather provides a direct link:
Step 2: Configure Agent Settings
Customize your agent’s appearance and behavior within Telegram:-
Access Agent Settings:
- In BotFather chat, send:
/mybots - Select your newly created agent from the list
- BotFather shows configuration options
- In BotFather chat, send:
-
Set Description:
- Select “Edit Description”
- Enter a detailed description (up to 512 characters)
- This appears when users first open your agent
- Example: “Get instant help with your Acme products. Ask questions about features, troubleshooting, orders, and more. Available 24/7.”
-
Set About Text:
- Select “Edit About”
- Enter brief text (up to 120 characters)
- Appears in agent profile
- Example: “24/7 customer support for Acme products”
-
Upload Profile Photo:
- Select “Edit Botpic”
- Upload your company logo or agent avatar
- Recommended size: 512x512 pixels
- Formats: JPG or PNG
-
Configure Commands (Optional):
- Select “Edit Commands”
- Define commands users can access via ”/” menu
- Format:
command - description - Example commands:
- These appear when users type ”/” in chat
-
Enable Inline Queries (Optional):
- Select “Inline Mode”
- Toggle to “Enable”
- Allows users to invoke your agent from other chats
- Example: Type “@yourbot search term” in any chat
- Useful for information lookup agents
-
Privacy Settings:
- Select “Agent Settings”
- Choose “Privacy Mode”
- Enabled: Agent only sees direct messages and @mentions in groups
- Disabled: Agent sees all group messages
- For most customer support agents, keep Privacy Mode enabled
Step 3: Connect to ChatCrafterAI
Link your Telegram agent to your ChatCrafterAI knowledge base with our simplified one-click setup:-
Navigate to Multi-Channel:
- Log into ChatCrafterAI dashboard
- Select your agent
- Click “Multi-Channel” in left sidebar
- You’ll see available channel cards
-
Click Telegram Card:
- Find the “Telegram Agent” card in the “Available Channels” section
- Click anywhere on the card to open the setup dialog
- A guided setup wizard appears
-
Follow the Setup Guide:
- The dialog shows step-by-step instructions
- Step 1: Open @BotFather in Telegram
- Step 2: Create agent with
/newbotcommand - Step 3: Copy your agent token
- Step 4: Paste token in the input field
-
Paste API Token:
- In the setup dialog, paste your agent token from BotFather
- Token format:
123456789:ABCdef... - Verify it’s copied exactly (no spaces before/after)
-
Click “Connect Agent”:
- ChatCrafterAI automatically:
- Validates the token with Telegram
- Retrieves agent information
- Generates webhook URL
- Registers webhook with Telegram
- Activates the channel
- This takes 3-5 seconds
- ChatCrafterAI automatically:
-
Success!:
- Green checkmark appears: “Telegram agent connected successfully!”
- Setup dialog closes automatically
- Your agent now appears in “Connected Channels” section
- Webhook is already configured and active
- API token is correct and complete (format:
numbers:letters) - Token hasn’t been revoked in BotFather
- Your ChatCrafterAI account is active
- No typos in token entry
Step 4: Configure Webhooks (Automatic)
Unlike WhatsApp, Telegram webhook configuration is fully automated: ChatCrafterAI Handles Everything:- Automatically registers webhook URL with Telegram
- Configures message routing
- Sets up event listeners
- Manages connection health checks
- You don’t need to access Telegram API directly
- No webhook URLs to copy
- No verify tokens to manage
- ChatCrafterAI manages the entire technical setup
- ChatCrafterAI generates a unique webhook URL for your agent
- Registers this URL with Telegram via API
- Telegram sends all incoming messages to this webhook
- ChatCrafterAI processes messages and routes to your agent
- Responses flow back through Telegram API to users
Step 5: Test Your Agent
Thorough testing ensures everything works before customer launch:-
Find Your Agent in Telegram:
- Open Telegram app
- Tap search icon
- Enter your bot’s username (e.g., @acmesupport_bot)
- Select your agent from results
-
Start Conversation:
- Tap “Start” button
- This sends
/startcommand to your agent - Your agent should respond with greeting message
- Verify response matches your agent’s training
-
Test Basic Interactions:
- Send simple questions your agent should know
- Example: “What are your hours?” or “Tell me about your product”
- Verify responses are accurate and well-formatted
-
Test Command Buttons:
- Type ”/” to see command menu
- Tap each configured command
- Verify agent responds appropriately
- Commands should trigger relevant conversation flows
-
Test Inline Buttons:
- If your agent uses inline keyboards (clickable buttons)
- Verify buttons appear correctly
- Tap each button
- Confirm selections register and trigger correct responses
-
Test Rich Formatting:
- Check that bold, italic, and code formatting displays correctly
- Verify links are clickable
- Ensure lists and structured content renders properly
-
Test Fallback Responses:
- Ask questions your agent doesn’t know
- Verify fallback message is helpful
- Check that escalation options (contact support) work
-
Verify in ChatCrafterAI Dashboard:
- Return to ChatCrafterAI
- Navigate to “Conversations”
- Select Telegram channel filter
- Review test conversation history
- Confirm all messages logged correctly
Step 6: Deploy to Production
After successful testing, make your agent publicly available:-
Final Verification:
- Complete one more end-to-end test conversation
- Verify all critical paths work
- Check knowledge base coverage for common questions
- Ensure escalation to human support functions
-
Update Agent Description:
- Return to BotFather
- Send
/mybots, select your agent - Refine description based on testing insights
- Ensure description accurately sets expectations
-
Share Agent with Users:
- Website: Add Telegram link/button:
https://t.me/yourbot_bot - Social Media: Post announcement with agent link
- Email Signature: Include Telegram contact option
- Documentation: Add to support contact page
- In-App: If you have an app, link to Telegram agent
- Website: Add Telegram link/button:
-
Create QR Code:
- Generate QR code for agent URL
- Place on physical materials (packaging, receipts, signage)
- Useful for offline-to-online customer journeys
-
Monitor Initial Usage:
- Watch conversations closely in first 24-48 hours
- Identify common questions requiring knowledge base updates
- Note any technical issues or unexpected behavior
- Gather user feedback about agent experience
-
Optimize Based on Data:
- Review conversation analytics after first week
- Identify most common intents
- Add knowledge base content for frequent questions
- Refine conversation flows based on actual usage patterns
Available Features
Telegram’s extensive feature set enables sophisticated agent interactions:Inline Buttons
Clickable buttons appear directly below messages, offering clear action options. Unlike keyboard buttons (which persist), inline buttons are attached to specific messages. Use Cases:- Multiple choice questions: “Select your issue: [Technical] [Billing] [Sales]”
- Confirmation prompts: “Is this correct? [Yes] [No]”
- Navigation: “Go to: [Main Menu] [Previous] [Help]”
Keyboard Buttons
Persistent buttons appear above the text input field, suggesting reply options. These remain visible until replaced or removed. Use Cases:- Main menu that’s always accessible
- Common actions: [Check Status] [New Request] [Contact Human]
- Quick replies to yes/no questions
Formatted Text
Telegram supports rich text formatting:- Bold:
*text*or**text** - Italic:
_text_or__text__ Code:Inline code blocksCode blocks:Multi-line code- Links: Clickable URLs
Inline Queries
Users can invoke your agent from any chat by typing@yourbot query. The agent returns results without leaving the current conversation.
Use Cases:
- Knowledge lookup: “@supportbot product specifications”
- Quick answers: “@faqbot refund policy”
- Shared information: Search and share with others in group chats
Commands
Custom commands (starting with/) provide quick access to specific functions:
/start- Initialize conversation (Telegram default)/help- Show help information/contact- Get support contact details/status- Check order/ticket status/faq- View frequently asked questions
/ or tapping the command menu icon.
Stickers and Animated Content
While typically not used by support agents, Telegram supports stickers and GIF animations. These can add personality for brand-focused agents or community engagement agents.File Sharing
Send and receive documents, PDFs, images, audio files, and videos. Maximum file size: 2GB per file. Use Cases:- Send product manuals or documentation
- Share invoices or receipts
- Receive troubleshooting screenshots from users
- Provide setup videos or tutorials
Command Setup Best Practices
Well-designed commands improve discoverability and usability:Essential Commands
Every agent should include:/start - The entry point. Triggered when users first open your agent. Use this to:
- Welcome users warmly
- Explain what your agent can do
- Offer initial options (buttons or quick commands)
- Set expectations for response times
/help - Accessible assistance. Provide:
- Overview of agent capabilities
- List of available commands
- Examples of questions users can ask
- Link to human support if needed
Optional but Recommended Commands
/contact - Direct path to human support:
- Email address
- Phone number
- Support hours
- Expected response time
/status - For transaction-based businesses:
- Order tracking
- Ticket status
- Account information
- Delivery updates
/faq - Quick access to common questions:
- Categorized FAQ topics
- Buttons to navigate different sections
- Search functionality if supported
Command Naming
- Keep commands short (ideally one word)
- Use intuitive names (users should guess purpose)
- Maintain consistency with industry standards
- Avoid special characters (letters and numbers only)
Common Issues and Solutions
Issue: “Invalid Token”
Symptoms: ChatCrafterAI rejects API token during connection Solutions:- Return to BotFather and send
/tokencommand - Select your agent to display current valid token
- Copy token carefully, ensuring no extra spaces or characters
- Verify token format: numbers, colon, then alphanumeric string
- If token was recently revoked, generate new agent or retrieve existing token
Issue: “Agent Not Responding”
Symptoms: Messages sent to agent receive no reply Solutions:- Verify Telegram channel is activated in ChatCrafterAI (toggle is “On”)
- Check that agent has knowledge base content to draw from
- Send simple test message like “Hello” to rule out complex query issues
- Review ChatCrafterAI conversation logs to see if messages are being received
- Verify webhook is properly registered (disconnect and reconnect in ChatCrafterAI)
- Ensure API token hasn’t been revoked in BotFather
Issue: “Button Clicks Not Working”
Symptoms: Inline buttons appear but don’t respond when tapped Solutions:- Verify button configuration in ChatCrafterAI flow builder
- Check that button callback data matches expected values
- Test on different devices (iOS vs. Android) to rule out platform-specific issues
- Review ChatCrafterAI logs to see if button callbacks are received
- Ensure buttons aren’t nested too deeply in conversation flow
Issue: “Commands Not Appearing”
Symptoms: Command menu doesn’t show configured commands Solutions:- Return to BotFather, send
/mybots, select your agent - Choose “Edit Commands” and verify commands are listed
- Ensure command format is correct:
command - description - Try deleting and re-adding commands
- Test on different Telegram clients (mobile app vs. desktop vs. web)
- Allow 5-10 minutes for command updates to propagate
Best Practices
Use Clear Command Descriptions
When setting commands in BotFather, descriptions should be action-oriented and specific:- Good: “Check your order status”
- Bad: “Status”
Keep Messages Concise
Telegram’s mobile interface shows limited preview text. Structure messages with key information first:- Lead with the answer
- Add details second
- Use formatting to highlight important parts
- Break very long responses into multiple messages
Prefer Buttons Over Text Input
Buttons reduce friction and error rates. Instead of asking “What do you need help with?”, offer buttons: [Technical Support] [Billing] [Sales] [Other] This speeds interactions and provides cleaner analytics.Test in Small Groups First
Before public launch, invite a small group of team members or trusted customers:- Gather feedback on agent personality and helpfulness
- Identify knowledge gaps
- Test various question phrasings
- Verify all conversation paths work correctly
Monitor Agent Statistics
BotFather provides basic analytics:- Send
/mybots, select your agent - Choose “Agent Stats”
- View user count and message volume by day
- Identify growth trends
Leverage Telegram’s Speed
Telegram users expect near-instant responses. Optimize your agent for speed:- Keep knowledge base well-organized
- Use concise answers that require less processing
- Monitor response times in ChatCrafterAI dashboard
- Aim for under 2-second responses
Set Clear Expectations
In your/start message and agent description, clearly state:
- What the agent can help with
- What it cannot do
- How to reach human support
- Typical response times (for escalated requests)
Monitoring and Analytics
BotFather Statistics
Basic usage metrics available directly in Telegram:- Total Users: Cumulative users who’ve started your agent
- Messages Sent: Outbound messages from your agent
- Active Users: Daily/weekly/monthly active users
- Growth Rate: User acquisition over time
/mybots → Select agent → “Agent Stats”
ChatCrafterAI Conversation Analytics
Detailed metrics in your ChatCrafterAI dashboard:- Conversation Volume: Total conversations by day/week/month
- Resolution Rate: Percentage resolved without human escalation
- Common Intents: Most frequently asked questions
- Drop-off Points: Where conversations end without resolution
- Response Time: Average time from user message to agent response
- User Satisfaction: If feedback collection is enabled
Command Usage Tracking
Monitor which commands users invoke most frequently:- High usage indicates valuable functionality
- Low usage may indicate unclear descriptions or discoverability issues
- Unused commands might be removed or redesigned
Message Flow Analysis
Review conversation paths to identify:- Most common conversation flows
- Bottlenecks where users get stuck
- Loops where conversations repeat without progress
- Successful resolution patterns to replicate
Next Steps
Your Telegram agent is now deployed and operational. To maximize effectiveness:- Explore Cross-Channel Integration: Learn how Telegram conversations work alongside other channels in Cross-Channel Conversation Management
- Refine Knowledge Base: Regularly review conversations and add content for commonly asked questions
- Gather User Feedback: Ask users about their experience and iterate based on responses
- Expand Features: As you become comfortable, explore advanced Telegram features like inline queries and deep linking