Command Structuring

Base commands, Subcommands, Subcommand groups - what?

A base command is for example /help. It does not have any subcommands or groups.

/config on the other side has both - subcommands and subcommand groups.

Subcommands organize commands by specifying actions within a command or group.

Subcommand Groups organize subcommands by grouping subcommands by similar action or resource within a command.

Groups cannot be executed, they are just like folders within a file-like system.

Visual examples:

/command
|
|__ subcommand
|
|__ subcommand


/command
|
|__ subcommand-group
    |
    |__ subcommand
|
|__ subcommand-group
    |
    |__ subcommand


/command
|
|__ subcommand-group
    |
    |__ subcommand
|
|__ subcommand

Real-world Examples

/help             - just one base command


/blacklist        - base command
|
|__ add               - subcommand
|
|__ remove            - subcommand


/setup        - base command
|
|__ tickets      - subcommand group
    |
    |__ guided      - subcommand
    |
    |__ quick       - subcommand
|
|__ reports      - subcommand group
    |
    |__ guided      - subcommand
    |
    |__ quick       - subcommand

If you want to go more in-depth, take a look at the Developer Docs.

Last updated

Was this helpful?