TG Bot and TG-Staff Integration in Practice: Connect Your Telegram Bot to the Web Agent Workbench
关于作者
TG-Staff 致力于为 Telegram Bot 运营团队提供高效、可靠的客服与营销 SaaS 工具。
TG Bot and TG-Staff Integration Guide: Connect Your Telegram Bot to a Web Agent Workspace
If you are running a Telegram Bot and want to add human customer support, integrating your tg bot with TG-Staff is a solution worth considering. TG-Staff is a customer service and operations SaaS platform for Telegram Bots, unifying bot management, team collaboration, session routing, and traffic attribution in a single web console. This article will guide you through the complete process from registration, configuration, to live operation.
Why Connect Your TG Bot to TG-Staff Workspace?
Before diving in, let’s answer a core question: Why not just use the Bot’s API or third-party bots to manage customer service?
Three Major Bottlenecks of Traditional Bot Customer Service
- Single user, single device, no team collaboration: Telegram’s native Bot can only handle messages from one account. When a team needs multiple agents to serve users simultaneously, they either have to take turns logging into the same account or make users wait, resulting in a poor experience.
- Lack of session routing and user tracking: No session queues, no assignment records. If an agent goes offline, user messages are lost and cannot be automatically transferred to another agent.
- Operational data is hard to capture: You can’t know which channel each user came from, how many conversations they had, or the conversion rate. Ad attribution analysis is impossible.
How TG-Staff Solves These Problems
- Multi-agent simultaneous service via web console: Each agent has an independent account. They log into the web portal and can handle Telegram user conversations in real time. Supports session transfer, assignment records, and collaboration notes.
- Attribution links for ad tracking: With TG-Staff’s short links, you can capture visitor IP, browser info, and URL parameters (e.g., utm_source). Ad → attribution link → Bot auto-reply → human agent creates a complete conversion funnel.
- User profiles and statistics for operational decisions: The Pro version offers user profiles and session statistics, allowing you to understand user active hours, common languages, and session duration, helping optimize service strategies.
Prerequisites: What You Need
Before starting integration, ensure you have:
- A Telegram Bot created by BotFather with a full HTTP API Token (format like
123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11). - A TG-Staff account: Register at app.tg-staff.com to get a 3-day free trial.
- Determine your plan: The free trial includes all Standard features. If your team has more than 3 agents, or you need content moderation, unlimited translation, etc., consider the Pro plan. See pricing at official pricing page.
- Ensure your Bot has privacy mode disabled: In BotFather, send
/setprivacy, select your Bot, and set it toDisable. Otherwise, the Bot won’t receive messages not starting with/.
Tip
If you are not familiar with how to disable private mode, please refer to the “Bot Connection Guide” section in the TG-Staff official documentation.
Step 1: Create a Project and Connect Your Bot in the TG-Staff Dashboard
Log in to app.tg-staff.com and go to the dashboard homepage.
- Click “Projects” in the left menu, then click “Create Project”.
- Name your project (e.g., “Official Customer Service Bot”) and enter your Bot Token.
- Click “Connect”. The system will verify the token and automatically fetch the bot’s name and avatar.
- Once connected, you can see the bot’s online status and recent message history on the project details page.
After connecting, TG-Staff will automatically start receiving all user messages. Your bot now has multi-agent capability, but no agents have been assigned yet.
Step 2: Configure Agents and Team Permissions
Two Ways to Add Agents
- Manual Addition: On the “Agent Management” page, click “Add Agent”, enter the agent’s Telegram username or email, and set an initial password. The system will automatically generate a login account.
- Invitation Link: Generate an invitation link on the agent management page and send it to team members. They can click the link to register and bind their Telegram ID, automatically becoming agents.
Best Practices for Permission Assignment
TG-Staff supports project-specific agent permissions. Here is a typical role permission configuration:
| Role | Typical Permissions | Use Case |
|---|---|---|
| Admin | All projects, all operations (including agent management, plan management) | Team lead or technical maintenance |
| Customer Service | Session handling for specified projects, user profile viewing | Frontline support staff |
| Operations | Session handling for specified projects, routing link management, bulk messaging | Operations responsible for traffic and user outreach |
Recommendation: Do not assign admin permissions to all agents. If an agent only needs to handle customer inquiries, assign them the “Customer Service” role for the corresponding project. This prevents accidental misoperations like deleting project configurations or modifying plans.
Step 3: Set Up Session Routing and Routing Links
Session routing determines how new user messages are assigned to agents. TG-Staff offers two routing rules:
- Round Robin (default): Agents with permissions are cycled through in order, ensuring roughly equal workload.
- Online First: Priority is given to agents who are currently online. If all agents are offline, it falls back to round robin.
In the project settings, find “Session Routing”, select your preferred rule, and specify the agent scope (“All Agents” or “Specific Agents”).
Generate Routing Links
Routing links are a signature feature of TG-Staff, used to direct external traffic (ads, social media posts) to your bot and automatically trigger human agent engagement. Steps:
- In project settings, click “Routing Links”.
- Click “Generate Link” to create a short link like
https://app.tg-staff.com/abc123. - Embed this link in your ads, social media posts, or website landing pages.
- When users click the link, the system automatically captures IP, browser info, and URL parameters, then redirects to your bot with a preset message (e.g., “Hello, how can I help you?”).
- The session automatically enters the queue and is assigned to an online agent based on the routing rule.
Important Notes
Split links are only available for Standard plans and above. If your plan does not show this feature, please upgrade or contact support.
Step 4: Build Automated Reception with Visual Command Flows
Before human agents step in, your bot needs to handle common questions. TG-Staff offers a drag-and-drop flow editor that lets you build welcome messages, menus, and multi-step interactions with zero code.
- Go to the “Command Flow” module and click “New Flow.”
- Drag the “Welcome Message” node from the left to the canvas, and edit the content (e.g., “Welcome to official customer service. Please enter a number to choose a service: 1. Product Inquiry 2. After-Sales Issues 3. Transfer to Agent”).
- Drag the “Menu” node and configure button options. Each button can link to another flow node or trigger a transfer to an agent.
- Drag the “Transfer to Agent” node and configure the automatic prompt when transferring (e.g., “Transferring you to a human agent, please wait…”).
- Save and publish the flow. From then on, all new users will first go through this automated flow, and only when they choose to transfer or enter specific keywords will they enter the agent queue.
Best Practice: Don’t put all logic in the automated flow. For complex issues or emergencies, get users to the agent queue as quickly as possible to avoid losing them due to waiting.
Step 5: Launch Testing and Operations Checklist
After integration, we recommend conducting a full-link test according to the following checklist:
- Bot Connection Test: Send a message to your bot in Telegram, and confirm it appears in real-time in the console’s “Message Log.”
- Agent Login Test: Log in to the web console with an agent account, and confirm you can see the conversation and reply.
- Conversation Routing Test: Have two agents online simultaneously, send a second message, and confirm that the conversation distribution rules take effect (round-robin or online priority).
- Split Link Test: Click the split link in an incognito browser, confirm it redirects to the bot and automatically sends a preset message; then check the attribution info (IP, browser, URL parameters) for that conversation in the console.
- Auto Translation Test: If translation is enabled, send a message in a non-Chinese language and confirm the agent sees the translated text.
- Content Moderation Test (Pro Edition): If risky phrases are configured, try sending a message containing keywords and confirm that the agent side triggers a popup or interception.
Frequently Asked Questions
Q: What should I do if I get a Token invalid error when connecting the bot?
A: Make sure you obtained the full HTTP API Token from BotFather (format like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11) without extra spaces. If it still doesn’t work, try regenerating it in BotFather after /revoke.
Q: An agent logged in but sees no conversations. How to troubleshoot? A: Check the following three items: ① Whether the agent account has been assigned permissions for this project; ② Whether the conversation distribution rules include this agent; ③ Whether the bot has received new user messages (check the message log in the console).
Q: Can split links be used for Google Ads tracking? A: Yes. Split links automatically capture visitor IP, browser info, and URL parameters (including utm_source, etc.). You can view the attribution source for each conversation in the console for ad performance analysis.
Q: Can I use all features during the free trial? A: Yes. You get a 3-day free trial upon registration, during which you can experience all standard features (including split links and agents). After expiration, you need to choose a plan and renew to continue using.
Q: How do I migrate existing bot user data to TG-Staff?
A: TG-Staff does not require user data migration. Just connect your bot token to the console, and new messages will automatically enter the system. Historical messages can be manually pulled via the Bot API’s getUpdates method, but we recommend starting fresh with new conversation records.
Summary and Next Steps
Through the five steps above, you have successfully connected your tg bot to the TG-Staff unified console. Now your team can collaborate on customer service conversations from the web workstation, track ad conversions with split links, and automate reception with visual flows. The entire integration requires no coding—just configuration in the console.
Next, we suggest you:
- Click app.tg-staff.com for a 3-day free trial to experience the full features.
- Check the official documentation to learn about advanced configurations (e.g., custom commands, data export).
- If you encounter any issues, contact @tgstaff_robot directly for one-on-one technical support.
Related Articles
TG Bot 7-Day Launch Checklist: Complete Audit Items from Bot Creation to Agent Routing and Quality Assurance
Quickly launch a Telegram Bot customer service system in 7 days. Provides an actionable launch checklist covering bot creation, agent configuration, conversation routing, content quality assurance, and landing page attribution. Suitable for operations and overseas teams using TG-Staff, with FAQs included.
Google vs Bing Search Optimization: Only TG, TG Bot, and Telegram Bot Keyword Matrix
Master the search differences between Google and Bing, build a keyword matrix for only TG, TG Bot, and Telegram Bot, and boost SEO rankings. This guide provides actionable long-tail keyword strategies and internal linking plans to help Telegram operations teams acquire precise customers.
Only TG TG Bot Telegram Bot Triangular Keyword SEO Layout: Guide to Avoiding Cannibalization
Avoid SEO cannibalization among Only TG, TG Bot, and Telegram Bot triangular keywords. This article teaches you how to win independent rankings for each keyword on Google and Bing through content planning, page structure, and internal linking strategies, while boosting overall traffic.