Connect a Conversation Platform: Telegram
Connect Telegram as a messaging channel: create a Telegram Bot, get its Bot Token, and add a channel linked to an Agent in MaiAgent.
Before You Begin
Create an AI Assistant on the MaiAgent platform
Register a Telegram account
Set Up the Integration
1. Open "Channels" in the left menu, then click "+ Connect Channel" in the upper right

2. Select Telegram as the messaging platform

3. Enter a channel name and select an Agent

4. Get a Bot Token from BotFather https://t.me/BotFather
a. Click the "BotFather" link: https://t.me/BotFather

b. Open the Telegram BotFather channel

c. Click "OPEN IN WEB" (if using the web version)
BotFather will then ask you to click start to begin the conversation:

d. Click "/newbot" and follow the instructions to enter a bot name and username to get a Bot Token

5. Return to the channel integration editor in MaiAgent and paste the Bot Token you just obtained
The creation form has three tabs: Basic Settings, Feature Settings, and Permission Settings. Fill in the following under Basic Settings:
Name, AI Assistant
The channel name and the Agent to connect (step 3)
Telegram Channel › Bot Token
Paste the token obtained from BotFather. The hint below the field says, "After you enter the Bot Token, the system automatically configures the Webhook for you. No additional setup is required." Unlike LINE, you do not need to return to the platform's administration console to paste a Webhook URL
Chat Settings › Respond only when @mentioned in groups
When enabled, the Agent responds only to messages that @mention it in Telegram groups; when disabled, it responds to all messages in the group
Enable Typing Indicator
Show a "typing" indicator in Telegram while the Agent prepares a reply
Enable Reset Commands, Reset Commands
Enable this to add one or more command texts (such as "Start over"). When a user's Telegram message exactly matches one of them, a new conversation is started for that user. The command itself receives no reply; the AI responds in the new conversation when the user sends their next message
The Feature Settings tab (enable OCR, use system time and a time zone in answers, and use the sender's name in answers) and the Permission Settings tab work the same as on other messaging platforms. See Feature Settings and Channel Settings Overview.
After pasting the Bot Token, click "Connect Channel" in the lower right to complete the integration


6. Verify the Integration
Start a conversation with the Telegram Bot you just configured

If the conversation appears in All Conversations in MaiAgent, the integration is successful!
In the normal case, Agent replies are sent as Telegram rich-text messages, so headings, bold text, lists, tables, and links are all formatted, and you do not need to tell the Agent in the role instructions to avoid Markdown. Replies longer than 32,768 characters, or rejected by Telegram, are sent as plain text instead. For details, see Message Content Rendering Optimization: Telegram.
Last updated
Was this helpful?