[GH-ISSUE #5127] [Feature]: MTProto Promoted channel #3605

Closed
opened 2026-10-31 20:33:39 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @AmoAlireza on GitHub (Jun 9, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5127

Hi
MTProto already supports promoting channels using the command -S {PROMOTED_TAG}, and you can obtain the tag from the MTProxybot itself. If possible, please add this feature in the next update.

Describe the solution you'd like

add an optional field next to the secret in the UI where users can enter the tag received from the bot. Below this field, include a tip: "You should send this 32-character hex secret to the MTProxybot, as it only accepts secrets in this format."

Alternatives you've considered

No response

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?

  • I'd like to implement this feature myself and open a PR.
  • I can help test once a PR is open.

Before submitting

  • I searched existing issues and this feature has not been requested.
  • This feature request is written in English.
Originally created by @AmoAlireza on GitHub (Jun 9, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5127 ### Is your feature request related to a problem? Hi MTProto already supports promoting channels using the command -S {PROMOTED_TAG}, and you can obtain the tag from the MTProxybot itself. If possible, please add this feature in the next update. ### Describe the solution you'd like add an optional field next to the secret in the UI where users can enter the tag received from the bot. Below this field, include a tip: "You should send this 32-character hex secret to the MTProxybot, as it only accepts secrets in this format." ### Alternatives you've considered _No response_ ### 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? - [ ] I'd like to implement this feature myself and open a PR. - [ ] I can help test once a PR is open. ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested. - [x] This feature request is written in English.
bsakaguchi 2026-10-31 20:33:39 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jun 9, 2026):

Thanks for the feature request!

Important clarification about the underlying backend

3x-ui does not use the official Telegram MTProxy (the Python script that accepts -S <ad_tag>). Instead, MTProto inbounds are served by mtg v2.2.8 by 9seconds — a completely separate, third-party implementation. The -S PROMOTED_TAG command-line flag is exclusive to the official Telegram MTProxy and has no equivalent in mtg.

What the current implementation does

Each mtproto inbound in the panel spawns an mtg run <config.toml> sidecar process. The TOML config written by the panel today (see mtproto/manager.go → writeConfig) contains only:

secret  = "ee<hex>..."
bind-to = "0.0.0.0:<port>"

[stats.prometheus]
enabled     = true
bind-to     = "127.0.0.1:<metrics_port>"
http-path   = "/metrics"
metric-prefix = "mtg"

There is no field for a promoted-channel tag because mtg v2 dropped the ad-tag / promoted-channel feature. The v2 redesign made the proxy stateless and removed the ability to inject Telegram's "promoted channel" content into the stream — it is simply not configurable in the TOML format mtg v2 accepts.

What would be needed to implement this

For 3x-ui to support promoted channels, the project would need to either:

  1. Switch the MTProto backend from mtg to the official Telegram MTProxy (which does support -S <tag>), which is a significant architectural change.
  2. Find a maintained fork of mtg v1 that still has the ad-tag feature and is compatible with the current sidecar management code.

If you'd like to pursue this, opening a discussion with the maintainers about replacing or augmenting the backend would be the right starting point. A PR is very welcome, but any implementation will need to address the backend limitation first.

<!-- gh-comment-id:4658738083 --> @github-actions[bot] commented on GitHub (Jun 9, 2026): Thanks for the feature request\! **Important clarification about the underlying backend** 3x-ui does **not** use the official Telegram MTProxy (the Python script that accepts `-S <ad_tag>`). Instead, MTProto inbounds are served by [`mtg` v2.2.8 by 9seconds](https://github.com/9seconds/mtg) — a completely separate, third-party implementation. The `-S PROMOTED_TAG` command-line flag is exclusive to the official Telegram MTProxy and has no equivalent in `mtg`. **What the current implementation does** Each mtproto inbound in the panel spawns an `mtg run <config.toml>` sidecar process. The TOML config written by the panel today (see `mtproto/manager.go` → `writeConfig`) contains only: ```toml secret = "ee<hex>..." bind-to = "0.0.0.0:<port>" [stats.prometheus] enabled = true bind-to = "127.0.0.1:<metrics_port>" http-path = "/metrics" metric-prefix = "mtg" ``` There is no field for a promoted-channel tag because **`mtg` v2 dropped the ad-tag / promoted-channel feature**. The v2 redesign made the proxy stateless and removed the ability to inject Telegram's "promoted channel" content into the stream — it is simply not configurable in the TOML format mtg v2 accepts. **What would be needed to implement this** For 3x-ui to support promoted channels, the project would need to either: 1. Switch the MTProto backend from `mtg` to the official Telegram MTProxy (which does support `-S <tag>`), which is a significant architectural change. 2. Find a maintained fork of `mtg` v1 that still has the ad-tag feature and is compatible with the current sidecar management code. If you'd like to pursue this, opening a discussion with the maintainers about replacing or augmenting the backend would be the right starting point. A PR is very welcome, but any implementation will need to address the backend limitation first.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#3605
No description provided.