Skip to main content

Interface: CommandOptions

The Command options.

since 1.0.0

Hierarchy

  • Options

  • FlagStrategyOptions

    CommandOptions

Properties

aliases

Optional Readonly aliases: readonly string[]

The aliases for the piece.

default []

Inherited from

AliasPiece.Options.aliases

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:674


chatInputCommand

Optional chatInputCommand: CommandChatInputRegisterShortcut

Shortcuts for registering simple chat input commands

:::warn

You should only use this if your command does not take in options, and is just a chat input one. Otherwise, please read the guide about registering application commands instead.

:::

since 3.0.0

Defined in

projects/framework/src/lib/structures/Command.ts:697


cooldownDelay

Optional cooldownDelay: number

The time in milliseconds for the cooldown entries to reset, if set to a non-zero value alongside {@link Command.Options.cooldownLimit}, the Cooldown precondition will be added to the list.

since 2.0.0

default 0

Defined in

projects/framework/src/lib/structures/Command.ts:641


cooldownFilteredUsers

Optional cooldownFilteredUsers: string[]

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

Defined in

projects/framework/src/lib/structures/Command.ts:656


cooldownLimit

Optional cooldownLimit: number

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

since 2.0.0

default 1

Defined in

projects/framework/src/lib/structures/Command.ts:634


cooldownScope

Optional cooldownScope: BucketScope

The scope of the cooldown entries.

since 2.0.0

default BucketScope.User

Defined in

projects/framework/src/lib/structures/Command.ts:648


description

Optional description: string

The description for the command.

since 1.0.0

default ''

Defined in

projects/framework/src/lib/structures/Command.ts:578


detailedDescription

Optional detailedDescription: string

The detailed description for the command.

since 1.0.0

default ''

Defined in

projects/framework/src/lib/structures/Command.ts:585


enabled

Optional Readonly enabled: boolean

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

default true

Inherited from

AliasPiece.Options.enabled

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:417


flags

Optional flags: boolean | readonly string[]

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

FlagStrategyOptions.flags

Defined in

projects/framework/src/lib/utils/strategies/FlagUnorderedStrategy.ts:13


fullCategory

Optional fullCategory: string[]

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/ping.js`
['General', 'About']

Defined in

projects/framework/src/lib/structures/Command.ts:600


generateDashLessAliases

Optional generateDashLessAliases: boolean

Whether to add aliases for commands with dashes in them

since 1.0.0

default false

Defined in

projects/framework/src/lib/structures/Command.ts:571


name

Optional Readonly name: string

The name for the piece.

default ''

Inherited from

AliasPiece.Options.name

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:412


nsfw

Optional nsfw: boolean

Sets whether or not 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

Defined in

projects/framework/src/lib/structures/Command.ts:627


options

Optional options: boolean | readonly string[]

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

FlagStrategyOptions.options

Defined in

projects/framework/src/lib/utils/strategies/FlagUnorderedStrategy.ts:21


preconditions

Optional preconditions: readonly PreconditionEntryResolvable[]

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

seealso PreconditionContainerArray

since 1.0.0

default []

Defined in

projects/framework/src/lib/structures/Command.ts:608


prefixes

Optional prefixes: string[]

The prefixes for both flags and options.

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

Inherited from

FlagStrategyOptions.prefixes

Defined in

projects/framework/src/lib/utils/strategies/FlagUnorderedStrategy.ts:27


quotes

Optional quotes: [string, string][]

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

since 1.0.0

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

Defined in

projects/framework/src/lib/structures/Command.ts:620


requiredClientPermissions

Optional requiredClientPermissions: PermissionResolvable

The required permissions for the client.

since 2.0.0

default 0

Defined in

projects/framework/src/lib/structures/Command.ts:663


requiredUserPermissions

Optional requiredUserPermissions: PermissionResolvable

The required permissions for the user.

since 2.0.0

default 0

Defined in

projects/framework/src/lib/structures/Command.ts:670


runIn

Optional runIn: null | CommandOptionsRunType | CommandOptionsRunTypeEnum | readonly (CommandOptionsRunType | CommandOptionsRunTypeEnum)[]

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).

since 2.0.0

default null

Defined in

projects/framework/src/lib/structures/Command.ts:677


separators

Optional separators: string[]

The flag separators.

default ['=', ':']

Inherited from

FlagStrategyOptions.separators

Defined in

projects/framework/src/lib/utils/strategies/FlagUnorderedStrategy.ts:33


typing

Optional typing: boolean

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

default true

Defined in

projects/framework/src/lib/structures/Command.ts:684