Class: Precondition<O>
Type parameters
Name | Type |
---|---|
O | extends Options = Options |
Hierarchy
Piece
<O
>↳
Precondition
Constructors
constructor
• new Precondition<O
>(context
, options?
)
Type parameters
Name | Type |
---|---|
O | extends PreconditionOptions <O > = PreconditionOptions |
Parameters
Name | Type |
---|---|
context | PieceContext |
options | PreconditionOptions |
Overrides
Defined in
projects/framework/src/lib/structures/Precondition.ts:16
Properties
enabled
• enabled: boolean
Inherited from
Defined in
node_modules/@sapphire/pieces/dist/index.d.ts:450
location
• Readonly
location: PieceLocation
Inherited from
Defined in
node_modules/@sapphire/pieces/dist/index.d.ts:442
name
• Readonly
name: string
Inherited from
Defined in
node_modules/@sapphire/pieces/dist/index.d.ts:446
options
• Readonly
options: O
Inherited from
Defined in
node_modules/@sapphire/pieces/dist/index.d.ts:454
position
• Readonly
position: null
| number
Defined in
projects/framework/src/lib/structures/Precondition.ts:14
store
• Readonly
store: Store
<Piece
<PieceOptions
>>
Inherited from
Defined in
node_modules/@sapphire/pieces/dist/index.d.ts:438
Accessors
container
• get
container(): Container
Returns
Container
Inherited from
Piece.container
Defined in
node_modules/@sapphire/pieces/dist/index.d.ts:460
Methods
chatInputRun
▸ Optional
chatInputRun(interaction
, command
, context
): PreconditionResult
Parameters
Name | Type |
---|---|
interaction | CommandInteraction <CacheType > |
command | ChatInputCommand |
context | PreconditionContext |
Returns
Defined in
projects/framework/src/lib/structures/Precondition.ts:23
contextMenuRun
▸ Optional
contextMenuRun(interaction
, command
, context
): PreconditionResult
Parameters
Name | Type |
---|---|
interaction | ContextMenuInteraction <CacheType > |
command | ContextMenuCommand |
context | PreconditionContext |
Returns
Defined in
projects/framework/src/lib/structures/Precondition.ts:25
error
▸ error(options?
): PreconditionResult
Parameters
Name | Type | Description |
---|---|---|
options | Omit <Options , "precondition" > |
Returns
Defined in
projects/framework/src/lib/structures/Precondition.ts:35
fetchChannelFromInteraction
▸ Protected
fetchChannelFromInteraction(interaction
): Promise
<TextBasedChannel
>
Parameters
Name | Type |
---|---|
interaction | BaseCommandInteraction <CacheType > |
Returns
Promise
<TextBasedChannel
>
Defined in
projects/framework/src/lib/structures/Precondition.ts:39
messageRun
▸ Optional
messageRun(message
, command
, context
): PreconditionResult
Parameters
Name | Type |
---|---|
message | Message <boolean > |
command | MessageCommand |
context | PreconditionContext |
Returns
Defined in
projects/framework/src/lib/structures/Precondition.ts:21
ok
▸ ok(): PreconditionResult
Returns
Defined in
projects/framework/src/lib/structures/Precondition.ts:27
onLoad
▸ onLoad(): unknown
Returns
unknown
Inherited from
Defined in
node_modules/@sapphire/pieces/dist/index.d.ts:465
onUnload
▸ onUnload(): unknown
Returns
unknown
Inherited from
Defined in
node_modules/@sapphire/pieces/dist/index.d.ts:470
reload
▸ reload(): Promise
<void
>
Returns
Promise
<void
>
Inherited from
Defined in
node_modules/@sapphire/pieces/dist/index.d.ts:478
toJSON
▸ toJSON(): PieceJSON
Returns
PieceJSON
Inherited from
Defined in
node_modules/@sapphire/pieces/dist/index.d.ts:482
unload
▸ unload(): Promise
<void
>
Returns
Promise
<void
>
Inherited from
Defined in
node_modules/@sapphire/pieces/dist/index.d.ts:474