Skip to main content

Interface: SubcommandOptions

Defined in: projects/plugins/packages/subcommands/src/lib/Subcommand.ts:565

Extends​

  • Options

Properties​

aliases?​

readonly optional aliases: readonly string[]

Defined in: node_modules/@sapphire/pieces/dist/esm/index.d.mts:861

The aliases for the piece.

Default​

[]

Inherited from​

SubcommandOptions.aliases


cooldownDelay?​

optional cooldownDelay: number

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:1232

The time in milliseconds for the cooldown entries to reset, if set to a non-zero value alongside CommandOptions.cooldownLimit, the Cooldown precondition will be added to the list.

Since​

2.0.0

Default​

0

Inherited from​

Command.Options.cooldownDelay


cooldownFilteredUsers?​

optional cooldownFilteredUsers: string[]

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:1245

The users that are exempt from the Cooldown precondition. Use this to filter out someone like a bot owner

Since​

2.0.0

Default​

undefined

Inherited from​

Command.Options.cooldownFilteredUsers


cooldownLimit?​

optional cooldownLimit: number

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:1226

The amount of entries the cooldown can have before filling up, if set to a non-zero value alongside CommandOptions.cooldownDelay, the Cooldown precondition will be added to the list.

Since​

2.0.0

Default​

1

Inherited from​

Command.Options.cooldownLimit


cooldownScope?​

optional cooldownScope: BucketScope

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:1238

The scope of the cooldown entries.

Since​

2.0.0

Default​

BucketScope.User

Inherited from​

Command.Options.cooldownScope


description?​

optional description: string

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:1175

The description for the command.

Since​

1.0.0

Default​

''

Inherited from​

Command.Options.description


detailedDescription?​

optional detailedDescription: DetailedDescriptionCommand

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:1181

The detailed description for the command.

Since​

1.0.0

Default​

''

Inherited from​

Command.Options.detailedDescription


enabled?​

readonly optional enabled: boolean

Defined in: node_modules/@sapphire/pieces/dist/esm/index.d.mts:204

Whether or not the piece should be enabled. If set to false, the piece will be unloaded.

Default​

true

Inherited from​

Command.Options.enabled


flags?​

optional flags: boolean | readonly string[]

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:266

The accepted flags. Flags are key-only identifiers that can be placed anywhere in the command. Two different types are accepted:

  • An array of strings, e.g. [silent].
  • A boolean defining whether the strategy should accept all keys (true) or none at all (false).

Default​

[]

Inherited from​

Command.Options.flags


fullCategory?​

optional fullCategory: string[]

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:1195

The full category path for the command

Since​

2.0.0

Default​

'An array of folder names that lead back to the folder that is registered for in the commands store'

Example​

// Given a file named `ping.js` at the path of `commands/General/ping.js`
['General']

// Given a file named `info.js` at the path of `commands/General/About/info.js`
['General', 'About']

Inherited from​

Command.Options.fullCategory


generateDashLessAliases?​

optional generateDashLessAliases: boolean

Defined in: projects/plugins/packages/subcommands/src/lib/Subcommand.ts:577

Whether to add aliases for subcommands with dashes in them

When this option is enabled and the subcommand implements messageRun, dashless aliases will be added.

For subcommands groups both the group itself and all subcommands within the group will have dashless aliases added.

Since​

3.0.0

Default​

false

Overrides​

Command.Options.generateDashLessAliases


generateUnderscoreLessAliases?​

optional generateUnderscoreLessAliases: boolean

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:1169

Whether to add aliases for commands with underscores in them

Since​

3.0.0

Default​

false

Inherited from​

Command.Options.generateUnderscoreLessAliases


name?​

readonly optional name: string

Defined in: node_modules/@sapphire/pieces/dist/esm/index.d.mts:199

The name for the piece.

Default​

''

Inherited from​

Command.Options.name


nsfw?​

optional nsfw: boolean

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:1220

Sets whether the command should be treated as NSFW. If set to true, the NSFW precondition will be added to the list.

Since​

2.0.0

Default​

false

Inherited from​

Command.Options.nsfw


options?​

optional options: boolean | readonly string[]

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:273

The accepted options. Options are key-value identifiers that can be placed anywhere in the command. Two different types are accepted:

  • An array of strings, e.g. [silent].
  • A boolean defining whether the strategy should accept all keys (true) or none at all (false).

Default​

[]

Inherited from​

Command.Options.options


preconditions?​

optional preconditions: readonly PreconditionEntryResolvable[]

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:1202

The Preconditions to be run, accepts an array of their names.

Seealso​

PreconditionContainerArray

Since​

1.0.0

Default​

[]

Inherited from​

SubcommandOptions.preconditions


prefixes?​

optional prefixes: string[]

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:278

The prefixes for both flags and options.

Default​

['--', '-', '—']

Inherited from​

Command.Options.prefixes


quotes?​

optional quotes: [string, string][]

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:1214

The quotes accepted by this command, pass [] to disable them.

Since​

1.0.0

Default​

[
['"', '"'], // Double quotes
['“', '”'], // Fancy quotes (on iOS)
['「', '」'] // Corner brackets (CJK)
['«', '»'] // French quotes (guillemets)
]

Inherited from​

SubcommandOptions.quotes


requiredClientPermissions?​

optional requiredClientPermissions: PermissionResolvable

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:1251

The required permissions for the client.

Since​

2.0.0

Default​

0

Inherited from​

Command.Options.requiredClientPermissions


requiredUserPermissions?​

optional requiredUserPermissions: PermissionResolvable

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:1257

The required permissions for the user.

Since​

2.0.0

Default​

0

Inherited from​

Command.Options.requiredUserPermissions


runIn?​

optional runIn: CommandRunInUnion | CommandSpecificRunIn

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:1269

The channels the command should run in. If set to null, no precondition entry will be added. Some optimizations are applied when given an array to reduce the amount of preconditions run (e.g. 'GUILD_TEXT' and 'GUILD_NEWS' becomes 'GUILD_ANY', and if both 'DM' and 'GUILD_ANY' are defined, then no precondition entry is added as it runs in all channels).

This can be both CommandRunInUnion which will have the same precondition apply to all the types of commands, or you can use CommandSpecificRunIn to apply different preconditions to different types of commands.

Since​

2.0.0

Default​

null

Inherited from​

Command.Options.runIn


separators?​

optional separators: string[]

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:283

The flag separators.

Default​

['=', ':']

Inherited from​

Command.Options.separators


subcommands?​

optional subcommands: SubcommandMappingArray

Defined in: projects/plugins/packages/subcommands/src/lib/Subcommand.ts:566


typing?​

optional typing: boolean

Defined in: node_modules/@sapphire/framework/dist/esm/index.d.mts:1275

If SapphireClient.typing is true, this option will override it. Otherwise, this option has no effect - you may call Channel#sendTyping` in the run method if you want specific commands to display the typing status.

Default​

true

Inherited from​

Command.Options.typing