Class: Precondition<Options>
Defined in: projects/framework/src/lib/structures/Precondition.ts:21
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
>
Defined in: projects/framework/src/lib/structures/Precondition.ts:24
Parameters
Parameter | Type |
---|---|
context | LoaderContext |
options | Options |
Returns
Precondition
<Options
>
Overrides
Piece<Options, 'preconditions'>.constructor
Properties
position
readonly
position:null
|number
Defined in: projects/framework/src/lib/structures/Precondition.ts:22
Methods
chatInputRun()?
optional
chatInputRun(interaction
:ChatInputCommandInteraction
,command
:ChatInputCommand
,context
:PreconditionContext
):PreconditionResult
Defined in: projects/framework/src/lib/structures/Precondition.ts:31
Parameters
Parameter | Type |
---|---|
interaction | ChatInputCommandInteraction |
command | ChatInputCommand |
context | PreconditionContext |
Returns
contextMenuRun()?
optional
contextMenuRun(interaction
:ContextMenuCommandInteraction
,command
:ContextMenuCommand
,context
:PreconditionContext
):PreconditionResult
Defined in: projects/framework/src/lib/structures/Precondition.ts:33
Parameters
Parameter | Type |
---|---|
interaction | ContextMenuCommandInteraction |
command | ContextMenuCommand |
context | PreconditionContext |
Returns
error()
error(
options
:Omit
<Options
,"precondition"
>):PreconditionResult
Defined in: projects/framework/src/lib/structures/Precondition.ts:47
Constructs a PreconditionError with the precondition parameter set to this
.
Parameters
Parameter | Type | Description |
---|---|---|
options | Omit <Options , "precondition" > | The information. |
Returns
fetchChannelFromInteraction()
protected
fetchChannelFromInteraction(interaction
:CommandInteraction
):Promise
<TextBasedChannel
>
Defined in: projects/framework/src/lib/structures/Precondition.ts:51
Parameters
Parameter | Type |
---|---|
interaction | CommandInteraction |
Returns
messageRun()?
optional
messageRun(message
:Message
,command
:MessageCommand
,context
:PreconditionContext
):PreconditionResult
Defined in: projects/framework/src/lib/structures/Precondition.ts:29
Parameters
Parameter | Type |
---|---|
message | Message |
command | MessageCommand |
context | PreconditionContext |
Returns
ok()
ok():
PreconditionResult
Defined in: projects/framework/src/lib/structures/Precondition.ts:39