mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5318] [Feature]: Show inbound remark alongside username for online clients in Telegram bot #3726
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3726
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xingshuwen03-prog on GitHub (Jun 14, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5318
Is your feature request related to a problem?
I am always frustrated when checking 'Online Clients' via the Telegram bot, as it only displays the client's username. Since I have set up multiple inbounds for different servers (e.g., 'USA' and 'Japan'), I cannot determine which specific inbound a user is currently connected to just by looking at the TG bot. This forces me to manually log into the web panel to check their connection details, completely defeating the convenience of using the bot.
Describe the solution you'd like
I am always frustrated when checking 'Online CliI would like the Telegram bot to dynamically append the "Inbound Remark" to the client's username when displaying the "Online Clients" list.
TelegramBot UI / Output Format: The display format should change from {username} to {username} - {inbound_remark}. For example, if a client user connects via an inbound with the remark USA, it should display user - USA.
Backend / API Structure: The backend service (specifically within internal/web/service/tgbot/ and the Xray stats service) needs to fetch and map the inbound remark name to the active client's connection data before sending the message payload to the Telegram bot.
Configuration Keys: This feature could be enabled by default, or a new toggle could be added to the Panel Settings (e.g., a boolean key like tgBotShowInboundRemark: true).
Alternatives you've considered
I currently have to log into the web panel manually to check the "Inbounds" or "Clients" page to see the specific connection path. While this works as a temporary workaround, it falls short because it completely defeats the purpose of having a Telegram bot for quick, on-the-go monitoring. It adds unnecessary steps and friction to a task that should be instantly accessible via the bot.
Concrete use case
No response
Mockups, screenshots, or examples
No response
Which parts of the panel would this affect?
Telegram bot
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Jun 14, 2026):
The request is valid and the architecture supports it. Here is a precise description of what would need to change.
Current behavior (confirmed in source)
onlineClients()ininternal/web/service/tgbot/tgbot_report.go(line 363) callsservice.XrayProcess().GetOnlineClients(), which returns a flat[]stringof client email addresses with no inbound metadata. Each entry is displayed as-is as an inline keyboard button label (line 377). The inbound remark is not part of this data path at all.Why the data is available
The
InboundServicealready exposesGetClientInboundByEmail(email string) (*xray.ClientTraffic, *model.Inbound, error)(confirmed ininternal/web/service/inbound_clients.go, line 385). The returned*model.Inboundhas aRemarkfield. The tgbot already uses this field in other views (for example,tgbot_report.go:246andtgbot_inbound.go:28both renderinbound.Remark), andt.inboundServiceis already available inside the tgbot struct whereonlineClients()is defined.One complication to be aware of
A client email can be attached to more than one inbound.
GetClientInboundByEmailreturns only the first traffic row found (line 368:traffic = traffics[0]). In a multi-inbound setup the remark appended to the label would reflect whichever inbound the DB returns first, not necessarily the one the client is currently connected through. An implementation that wants to be accurate about the active inbound would need a different data source; however for the common single-inbound-per-client case the simpler approach would work.Scope of the change
The minimal change required is:
onlineClients()(internal/web/service/tgbot/tgbot_report.go), for eachonlineemail string, callGetClientInboundByEmailand appendinbound.Remarkto the button label, while keepingonlineas the callback data so the existingclient_get_usagerouting still works.No changes to
internal/xray/process.goor the gRPC stats layer are needed.This reply was generated automatically; a maintainer may follow up.