Telegram Bot Connection

  • Edit Times:2
  • Recent Updates:Chauvet-赵薇 on 2026-07-21
  • Description

    Function Description

    This document will describe how to create a Telegram bot and connect it to an agent on the Dora platform.

    Effect Display

    Taking how to ask the bot on the Telegram client the question "Help me check the ranking of each product category by sales amount in June 2024" as an example, the following figure shows the effect.

    iconNote:
    Telegram supports fewer message types. If you need to generate results of complex styles, you can ask the agent to reply with attachments.

    Whitelisting

    In an intranet environment, you must ensure that the server where the FineBI service and Data Agent service are deployed can externally access the Telegram bot API (https://api.telegram.org).

    If a self-built proxy is configured, you need to whitelist the corresponding proxy address (for example, https://telegram-proxy.customer.com).

    Telegram Bot Creation

    Search for BotFather in Telegram, choose Open > Create a New Bot, and enter the following information according to the prompts:

    • Bot name: customizable

    • Bot username: Telegram account name, which must end in bot and be unique

    After creation, save the bot token for later use, as shown in the following figure.

    Telegram User Mapping

    (1) Search for User Info • Get ID • IDbot in Telegram and enter /start to get the user's account information.

    (2) In the Dora console, choose User Management > IM User Mapping to map the Telegram account (in the First(Id) format) to the Dora account, as shown in the following figure.

    Configuring the Telegram Bot in the Agent

    (1) Add the bot token and bot username obtained in the above operations to the agent configuration page.

    Webhook Secret can be customized to be 1 to 256 characters long and can contain A–Z, a–z, 0–9, underscores (_), and hyphens (-).

    API Base URL is set to https://api.telegram.org by default. If a self-built proxy is configured, enter the corresponding proxy address.

    (2) After the configuration is complete, enter the Telegram bot configuration page again to configure the Webhook URL.

    In the Webhook URL configuration item, a complete URL will be generated by default in {public_network_access_base_url}/ai/conversation/im/telegram/messages/{bot_id} format, for example, https://your-domain.com/webroot/decision/ai/conversation/im/telegram/messages/123456.

    In the URL, {public_network_access_base_url} is the address of the project where Dora is deployed. If the deployment environment has a custom context path (for example, /webroot), the base URL needs to contain this path.

               {bot_id} is automatically entered by the system. Do not modify it manually. Just use the default value.

    After the Webhook URL is set, you can query the status or click Configure Webhook URL directly. After the prompt indicating successful configuration is displayed, click OK, as shown in the following figure.

    Bot Search and Use

    Private Chat with the Bot

    For first-time use, you need to manually search for the bot. Access Telegram and search for Chain Operation Analysis Bot to find the created bot, and click it to enter the private chat page with the bot.

    In the chat, send a question to the bot to start a chat with the agent through the bot, as shown in the following figure.

    Chat with the Bot in a Chat Group

    (1) Add the bot to a chat group, as shown in the following figure.

    (2) Find the bot in BotFather and disable the Group Privacy permission, as shown in the following figure.

    (3) @ the bot in the chat group to start a chat, as shown in the following figure.

     


    Attachment List


    Theme: Agent Creation
    • Helpful
    • Not helpful
    • Only read