Modules
commandList
$commandList
$commandList returns the names of the bot’s commands, sorted, joined by the separator. Unlike $botCommands it can keep only the slash commands, those of one module, or those no module owns.
Syntax
$commandList[separator;filter]
Parameters
| Parameter | Description |
|---|---|
separator |
Optional. Text between the names. Default ,. |
filter |
Optional. slash (default), all, custom (slash commands no module owns) or module:<id> (slash commands of one module). |
Return value
- Type: String
JavaScript
bc.command.list({filter}) returns an array of strings.
Behavior
- An unknown filter raises an error that lists the accepted values.
Examples
Commands of tickets: $commandList[, ;module:tickets]
Your own commands: $commandList[, ;custom]
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.
Try it
Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.