Class: PreconditionContainerSingle
An IPreconditionContainer which runs a single precondition from SapphireClient.preconditions.
Since
1.0.0
Implements
Constructors
constructor
• new PreconditionContainerSingle(data
)
Parameters
Name | Type |
---|---|
data | PreconditionSingleResolvable |
Defined in
projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:67
Properties
context
• Readonly
context: Record
<PropertyKey
, unknown
>
The context to be used when calling Precondition.run. This will always be an empty object ({}
) when the
container was constructed with a string, otherwise it is a direct reference to the value from
context.
Since
1.0.0
Defined in
projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:59
name
• Readonly
name: string
The name of the precondition to run.
Since
1.0.0
Defined in
projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:65
Methods
chatInputRun
▸ chatInputRun(interaction
, command
, context?
): PreconditionResult
Runs the container.
Parameters
Name | Type | Description |
---|---|---|
interaction | ChatInputCommandInteraction <CacheType > | The interaction that ran this precondition. |
command | ChatInputCommand | The command the interaction invoked. |
context | PreconditionContext | The context for the chat input command precondition. |
Returns
Since
3.0.0
Implementation of
IPreconditionContainer.chatInputRun
Defined in
projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:104
contextMenuRun
▸ contextMenuRun(interaction
, command
, context?
): PreconditionResult
Runs the container.
Parameters
Name | Type | Description |
---|---|---|
interaction | ContextMenuCommandInteraction <CacheType > | The interaction that ran this precondition. |
command | ContextMenuCommand | The command the interaction invoked. |
context | PreconditionContext | The context for the context menu command precondition. |
Returns
Since
3.0.0
Implementation of
IPreconditionContainer.contextMenuRun
Defined in
projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:124
messageRun
▸ messageRun(message
, command
, context?
): PreconditionResult
Runs the container.
Parameters
Name | Type | Description |
---|---|---|
message | Message <boolean > | The message that ran this precondition. |
command | MessageCommand | The command the message invoked. |
context | PreconditionContext | The context for the message precondition. |
Returns
Since
1.0.0
Implementation of
IPreconditionContainer.messageRun
Defined in
projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:84