Class: PluginSubcommandCooldownPrecondition
The subcommand cooldown precondition. This differs from the cooldown precondition in framework by using a separate bucket as well as resolving the id differently to ensure it is specific to a subcommand.
Since
5.1.0
Extends
AllFlowsPrecondition
Constructors
new PluginSubcommandCooldownPrecondition()
new PluginSubcommandCooldownPrecondition(
context
:LoaderContext
,options
?:PreconditionOptions
):PluginSubcommandCooldownPrecondition
Parameters
Parameter | Type |
---|---|
context | LoaderContext |
options ? | PreconditionOptions |
Returns
PluginSubcommandCooldownPrecondition
Inherited from
AllFlowsPrecondition.constructor
Defined in
node_modules/@sapphire/framework/dist/esm/index.d.mts:524
Properties
enabled
enabled:
boolean
Whether or not the piece is enabled.
Inherited from
AllFlowsPrecondition.enabled
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:234
location
readonly
location:PieceLocation
The location metadata for the piece's file.
Inherited from
AllFlowsPrecondition.location
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:226
name
readonly
name:string
The name of the piece.
Inherited from
AllFlowsPrecondition.name
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:230
options
readonly
options:PreconditionOptions
The raw options passed to this Piece
Inherited from
AllFlowsPrecondition.options
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:238
position
readonly
position:null
|number
Inherited from
AllFlowsPrecondition.position
Defined in
node_modules/@sapphire/framework/dist/esm/index.d.mts:523
store
readonly
store:PreconditionStore
The store that contains the piece.
Inherited from
AllFlowsPrecondition.store
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:222
subcommandBuckets
subcommandBuckets:
WeakMap
<Subcommand
<Args
,SubcommandOptions
>,RateLimitManager
<string
>>
Defined in
projects/plugins/packages/subcommands/src/preconditions/PluginSubcommandCooldown.ts:31
Accessors
container
get
container():Container
A reference to the Container object for ease of use.
See
container
Returns
Container
Inherited from
AllFlowsPrecondition.container
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:244
Methods
chatInputRun()
chatInputRun(
interaction
:ChatInputCommandInteraction
<CacheType
>,subcommand
:Subcommand
<Args
,SubcommandOptions
>,context
:PluginSubcommandCooldownPreconditionContext
):PreconditionResult
Parameters
Parameter | Type |
---|---|
interaction | ChatInputCommandInteraction <CacheType > |
subcommand | Subcommand <Args , SubcommandOptions > |
context | PluginSubcommandCooldownPreconditionContext |
Returns
PreconditionResult
Overrides
AllFlowsPrecondition.chatInputRun