Manage Telegram bots

更新时间:
复制 MD 格式

Connect, configure, and manage Telegram bots in the Chat App Message Service console.

Prerequisites

Connect a bot to a channel

Connect a new or existing Telegram bot to a channel:

  1. Log on to the Chat App Message Service console.

  2. In the left navigation pane, click Channel Management.

  3. Find the Telegram channel that you want to manage, and then click the channel's Channel ID.

  4. On the channel operations page, click the Chatbot Management tab, and then choose Create Bot or Connect Existing Bot.

  5. Enter the Telegram bot token.

  6. Click Connect.

Create a bot

If you do not have a Telegram bot, create one in the Telegram client and then connect it to your channel.

  1. In the Telegram client, create a bot by using BotFather.

  2. Copy the API token that BotFather provides.

  3. In the Chat App Message Service console, paste the API token into the input field.

  4. Click Connect.

Connect an existing bot

If you already have a Telegram bot with an API token, connect it to your channel.

  1. Paste the API token into the input field.

  2. Click Connect.

After a successful connection, the bot information appears on the page.

Note

Each 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.

Important

Updating the token replaces the existing one and may briefly disconnect the bot, affecting message delivery. Perform this operation during off-peak hours.

  1. In the Telegram client, open BotFather and generate a new API token for your bot.

  2. On the Chatbot Management page, click Update Token.

  3. In the dialog box that appears, paste the new API token.

  4. Click OK.

Configure message workbench

The message workbench lets you centrally view and manage incoming messages sent to your bot.

  1. On the Chatbot Management page, click Message Workbench Settings.

  2. Select a message display mode:

    Mode

    Description

    Scenarios

    Enable Message Workbench

    Displays all incoming messages.

    Monitor all bot conversations.

    Triggered by Keyword

    Displays only messages that match the configured keywords.

    Focus on specific topics by filtering irrelevant messages.

Delete a bot

Warning

Deleting a bot permanently removes all synchronized group and channel information, which cannot be recovered. You can no longer send messages through the deleted bot.

  1. On the Chatbot Management page, click Delete.

  2. In the confirmation dialog box that appears, click OK.

Configure webhook

Configure a webhook to receive callbacks for message delivery and read statuses.

  1. On the Chatbot Management page, click Configure Webhook.

  2. Configure the webhook settings. Receipt message overview and configuration.

    Configure the following parameters in the Webhook Settings dialog box:

    Parameter

    Description

    HTTP Protocol

    Enable or disable HTTP callback URLs. When turned on, the Status Report Callback URL, MO Message Callback URL, and Notification Callback URL fields become required.

    Status Report Callback URL

    The HTTP callback URL to receive message delivery status reports. Required when HTTP Protocol is turned on.

    MO Message Callback URL

    The HTTP callback URL to receive mobile-originated (MO) message callbacks. Required when HTTP Protocol is turned on.

    Notification Callback URL

    The HTTP callback URL to receive audit notification callbacks. Required when HTTP Protocol is turned on.

    Message Queue Monitoring

    Enable or disable message queue monitoring.

    Message Receipt Queue

    The queue name for message delivery status. Read-only. Click the copy icon to copy the queue name.

    MO Message Queue

    The queue name for MO messages. Read-only. Click the copy icon to copy the queue name.

    Notification Queue

    The queue name for audit notifications. Read-only. Click the copy icon to copy the queue name.

Next steps

After connecting your bot: