Skip to content

feat: add sub id and flow customization in tgbot client-creation menu#3882

Open
rydve wants to merge 8 commits intoMHSanaei:mainfrom
rydve:feature/tgbot-new-client-creation-params
Open

feat: add sub id and flow customization in tgbot client-creation menu#3882
rydve wants to merge 8 commits intoMHSanaei:mainfrom
rydve:feature/tgbot-new-client-creation-params

Conversation

@rydve
Copy link
Contributor

@rydve rydve commented Mar 4, 2026

What is the pull request?

Added the ability to customize Sub ID and Flow settings directly via the Telegram bot for supported protocols (VLESS, VMESS, Trojan, Shadowsocks).

  • Customization: Users can now set a specific Sub ID and choose the Flow (xtls-rprx-vision, xtls-rprx-vision-udp443 and Empty) during client creation in the bot.
  • Note: The Flow configuration is only applicable and available for VLESS inbounds configured with TCP(raw) transport using TLS or Reality security.
  • Localization: Updated all 13+ language files (.toml) to include the new UI elements, ensuring consistent support across all locales.
  • Note: Normalized CRLF to LF in translate.vi_VN.toml and translate.es_ES.toml. Use "Hide whitespace" in diff to see the actual changes.

Resolves #3881, #3700

Which part of the application is affected by the change?

  • Frontend
  • Backend

Type of Changes

  • Bug fix
  • New feature
  • Refactoring
  • Other

Screenshots

image image image image

@rydve rydve changed the title feat(tgbot): Sub ID and Flow in client-creation menu feat(tgbot): add sub id and flow customization in client-creation menu Mar 4, 2026
@MHSanaei MHSanaei requested a review from Copilot March 4, 2026 10:39

This comment was marked as outdated.

@rydve rydve marked this pull request as draft March 4, 2026 16:28
rydve added 2 commits March 4, 2026 23:07
…port

- Display "Sub ID" and "Flow" with correct HTML formatting (bold/monospace) in the final client creation summary.
- Fix RTL (Right-to-Left) alignment for Arabic and Persian languages by introducing localized labels for "Sub ID" and "Flow".
- Implement robust Unicode regex validation (`^[\p{L}\p{N}\-_]+$`) for Sub ID to block URI-breaking special characters and spaces while allowing multi-language input.
- Fix a bug where an invalid Sub ID was still saved to the global state despite failing validation.
- Fix a critical state-handling bug in `SendMsgToTgbotDeleteAfter` that prematurely deleted user states and caused the bot to ignore user inputs.
- Add success alerts for Flow selection and self-deleting messages on cancellation.
- Add a fallback mechanism for missing localization keys to prevent the bot from silently hanging during error reporting
- Update all 13 `.toml` localization files with new keys (`invalid_subid`, `client_subid`, `client_flow`).
@rydve rydve marked this pull request as ready for review March 4, 2026 20:30
@rydve
Copy link
Contributor Author

rydve commented Mar 4, 2026

🔄 UPD (improvements & fixes):

  • Robust Sub ID Validation: Added Unicode regex validation (^[\p{L}\p{N}\-_]+$) to prevent spaces and URI-breaking special characters, while fully supporting multi-language input (Cyrillic, Chinese, etc.).
  • Bot State Fixes: Fixed a critical background bug where the message auto-delete timer (SendMsgToTgbotDeleteAfter) prematurely wiped user states, causing the bot to ignore inputs during client creation.
  • RTL Support: Fixed Right-to-Left text alignment in the summary card for Arabic and Persian languages.

📸 Updated Screenshots:

image image image image image

This comment was marked as outdated.

@rydve rydve changed the title feat(tgbot): add sub id and flow customization in client-creation menu feat: add sub id and flow customization in tgbot client-creation menu Mar 5, 2026
@MHSanaei MHSanaei force-pushed the main branch 2 times, most recently from 0dc4df2 to f0f98c7 Compare March 17, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] No Flow and Subcription name in telegram client creation menu

3 participants