mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6986] [MERGED] fix(tgbot): restore the admin's client link and QR buttons #6562
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#6562
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?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6986
Author: @muditagrawal2007
Created: 10/28/2026
Status: ✅ Merged
Merged: 11/3/2026
Merged by: @MHSanaei
Base:
main← Head:fix/tgbot-admin-client-links📝 Commits (4)
b5ff50bfix(tgbot): restore the admin's client link and QR buttons8e98631Merge remote-tracking branch 'origin/main' into pr/69865768d0ddocs(tgbot): drop the mocked-up client card screenshots2d09348test(tgbot): keep the admin client card tests with the other screen tests📊 Changes
6 files changed (+163 additions, -6 deletions)
View changed files
📝
docs/content/docs/en/operations/telegram-bot.mdx(+5 -2)📝
docs/content/docs/fa/operations/telegram-bot.mdx(+2 -0)📝
docs/content/docs/ru/operations/telegram-bot.mdx(+5 -3)📝
docs/content/docs/zh/operations/telegram-bot.mdx(+3 -1)📝
internal/web/service/tgbot/screen_legacy.go(+6 -0)📝
internal/web/service/tgbot/screens_test.go(+142 -0)📄 Description
Summary
Restores the admin's ability to open a client's subscription link and QR code from the Telegram bot. The v3.11.0 bot rebuild (#6760) replaced the admin menu, and the client card — the one screen every admin path ends at — was left with no link or QR button. An invite link was the only way to hand a config over, and it needs the client to reach Telegram first, which is exactly what a client in a censored network cannot do yet.
The card now carries two buttons again: 🔗 Links (subscription URL + individual links) and 🔳 QR code (the codes as one picture).
Why
Closes #6984.
The reporter's catch-22 is the real blocker: the client needs the VPN to reach Telegram, and needs Telegram to get the VPN. Before v3.11.0 the admin menu had three buttons for exactly this — Subscription settings, Individual links and QR code — and the rebuild dropped all three.
15fee2a0^:internal/web/service/tgbot/tgbot_send.go:50-54had them;internal/web/service/tgbot/screen_view.go:38-88does not.The screens themselves were never removed:
screenClientLinks(screen_client_views.go:154) draws the subscription URL and the individual links,screenClientQR(screen_client_views.go:209) draws the codes as one picture,client_sub_links/client_qr_linkscallbacks are still routed for admins (tgbot_router.go:414-422) and still carry the ownership check for everyone else (tgbot_router.go:1211).Only the entry point was lost: the card every admin route ends at had no button leading to them. So the fix is the two buttons — no new handler, no new state, no new callback.
The flow, end to end
Home → 👥 Clients → 👥 All Clients → (client browser) → client card → 🔗 Links → subscription URLThe card is also reachable without the inline browser via
/usage <email>, so the flow works whether or not inline mode is enabled in @BotFather.What an admin gets
vless:///trojan:/// … linksType of change
Areas affected
How was this tested?
New Go tests —
internal/web/service/tgbot/tgbot_admin_client_links_test.go:TestAdminClientCardOffersTheLinksAndQRCode— the admin's client card carriesclient_sub_links <email>andclient_qr_links <email>. This is the regression test: it fails onv3.11.0with "the admin's client card lacksclient_sub_links …".TestAdminTappingTheClientCardLinksDrawsTheSubscription— the button is not decoration: the callback the card itself offers is fed back through the router, and the links screen must come up carrying the subscription URL.TestAdminTappingTheClientCardQRCodeDrawsTheCode— same for the QR sheet.All three were written first and watched fail for the reported reason; the fix is 6 lines in
internal/web/service/tgbot/screen_legacy.go.Locally
By hand — as an admin:
/start→ 👥 Clients → 👥 All Clients → pick a client → 🔗 Links shows the subscription URL and 🔳 QR code shows the picture. As a client:/startstill shows only your own links, and a link callback carrying another client's email is still refused (TestClientLinkCallbackRefusesForeignClient).Screenshots / recordings
The admin's client card, before and after:
What the admin lands on:
(The mockups are rendered from the bot's real keyboard — the buttons are the ones
clientRowsbuilds, not a drawing.)Breaking changes
None. The two buttons use callbacks the bot already routed, and no client-facing behaviour changes: a client's own menu is untouched, and the ownership check that refuses a foreign client's link callback is unchanged.
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
[PR #6986] fix(tgbot): restore the admin's client link and QR buttonsto [PR #6986] [MERGED] fix(tgbot): restore the admin's client link and QR buttons