Create Bot from BotFather to TG-Staff: A complete guide to building a Telegram customer service system
关于作者
TG-Staff 致力于为 Telegram Bot 运营团队提供高效、可靠的客服与营销 SaaS 工具。
Create Bot from BotFather to TG-Staff: A complete guide to building a Telegram customer service system
Want to use Telegram Bot for customer service, but don’t know where to start? The starting point for all Telegram customer service systems is the official Bot management tool BotFather. From creating a Bot, obtaining a Token, to connecting to a professional customer service platform like TG-Staff, this article will take you through six steps to build a usable Telegram customer service system, covering agent configuration, diversion rules, automatic translation, and content risk control.
Why use BotFather to create a customer service bot?
The relationship between BotFather and customer service system
BotFather is Telegram’s official Bot management robot. All Bot creation, configuration and token management must be completed through it. Your customer service bot is essentially a Telegram bot that receives user messages, forwards the messages to the backend server for processing, and then returns a reply. A SaaS platform like TG-Staff plays the role of this “backend server” - you don’t need to write code yourself, just bind the Bot Token to the TG-Staff console to get Web-side agents, session offloading, automatic translation and other capabilities.
What problems can customer service Bot solve?
A properly configured customer service bot can solve three typical types of problems:
- Response Delay: After the user sends a message, the Bot automatically replies with a welcome message or frequently asked questions, and a human agent then intervenes to avoid losing the user while waiting.
- Multi-language communication: In cross-border business, users ask questions in different languages, and agents use automatic translation to quickly understand and respond.
- Channel Attribution: Track user sources (advertising, social media, official website) through diversion links, and know which channel has brought consultation, so as to facilitate optimized delivery.
Step 1: Create your first Bot via BotFather
How to interact with BotFather (detailed explanation of /newbot command)
- Search @BotFather in Telegram and click to enter the conversation.
- Send the
/newbotcommand. BotFather will ask you to enter the Bot’s name (the name displayed to users, such as “Customer Service Assistant”) and username (a unique identifier ending with_bot, such asmy_cs_bot). - After successful creation, BotFather will return a message containing your Bot Token - which is a string of keys similar to
123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11.
Token security warning
Bot Token is equivalent to your Bot password. Never share Tokens with untrusted third parties or upload them to public code repositories. If you suspect that your token has been leaked, reset it in BotFather immediately.
Notes on setting Bot name and username
- Uniqueness: The username is globally unique in Telegram. If it prompts that it is already occupied when creating it, you need to change it.
- Searchability: The shorter the username and the closer it is to the business keywords, the easier it is for users to find it. For example,
shop_cs_botis better thanmy_shop_customer_support_bot_2025. - Name and Description: After creating a Bot, you can set an introduction through BotFather’s
/setdescriptionand/setabouttextto let users know what your Bot does. The TG-Staff console also supports editing this information directly without returning to BotFather.
Step 2: Understand the basics of Bot architecture and customer service system
The typical message flow of a Telegram Bot is:
- The user sends a message to the Bot.
- The Telegram server sends the message to your backend server via Webhook or long polling.
- The backend processes the logic, generates a reply, and returns it to the user through the Telegram API.
If you develop your own backend, you need to deal with a series of issues such as message parsing, session management, multi-agent allocation, and persistent storage. TG-Staff, as the middle layer, completes these tasks for you: you only need to enter the Bot Token into the console, and TG-Staff will automatically set up a Webhook to convert user messages into customer service tickets that can be operated by web agents. The agent replies in the browser and the message is automatically sent back to the Telegram user via the TG-Staff server.
This means that you don’t need to write a single line of code to get a multi-agent, shuntable, and automatic translation customer service system.
Step 3: Connect the Bot to the TG-Staff platform
- Visit TG-Staff Console, register and log in.
- Click “Create New Project” and enter the project name (such as “Official Customer Service”).
- In the Bot Token input box, paste the Token you obtained from BotFather. Click Bind.
- After successful binding, TG-Staff will automatically take over your Bot. At this time, any user who sends a message to the Bot will be displayed as a pending session in the “Conversations” list of the console.
Multi-Bot project management
TG-Staff supports managing multiple Bot projects under the same console. If you have multiple business lines (such as pre-sales Bot, after-sales Bot), just repeat the above steps to create a new project, and agents can switch between projects.
Step 4: Configure agents and diversion rules
Add agents and permission management
In the “Agent Management” of the console, you can add a staff account (Staff Seat). Each agent uses an independent account to log in to the web portal without interfering with each other. Depending on the package, 3/5/20 seat quotas are supported. You can also configure project permissions for each agent. For example, certain agents can only handle pre-sales sessions and cannot view post-sales sessions.
Set session diversion rules (rotating distribution/online priority)
When multiple users consult at the same time, the system needs to decide which agent will receive the call. TG-Staff provides two diversion rules:
| Diversion rules | Working mechanism | Applicable scenarios |
|---|---|---|
| Allocation in turns (default) | Polling authorized agents in order, each person is assigned a new session | Scenarios where the number of agents is fixed and the workload needs to be evenly distributed |
| Online priority | Priority will be assigned to the currently online agents, and the assignment will be taken in turns when all are offline | Scenarios where agents’ duty hours are not fixed and quick response is expected |
You can switch rules at any time in the project settings without restarting the bot.
Create diversion links to track user sources
Diversion Link is a short link under the official domain name of TG-Staff (such as https://app.tg-staff.com/{code}). When a user clicks on the link, TG-Staff will capture the visitor’s IP, browser information, and URL parameters, and then jump to your Telegram Bot. You can create different diversion links for different advertising channels (such as ?utm_source=google, ?utm_source=facebook) and see the source of each user in the conversation list. This is very useful for advertising attribution and channel performance evaluation.
Operation steps: On the “Diversion Links” page of the console, create a new link, set the parameters, and paste the link into the advertising backend or social media post.
Step 5: Optimize customer service experience—visualized process and automatic translation
Reduce duplication of effort with drag-and-drop process editor
When the user sends the first message, what should the bot reply to? Is it a simple greeting or a presentation of the menu? TG-Staff’s visual process editor allows you to build welcome messages and multi-step interactions with zero code. For example:
- The user sends
/start→ Bot replies “Welcome! Please choose: 1. Product consultation 2. After-sales 3. Transfer to manual” - The user selects “Product Consultation” → Bot automatically replies to the product catalog and creates a session assigned to the agent
The process editor is drag-and-drop. You don’t need to know programming, just connect the nodes (messages, conditions, jumps).
Automatic translation improves multi-language response efficiency
In cross-border business, users may ask questions in English, Chinese, or Spanish. After automatic translation is turned on, messages received by the agent will be automatically translated into the language set by the agent; when the agent replies, the message will also be translated back to the user’s language. The standard version includes AI translation, and the professional version additionally supports Google professional translation and DeepL professional translation, with daily quotas based on packages. After the translation function is turned on, agents do not need to switch translation tools and can see the original text and translation directly in the reply box, which significantly improves efficiency.
Step Six: Advanced Functions—Content Risk Control and User Portraits
Use content risk control to prevent the mistaken release of sensitive information
If your business involves cryptocurrencies, exchanges, or NFTs, agents may mistakenly or illegally send payment addresses when replying, posing compliance risks. The content risk control (internal control management) function of TG-Staff Professional Edition allows you to configure risk phrases, including ordinary text and encrypted wallet addresses (such as TRC20/ERC20/BTC addresses or address fragments). When the message sent by the agent hits a risk word, the system will pop up a secondary confirmation window or directly block the sending. All trigger records will be audited, allowing managers to view agents, sessions, trigger times and risk words.
For example, you can create a “wallet address” risk phrase and add it to the list of payment addresses used by your company. If these addresses appear in the agent’s reply, the system will prompt “This message contains sensitive wallet addresses, please confirm whether to send it.” This effectively prevents human error.
Use user portraits to improve service quality
The professional version also provides user portraits and statistics. You can view each user’s historical session records, tags, and consultation frequency to determine whether the user is consulting for the first time or is an old customer, and whether he or she needs priority service. Combined with conversation tags (such as “high intent” and “complaint”), agents can understand the background before taking over the conversation and avoid repeated inquiries.
FAQ
Q: What should I do if the Token is lost when creating a Bot?
Answer: Open @BotFather in Telegram, send the /mybots command, select your Bot, and click “API Token” to view or reset.
Q: Can one Bot Token be bound to multiple customer service platforms? Answer: No. A Bot Token can only be taken over by one server (such as TG-Staff). If you need multiple platforms, you need to create multiple Bots.
Q: What are the restrictions during the free trial period of TG-Staff? Answer: The free trial period is 3 days, during which you can experience the standard version features, including agents, session offloading, offloading links, etc. After expiration, you need to subscribe to the package to continue using it. Please check the [Official Package Page] (https://tg-staff.com/) for specific package prices.
Q: How to ensure that the customer service bot is discoverable in the user group? Answer: Set the “About” and “Description” fields of the Bot in BotFather, and make sure the Bot username is concise and easy to remember. The TG-Staff console also supports direct editing of this information.
Q: What types of sensitive words does the content risk control function support monitoring? Answer: Supports custom risk phrases, including ordinary text, encrypted wallet addresses (such as TRC20/ERC20/BTC addresses or address fragments), etc. After triggering, the agent will receive a pop-up confirmation or the message will be blocked.
The entire process from BotFather creation to TG-Staff configuration completion only takes ten minutes. If you are looking for a Telegram customer service system that does not require development, you may wish to [sign up for a free trial of TG-Staff] (https://app.tg-staff.com/) to experience agents, diverted links and automatic translation. For more configuration details, please refer to Official Documentation. If you have any questions, please contact customer service Bot @tgstaff_robot directly.
Related Articles
Building Telegram customer service system from scratch: visual command process and manual configuration tutorial
This tutorial teaches you step by step how to build a Telegram customer service system using a visual command process, covering the welcome message, FAQ menu and manual node configuration. No coding is required, and a professional customer service bot can be quickly launched in TG-Staff with zero basic knowledge. It is suitable for overseas teams and community operations.
Build Telegram Bot to manual customer service system from scratch: automatic transfer SOP and missed connection troubleshooting guide
Teach you step by step how to set up a Telegram Bot customer service system to achieve seamless transfer from Bot to manual agent automatically. Covers manual SOP configuration, session diversion rules, diversion link settings and troubleshooting of common missed connections. Perfect for B2B teams using tools like TG-Staff.
Build your own bot or use SaaS? Comparison of construction time, cost and maintenance of building Telegram customer service system
Want to build a Telegram customer service system, but are confused whether to build your own Bot or use a SaaS platform? This article makes an in-depth comparison between the self-built solution and mature platforms such as TG-Staff from the three core dimensions of construction period, cost, and maintenance, to help you make the optimal decision.