This topic explains how to connect a Telegram bot to a channel, configure its API token, and set up a webhook. You will also learn how to send messages, receive replies, and centrally manage multiple Telegram bots in the Chat App Message Service console.
Prerequisites
You have created a Telegram bot. For instructions, see How to create a Telegram bot.
You have created a Telegram channel. For instructions, see Create and manage Telegram channels.
Procedure
Follow these steps to connect your bot.
Log on to the Chat App Message Service console.
In the left navigation pane, click Channel Management.
Click the Channel ID of the Telegram channel that you want to manage.
On the channel operations page, go to the Chatbot Management tab and choose either Create Bot or Connect Existing Bot.
Enter the Telegram bot token.
Click Connect.
Create a bot
You must create the bot in the Telegram client. After creating the bot, copy its API token, paste it into the input field, and click Connect.
Connect an existing bot
Paste the API token into the input field and click Connect. After a successful connection, your bot's information appears on the page.
A Telegram channel supports only one bot. To manage multiple bots, create a separate Telegram channel for each bot and connect them individually.
Update token
If a bot's API token is compromised or expires, you can update it in the console.
Updating the token replaces the existing one. This process may cause a brief disconnection and affect message delivery. We recommend performing this operation during off-peak hours.
In the Telegram client, open BotFather and generate a new API token for your bot.
On the Chatbot Management page, click Update Token.
In the dialog box that appears, paste the new API token.
Click OK.
Configure message workbench
The message workbench lets you centrally view and manage incoming messages sent to your bot.
On the Chatbot Management page, click message workbench settings.
Configuration details:
Mode
Description
Scenarios
Enable Message Workbench
The message workbench displays all incoming messages.
Ideal for viewing all incoming messages.
Triggered by Keyword
The message workbench displays only messages that match the configured keywords.
Ideal for filtering out low-value messages to focus on important content.
Delete bot
After you delete a bot, you can no longer send messages through it. This action also deletes all synchronized group and channel information, which cannot be recovered.
On the Chatbot Management page, click Delete.
In the confirmation dialog box that appears, click OK.
Webhook settings
On the Chatbot Management page, click Configure Webhook.
A webhook lets you receive receipt notifications, such as callbacks for message delivery and read statuses. For configuration instructions, see Receipt message overview and configuration.
Next steps
After connecting your bot, you can:
Design message templates. For instructions, see Template design.
Send messages to users. For instructions, see Send message.