Repository navigation
Description
Type: enhancement
Area: Telegram bot
Addressed by: PR 1 of 4 (feat(telegram): register the bot command menu with setMyCommands)
Summary
The bot implements 27 commands, but nothing advertises them. Tapping the /
menu button in a Telegram chat shows an empty list, because the bot never
calls setMyCommands.
The only in-band pointer is /mp_help — which a user has to already know exists.
Impact
- Public self-service is effectively unusable. The entire point of the public
tier (/start,/my_status <label>,/redeem) is that an end user can check
their own quota and expiry without an admin walking them through it. In
practice they cannot discover the commands, so every new user becomes an admin
support request. - Admins under-use the control plane. Commands like
/mp_digest,
/mp_fleetand/mp_trafficare not discoverable from the UI at all. - Role-scoped commands are indistinguishable from ones the user cannot run, so a
reseller has no way to see what they are actually permitted to do.
Reproduction
- Configure the bot with
mtproxymax telegram setup. - Open the chat with the bot on any Telegram client.
- Tap the
/menu button.
Expected: a list of the commands you are allowed to run.
Actual: an empty list.
Proposal
Register per-scope command lists with setMyCommands:
- A default scope for everyone, containing the public self-service commands.
- A chat scope per admin, containing the admin control plane.
- A chat scope for superadmins, additionally containing
/mp_remove,
/mp_restart,/mp_updateand/mp_lockdown.
Scopes should mirror the gates the dispatcher already applies, so the menu never
advertises something a role cannot run. On role revocation the chat's custom
scope should be deleted, so a demoted admin stops seeing the admin plane.
The list should be re-synced on bot service start, on role grant/revoke, at the
end of setup, and on demand via a CLI subcommand.
Acceptance criteria
- Tapping
/shows the public commands for an unauthenticated user. - An admin sees the admin control plane.
- A superadmin additionally sees the four privileged commands.
- A reseller sees only what it may actually run.
- Revoking an admin removes the admin commands from their menu.
- A Telegram outage during sync does not abort setup or stall the poll loop.
- The bot token never appears in the process list.
Activity
SamNet-dev commentedon Sep 29, 2026
Resolved by #140.
The bot now registers its command menus with Telegram via
setMyCommandsmatching the role model:TG_CMDS_PUBLIC(/start,/my_status,/redeem,/voucher,/support)TG_CMDS_SUPERADMIN(Admin control plane plus/mp_remove,/mp_restart,/mp_update,/mp_lockdown)TG_CMDS_ADMIN(Admin control plane without superadmin commands)Command menus automatically sync on service boot, setup wizard, and admin grants/revocations, or manually via
mtproxymax telegram sync-commands.Thank you @rvalitov!
feat(telegram): register bot command menu with setMyCommands (SamNet-…