Skip to main content

Class: PreconditionContainerSingle

An IPreconditionContainer which runs a single precondition from {@link SapphireClient.preconditions}.

since 1.0.0

Implements

Constructors

constructor

โ€ข new PreconditionContainerSingle(data)

Parameters

NameType
dataPreconditionSingleResolvable

Defined in

projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:64

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 PreconditionSingleResolvableDetails.context.

since 1.0.0

Defined in

projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:56


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:62

Methods

run

โ–ธ run(message, command, context?): PreconditionResult

Runs the container.

since 1.0.0

Parameters

NameTypeDescription
messageMessage<boolean>The message that ran this precondition.
commandCommand<Args, CommandOptions>The command the message invoked.
contextPreconditionContext-

Returns

PreconditionResult

Implementation of

IPreconditionContainer.run

Defined in

projects/framework/src/lib/utils/preconditions/PreconditionContainerSingle.ts:80