[GH-ISSUE #5307] [Feature]: Suggestion to add functionality to the Telegram bot menu button. #3719

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

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

It is recommended to add the following functions to the Telegram bot menu buttons:
/functions – Get detailed menu content
/status – Get system status
/restart – Restart the Xray service
/clearall – Clear traffic data for all nodes with one click
/help – Get further assistance

Image

Describe the solution you'd like

It is recommended to add the following functions to the Telegram bot menu buttons:
/functions – Get detailed menu content
/status – Get system status
/restart – Restart the Xray service
/clearall – Clear traffic data for all nodes with one click
/help – Get further assistance

Image

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 @zixu5u on GitHub (Jun 14, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5307 ### Is your feature request related to a problem? It is recommended to add the following functions to the Telegram bot menu buttons: /functions – Get detailed menu content /status – Get system status /restart – Restart the Xray service /clearall – Clear traffic data for all nodes with one click /help – Get further assistance <img width="551" height="394" alt="Image" src="https://github.com/user-attachments/assets/7a727408-4dc1-4a54-9867-dcf4b723befb" /> ### Describe the solution you'd like It is recommended to add the following functions to the Telegram bot menu buttons: /functions – Get detailed menu content /status – Get system status /restart – Restart the Xray service /clearall – Clear traffic data for all nodes with one click /help – Get further assistance <img width="572" height="390" alt="Image" src="https://github.com/user-attachments/assets/f29487b3-73ea-4651-b5d4-733c353287ed" /> ### 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. - [x] 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:34:28 +07:00
Author
Owner

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

Investigated the current source to clarify what already exists and what would be new work.

What is already implemented

Requested command Slash command handler BotFather menu entry
/help Yes (answerCommand, tgbot_router.go:186) Yes (SetMyCommands, tgbot.go:282)
/status Yes (tgbot_router.go:195) Yes (tgbot.go:284)
/restart Yes, admin-only (tgbot_router.go:219) No — missing from SetMyCommands
/clearall No slash command No
/functions No slash command No

The "reset all traffic" action already exists as an inline-keyboard button reachable from the admin keyboard (tgbot_send.go:31, callback handler reset_all_traffics_c at tgbot_router.go:1437). It calls InboundService.ResetAllTraffics() and iterates via ClientService, which covers all nodes. There is no /clearall text command that triggers the same flow.

The SetMyCommands call that populates BotFather's "/" suggestion list is in internal/web/service/tgbot/tgbot.go:280–287 and currently registers only /start, /help, /status, and /id.

What a PR would need to change

  1. Register /restart in SetMyCommands (tgbot.go:280–287) — one-line addition; the handler already exists.
  2. Implement a /clearall command handler in answerCommand (tgbot_router.go) that (a) checks isAdmin, (b) sends a confirmation prompt, and (c) on confirmation calls inboundService.ResetAllTraffics(). The underlying service method is already present. Register the command in SetMyCommands as well.
  3. /functions is functionally identical to the existing /help command, which already returns the admin keyboard listing available actions. Merging the two or making /functions an alias for /help would be the simplest path.

A note on scope: ResetAllTraffics resets per-client counters, not node-level inbound traffic. The behaviour is the same as what "Clear All Traffic" does in the existing keyboard flow.

A similar request was previously opened as #2665 (same author, now closed without resolution). If you are willing to submit a PR, the areas above are the minimum diff required.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4700437270 --> @github-actions[bot] commented on GitHub (Jun 14, 2026): Investigated the current source to clarify what already exists and what would be new work. **What is already implemented** | Requested command | Slash command handler | BotFather menu entry | |---|---|---| | `/help` | Yes (`answerCommand`, `tgbot_router.go:186`) | Yes (`SetMyCommands`, `tgbot.go:282`) | | `/status` | Yes (`tgbot_router.go:195`) | Yes (`tgbot.go:284`) | | `/restart` | Yes, admin-only (`tgbot_router.go:219`) | **No** — missing from `SetMyCommands` | | `/clearall` | **No slash command** | **No** | | `/functions` | **No slash command** | **No** | The "reset all traffic" action already exists as an inline-keyboard button reachable from the admin keyboard (`tgbot_send.go:31`, callback handler `reset_all_traffics_c` at `tgbot_router.go:1437`). It calls `InboundService.ResetAllTraffics()` and iterates via `ClientService`, which covers all nodes. There is no `/clearall` text command that triggers the same flow. The `SetMyCommands` call that populates BotFather's "/" suggestion list is in `internal/web/service/tgbot/tgbot.go:280–287` and currently registers only `/start`, `/help`, `/status`, and `/id`. **What a PR would need to change** 1. **Register `/restart` in `SetMyCommands`** (`tgbot.go:280–287`) — one-line addition; the handler already exists. 2. **Implement a `/clearall` command handler** in `answerCommand` (`tgbot_router.go`) that (a) checks `isAdmin`, (b) sends a confirmation prompt, and (c) on confirmation calls `inboundService.ResetAllTraffics()`. The underlying service method is already present. Register the command in `SetMyCommands` as well. 3. **`/functions`** is functionally identical to the existing `/help` command, which already returns the admin keyboard listing available actions. Merging the two or making `/functions` an alias for `/help` would be the simplest path. A note on scope: `ResetAllTraffics` resets per-client counters, not node-level inbound traffic. The behaviour is the same as what "Clear All Traffic" does in the existing keyboard flow. A similar request was previously opened as #2665 (same author, now closed without resolution). If you are willing to submit a PR, the areas above are the minimum diff required. *This reply was generated automatically; a maintainer may follow up.*
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#3719
No description provided.