Skip to content

Telegram Bot


Bots are small applications that run inside the Telegram app. Users interact with bots through flexible interfaces that can support any type of task or service. This document describes how to create a Telegram Bot notification target in Guance to push alert messages directly to Telegram private chats, groups, or channels.

Click for more information about Bots.

Note

This notification target applies only to international site workspaces that have bound an International Billing Center account.

Prerequisites

Before configuring in Guance, complete the following preparation in Telegram:

Step 1: Create a Bot and Obtain the Token

  1. Search for and start @BotFather in Telegram.
  2. Send the /newbot command to create a new bot.
  3. Set the bot name and username as prompted (the username must end with bot).
  4. After the bot is created, keep the returned Bot Token safe (format: 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11).
Note

The Bot Token is the credential for calling the Telegram API. Keep it safe and never disclose it.

Step 2: Obtain the Chat ID

Add the Bot to the target group, or create a private chat. Send the message @userinfobot in the chat and click the link to obtain the Chat ID.

Chat ID supports the following formats:

Receiving Scenario Chat ID Format Example
Private chat User ID (numeric only) 123456789
Group Group ID (negative number) -1001234567890
Channel Channel username @my_channel

Step 2: Obtain the Topic ID (Optional)

Required only when the target is a Forum Supergroup and you need to send to a specific topic:

  1. Send a message in the target topic.
  2. Visit https://api.telegram.org/bot<YourBOTToken>/getUpdates.
  3. Find the message_thread_id field value in the returned data.

Return to the Telegram Bot Configuration Page

  1. Define a name for the current notification target, used to identify it in the notification target list.
  2. Enter the Bot Token obtained from @BotFather.
  3. Enter the Chat ID.
  4. If you need to send to a forum group, enter the Message Thread ID.
  5. Test as needed whether the notification has been sent (❗️The system sends a test message; go to the corresponding notification target to verify whether the test message was sent successfully).
  6. Configure operation permissions.
  7. Confirm.

Feedback

Is this page helpful?