Class: Precondition<Options>
Extends
Piece<Options,"preconditions">
Extended by
Type Parameters
| Type Parameter | Default type |
|---|---|
Options extends Options | Options |
Constructors
new Precondition()
new Precondition<
Options>(context:LoaderContext,options:Options):Precondition<Options>
Parameters
| Parameter | Type |
|---|---|
context | LoaderContext |
options | Options |
Returns
Precondition<Options>
Overrides
Piece<Options, 'preconditions'>.constructor
Defined in
projects/framework/src/lib/structures/Precondition.ts:24
Properties
position
readonlyposition:null|number
Defined in
projects/framework/src/lib/structures/Precondition.ts:22
Methods
chatInputRun()?
optionalchatInputRun(interaction:ChatInputCommandInteraction<CacheType>,command:ChatInputCommand,context:PreconditionContext):PreconditionResult
Parameters
| Parameter | Type |
|---|---|
interaction | ChatInputCommandInteraction<CacheType> |
command | ChatInputCommand |
context | PreconditionContext |
Returns
Defined in
projects/framework/src/lib/structures/Precondition.ts:31
contextMenuRun()?
optionalcontextMenuRun(interaction:ContextMenuCommandInteraction<CacheType>,command:ContextMenuCommand,context:PreconditionContext):PreconditionResult
Parameters
| Parameter | Type |
|---|---|
interaction | ContextMenuCommandInteraction<CacheType> |
command | ContextMenuCommand |
context | PreconditionContext |
Returns
Defined in
projects/framework/src/lib/structures/Precondition.ts:33
error()
error(
options:Omit<Options,"precondition">):PreconditionResult
Constructs a PreconditionError with the precondition parameter set to this.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | Omit<Options, "precondition"> | The information. |
Returns
Defined in
projects/framework/src/lib/structures/Precondition.ts:47
fetchChannelFromInteraction()
protectedfetchChannelFromInteraction(interaction:CommandInteraction<CacheType>):Promise<TextBasedChannel>
Parameters
| Parameter | Type |
|---|---|
interaction | CommandInteraction<CacheType> |
Returns
Defined in
projects/framework/src/lib/structures/Precondition.ts:51
messageRun()?
optionalmessageRun(message:Message<boolean>,command:MessageCommand,context:PreconditionContext):PreconditionResult
Parameters
| Parameter | Type |
|---|---|
message | Message<boolean> |
command | MessageCommand |
context | PreconditionContext |
Returns
Defined in
projects/framework/src/lib/structures/Precondition.ts:29
ok()
ok():
PreconditionResult