Interface: CommandOptions
Defined in: projects/framework/src/lib/types/CommandTypes.ts:62
The Command options.
Since
1.0.0
Extends
Options
.FlagStrategyOptions
Properties
cooldownDelay?
optional
cooldownDelay:number
Defined in: projects/framework/src/lib/types/CommandTypes.ts:146
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
cooldownFilteredUsers?
optional
cooldownFilteredUsers:string
[]
Defined in: projects/framework/src/lib/types/CommandTypes.ts:161
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
cooldownLimit?
optional
cooldownLimit:number
Defined in: projects/framework/src/lib/types/CommandTypes.ts:139
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
cooldownScope?
optional
cooldownScope:BucketScope
Defined in: projects/framework/src/lib/types/CommandTypes.ts:153
The scope of the cooldown entries.
Since
2.0.0
Default
BucketScope.User
description?
optional
description:string
Defined in: projects/framework/src/lib/types/CommandTypes.ts:82
The description for the command.
Since
1.0.0
Default
''
detailedDescription?
optional
detailedDescription:DetailedDescriptionCommand
Defined in: projects/framework/src/lib/types/CommandTypes.ts:89
The detailed description for the command.
Since
1.0.0
Default
''
flags?
optional
flags:boolean
| readonlystring
[]
Defined in: projects/framework/src/lib/utils/strategies/FlagUnorderedStrategy.ts:14
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
fullCategory?
optional
fullCategory:string
[]
Defined in: projects/framework/src/lib/types/CommandTypes.ts:104
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']
generateDashLessAliases?
optional
generateDashLessAliases:boolean
Defined in: projects/framework/src/lib/types/CommandTypes.ts:68
Whether to add aliases for commands with dashes in them
Since
1.0.0
Default
false
generateUnderscoreLessAliases?
optional
generateUnderscoreLessAliases:boolean
Defined in: projects/framework/src/lib/types/CommandTypes.ts:75
Whether to add aliases for commands with underscores in them
Since
3.0.0
Default
false
nsfw?
optional
nsfw:boolean
Defined in: projects/framework/src/lib/types/CommandTypes.ts:132
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
options?
optional
options:boolean
| readonlystring
[]
Defined in: projects/framework/src/lib/utils/strategies/FlagUnorderedStrategy.ts:22
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
preconditions?
optional
preconditions: readonlyPreconditionEntryResolvable
[]
Defined in: projects/framework/src/lib/types/CommandTypes.ts:112
The Preconditions to be run, accepts an array of their names.
Seealso
Since
1.0.0
Default
[]
prefixes?
optional
prefixes:string
[]
Defined in: projects/framework/src/lib/utils/strategies/FlagUnorderedStrategy.ts:28
The prefixes for both flags and options.
Default
['--', '-', '—']
Inherited from
FlagStrategyOptions.prefixes
quotes?
optional
quotes: [string
,string
][]
Defined in: projects/framework/src/lib/types/CommandTypes.ts:125
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)
]
requiredClientPermissions?
optional
requiredClientPermissions:PermissionResolvable
Defined in: projects/framework/src/lib/types/CommandTypes.ts:168
The required permissions for the client.
Since
2.0.0
Default
0
requiredUserPermissions?
optional
requiredUserPermissions:PermissionResolvable
Defined in: projects/framework/src/lib/types/CommandTypes.ts:175
The required permissions for the user.
Since
2.0.0
Default
0
runIn?
optional
runIn:CommandRunInUnion
|CommandSpecificRunIn
Defined in: projects/framework/src/lib/types/CommandTypes.ts:188
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
separators?
optional
separators:string
[]
Defined in: projects/framework/src/lib/utils/strategies/FlagUnorderedStrategy.ts:34
The flag separators.
Default
['=', ':']
Inherited from
FlagStrategyOptions.separators
typing?
optional
typing:boolean
Defined in: projects/framework/src/lib/types/CommandTypes.ts:195
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