Skip to content

[Feature]: Configurable order of bot commands in Telegram menu #208

Description

@Johell1NS

Problem

The Telegram command menu (shown with / in chat) is generated by the bot via setMyCommands, but the command order is fixed and hardcoded in the COMMAND_DEFINITIONS array in src/bot/commands/definitions.ts.

As a result, every user is forced to scroll through the whole list to find the commands they use most often (e.g. /projects, /task, /commands), even when those are at the bottom of the menu. Usage frequency is subjective: the current order reflects a single choice, but other users have different needs. There is no way to reorder the menu without modifying the code.

Proposal

Make the command menu order configurable, e.g. via an environment variable (in the style of the other options already present in config.ts):

  • COMMANDS_ORDER (or an equivalent name): ordered list of commands, comma-separated (e.g. new,abort,projects,status).
  • Listed commands are shown first, in the given order.
  • Unlisted commands are appended at the end, keeping their default order.
  • If the variable is unset (or empty), behavior stays identical to the current one (backward compatible).

The implementation would be limited to src/bot/commands/definitions.ts (reordering the COMMAND_DEFINITIONS array in getLocalizedBotCommands()) plus a new option in src/config.ts, with the same structure as getOptionalPathListEnvVar already used for PROJECTS_EXCLUDED_PATHS (see PR #197).

Done criteria

  • The Telegram menu reflects the order configured via COMMANDS_ORDER.
  • Without the variable set, the order stays the current one.
  • Commands not listed in the variable are appended at the end in their default order.
  • The variable is documented in the README / .env.example.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions