mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5288] [Feature]: A proposal to add the adTag function, which can be obtained from the MTProxy Admin Bot. #3700
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#3700
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 @cflowstudio on GitHub (Jun 13, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5288
Is your feature request related to a problem?
Yes, I can't add the adTag to the config, and there's no such functionality, but I'd like to have this small setting for MTProto.
Describe the solution you'd like
I want to add the adTag feature (the sponsor's channel above Telegram chats). This feature may not be useful for everyone, but it can help those who sell to advertise their Telegram channel and promote their Telegram sponsors.
Alternatives you've considered
I tried to solve it by editing the JSON file, but it didn't work.
Concrete use case
No response
Mockups, screenshots, or examples
No response
Which parts of the panel would this affect?
No response
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Jun 13, 2026):
The
adTagfield cannot be supported in the current MTProto implementation. Here is why.3x-ui's MTProto inbounds are backed by
mtg(github.com/9seconds/mtg), an independent open-source reimplementation of the MTProxy protocol — confirmed ininternal/mtproto/process.go(package comment) andinternal/mtproto/manager.go(renderConfig). The panel launches onemtgprocess per inbound and generates a TOML config for it.adTagis a feature of Telegram's official MTProxy C server (github.com/TelegramMessenger/MTProxy), not ofmtg. Themtgbinary has no concept of advertisement tags and its TOML config format has noadTagkey. Even if you embedadTagin the panel's stored settings JSON, two things prevent it from working:InstanceFromInboundininternal/mtproto/manager.goparses only the fields it knows (secret,fakeTlsDomain,domainFronting,routeThroughXray, etc.) and silently ignores all others.renderConfiggenerates the TOML passed tomtgand has no path that would ever emit anadTagline, becausemtgitself does not accept one.This is why editing the JSON manually had no effect.
For
adTagsupport to be possible in 3x-ui, the MTProto backend would need to be switched from (or augmented with) Telegram's official MTProxy binary, which would be a significant architectural change. This is a valid enhancement request, but its feasibility depends entirely on whethermtgor an alternative backend the project is willing to ship addsadTagsupport upstream.If you require
adTagtoday, the only working path is to run Telegram's official MTProxy server (TelegramMessenger/MTProxy) directly, outside of 3x-ui.This reply was generated automatically; a maintainer may follow up.
@MHSanaei commented on GitHub (Jul 3, 2026):
Thanks for the suggestion, but this is not something 3x-ui can implement with its current MTProto backend. Our MTProto inbounds are powered by mtg (9seconds/mtg v2), and mtg v2 intentionally removed ADTag support upstream — its configuration format has no adTag option at all, which is also why editing the inbound JSON has no effect.
Supporting adTag would require replacing mtg with Telegram's official MTProxy server, a different proxy implementation and out of scope for the panel. If you need adTag today, running TelegramMessenger/MTProxy directly alongside the panel is the working option; if mtg ever reintroduces ADTag upstream, we'd be happy to revisit.