# $commandInfo

`$commandInfo` **reads one field of a command**: its description in the language of the person, its sub-commands, its options, how to use it, or the module it belongs to.

## Syntax

```
$commandInfo[name;field;separator]
```

## Parameters

| Parameter | Description |
|---|---|
| `name` | Required. The name of the command, without the slash. |
| `field` | Optional. `description` (default), `exists`, `name`, `type`, `module`, `subcommands`, `options` or `usage`. |
| `separator` | Optional. Text between the items of `subcommands`, `options` and `usage`. Default `,`. |

## Return value

- **Type**: String
- `exists` gives `true` or `false`; `usage` gives one line per way to use the command, such as `/ticket open <reason> [note]`.

## JavaScript

`bc.command.info(name, field)` returns a boolean for `exists` and an array for `subcommands`, `options` and `usage`.

## Behavior

- `description` and `name` use the translations of the command when the person's language has one.
- `module` is the identifier of the module that installed the command, empty for your own commands.
- Sub-commands inside a group are written `group sub`. Required options are shown `<name>`, optional ones `[name]`.
- An unknown command raises `Command "x" not found.` except for `exists`.

## Examples

```bdfd
$if[$commandInfo[ticket;exists]==true]
$commandInfo[ticket;description]
$commandInfo[ticket;usage;\n]
$endif
```

## Notes

- Everything is read from the modules installed on the bot, so a module added later is covered with no change to your script.
- See the guide [Module and command functions](/docs/module-functions/).
