Telegram
You can integrate the GPTBots Agent into a Telegram Bot (TG Bot), allowing your Telegram users to interact with the Agent through the TG Bot.
Telegram currently supports three types of Agent and user interactions:
- Private Chat: Agent and user communicate one-on-one
- Group Chat - Passive Listening: Agent only responds when the user @mentions the TG Bot
- Group Chat - Active Listening: Agent continuously listens to all user messages and responds
Create a TG Bot
Go to BotFather, enter the /newbot
command, and follow BotFather’s instructions to create a TG Bot.
Once created, you will obtain the TG Bot link (Telegram Agent Link) and token.
Configure in GPTBots
Go to GPTBots, enter Integrations - Telegram, toggle the switch, and open the Manage page. Click Add TG Bot.
Enter the token obtained from BotFather and click Verify at the bottom.
After successful verification, the fields above will refresh with the avatar and name (Username) set in your TG Bot. Once confirmed, select the chat mode for this TG Bot to respond to, then click Submit.
Note: To use the Active Listening feature, you must first configure both Listening Frequency and Listening Rules. For detailed instructions, see the section at the bottom.
After submitting successfully, the system will provide the TG Bot link (Telegram Agent Link). This link can be shared with your users, who can use it to access the TG Bot and start chatting with it.
Update Agent introduction
Click Update Agent introduction to update the current description of the Agent to all TG Bots.
Private Chat in Telegram
Enable the Private Chat button.
When users access the Telegram Agent Link, they can chat with the Agent directly in Telegram.
Group Chat in Telegram (Passive Listening)
Group Chat (Passive Listening): The Agent only responds when the user @mentions the TG Bot.
Setup Tutorial
First, in BotFather, change the TG Bot’s group chat permission to Passive Listening mode.
- Enter
setprivacy
- Enter the TG Bot whose group chat permissions you want to adjust, such as “@YourBotName”
- Follow the instructions and enter
Enable
- TG will return
Enable
, which means Passive Listening has been successfully enabled
Next, open the TG Bot’s profile page and click Add to Group or Channel.
Choose the group to which you want to add the TG Bot.
Keep using Admin Rights to provide the TG Bot with full permissions, then click Add Bot as Admin to complete the process of adding the TG Bot to the group.
Next, go back to the GPTBots Telegram integration page and click Edit.
In Group Chat mode, select Passive Listening, click Save, and the setup is complete.
Group Chat in Telegram (Active Listening)
Group Chat (Active Listening): The Agent continuously listens to all user messages and responds.
Complete process: The system collects group chat messages at intervals based on the configured Listening Frequency and stores them in the staging area. The messages are then matched against Listening Rules, and if a match is found, the group chat messages are forwarded to the Agent for response.
Setup Tutorial
First, in BotFather, change the TG Bot’s group chat permission to Active Listening mode.
- Enter
setprivacy
- Enter the Agent whose group chat permissions you want to adjust, such as “@YourBotName”
- Follow the instructions and enter
Disable
- TG will return
Disable
, which means Active Listening has been successfully enabled
Next, open the TG Bot’s profile page and click Add to Group or Channel.
Choose the group to which you want to add the TG Bot.
Keep using Admin Rights to provide the TG Bot with full permissions, then click Add Bot as Admin to complete the process of adding the TG Bot to the group.
Next, go back to the GPTBots Telegram integration page and click Edit.
In Group Chat mode, select Active Listening. Active Listening requires two settings.
Step 1: Adjust the Listening Frequency. Listening Frequency determines how often the system collects group chat messages. The shorter the interval, the more frequently the Agent responds.
Step 2: Configure the Listening Rules. Click Set Listening Rules.
Note: Both Listening Frequency and Listening Rules are required. You must configure both to enable Active Listening.
Listening Rules provide three options:
- Keyword Match: Supports regex. Only when a group chat message matches a keyword in the list will the message be forwarded to the Agent.
- Semantic Match (Normal): The LLM checks messages against the list of keywords. If a match is found, the message is submitted to the Agent for response. Normal mode: fast speed, low credit consumption, moderate accuracy.
- Semantic Match (Advanced): The LLM checks messages against both keywords and descriptions. If a match is found, the message is submitted to the Agent for response. Advanced mode: fast speed, high credit consumption, high accuracy.
After selecting a matching rule, add keywords and descriptions in the list below.
After filling in the keywords and descriptions, make sure to toggle the enable button, then click Confirm. Next, go back to the Set TG Bot popup and click Save. The Active Listening setup is now complete.
If you need to adjust the content of the Listening Rules later, you can also click Listening Rules in the page to modify them.
Note: Using the Semantic Match feature in Active Listening mode may consume a large number of credits. To avoid high credit consumption, use Keyword Match instead.