This document guides you through the process of setting up your Telegram bot to automatically send messages to a Telegram channel.
Please note that you must have already created your Telegram bot.
I. Creating a New Telegram Channel
Log in to Telegram: Open the Telegram application on your device.
Click the Edit button: This is usually found in the bottom right corner of the screen.
Click on New Channel: Select this option to begin creating your channel.
Enter the channel: Once the channel is created, open it.
Click on the pencil icon: This icon allows you to edit the channel settings.
Go to the Administrators section: Within the channel settings, find and select the "Administrators" option.
Select the bot as an administrator: Add your bot to the channel's administrators list. This is crucial for the bot to be able to post messages.
Obtain the channel ID:
Open Telegram Web in your computer's browser.
Select the channel you created.
In the browser's URL address bar, you will see the channel ID after #-. It will be in the format -CHANNELID. Important: Include the hyphen "-" when you copy the ID.
II. Configuring Chatbot Builder AI
Go to your Chatbot Builder AI platform.
Navigate to Flows - Actions - External API Request.
Base URL and Endpoint: The base URL for interacting with the Telegram Bot API is:
https://api.telegram.org/botYOUR_TOKEN/sendmessage
Replace YOUR_TOKEN with the actual token of the bot you created using BotFather.
External API Request Body: In the body of the external request, use a JSON structure like this:
JSON
{
"chat_id": "-CHANNELID",
"text": "Hello, this message is a test from CBB"
}
Replace -CHANNELID with the channel ID you obtained in Step 8. The "text" field contains the message you want to send.
Using Custom User Fields (CUFs): If you want to send a message stored in a Custom User Field (CUF), replace the text in the JSON body with the CUF name enclosed in double curly braces: {{CUF}}.
For example:
JSON
{
"chat_id": "-CHANNELID",
"text": "{{my_cuf}}"
}
Triggering the Message Flow: You can trigger the flow that contains the External API Request using Keywords or through a rule.
We hope this guide is helpful for automating sending messages to your Telegram channel.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article