Class: PreconditionContainerSingle
Defined in: projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:52
An IPreconditionContainer which runs a single precondition from SapphireClient.preconditions.
Since
1.0.0
Implements
Constructors
Constructor
new PreconditionContainerSingle(
data:PreconditionSingleResolvable):PreconditionContainerSingle
Defined in: projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:67
Parameters
| Parameter | Type |
|---|---|
data | PreconditionSingleResolvable |
Returns
PreconditionContainerSingle
Properties
context
readonlycontext:Record<PropertyKey,unknown>
Defined in: projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:59
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
PreconditionSingleResolvableDetails.context.
Since
1.0.0
name
readonlyname:string
Defined in: projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:65
The name of the precondition to run.
Since
1.0.0
Methods
chatInputRun()
chatInputRun(
interaction:ChatInputCommandInteraction,command:ChatInputCommand,context:PreconditionContext):PreconditionResult|Err<UserError,any>
Defined in: projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:104
Runs the container.
Parameters
| Parameter | Type | Description |
|---|---|---|
interaction | ChatInputCommandInteraction | The interaction that ran this precondition. |
command | ChatInputCommand | The command the interaction invoked. |
context | PreconditionContext | The context for the chat input command precondition. |
Returns
PreconditionResult | Err<UserError, any>
Since
3.0.0
Implementation of
IPreconditionContainer.chatInputRun
contextMenuRun()
contextMenuRun(
interaction:ContextMenuCommandInteraction,command:ContextMenuCommand,context:PreconditionContext):PreconditionResult|Err<UserError,any>
Defined in: projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:124
Runs the container.
Parameters
| Parameter | Type | Description |
|---|---|---|
interaction | ContextMenuCommandInteraction | The interaction that ran this precondition. |
command | ContextMenuCommand | The command the interaction invoked. |
context | PreconditionContext | The context for the context menu command precondition. |
Returns
PreconditionResult | Err<UserError, any>
Since
3.0.0
Implementation of
IPreconditionContainer.contextMenuRun
messageRun()
messageRun(
message:Message,command:MessageCommand,context:PreconditionContext):PreconditionResult|Err<UserError,any>
Defined in: projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:84
Runs the container.
Parameters
| Parameter | Type | Description |
|---|---|---|
message | Message | The message that ran this precondition. |
command | MessageCommand | The command the message invoked. |
context | PreconditionContext | The context for the message precondition. |
Returns
PreconditionResult | Err<UserError, any>
Since
1.0.0