Skip to main content

Class: Command<PreParseReturn, O>

Type parameters

NameType
PreParseReturnArgs
Oextends Options = Options

Hierarchy

Constructors

constructor

new Command<PreParseReturn, O>(context, options?)

Type parameters

NameType
PreParseReturnArgs
Oextends CommandOptions<O> = CommandOptions

Parameters

NameTypeDescription
contextPieceContext
optionsO

Overrides

AliasPiece.constructor

Defined in

projects/framework/src/lib/structures/Command.ts:83

Properties

aliases

aliases: readonly string[]

Inherited from

AliasPiece.aliases

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:687


applicationCommandRegistry

Readonly applicationCommandRegistry: ApplicationCommandRegistry

Defined in

projects/framework/src/lib/structures/Command.ts:69


description

description: string

Defined in

projects/framework/src/lib/structures/Command.ts:28


detailedDescription

detailedDescription: DetailedDescriptionCommand

Defined in

projects/framework/src/lib/structures/Command.ts:40


enabled

enabled: boolean

Inherited from

AliasPiece.enabled

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:450


fullCategory

Readonly fullCategory: readonly string[]

Defined in

projects/framework/src/lib/structures/Command.ts:50


lexer

Private lexer: Lexer

Defined in

projects/framework/src/lib/structures/Command.ts:76


location

Readonly location: PieceLocation

Inherited from

AliasPiece.location

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:442


name

Readonly name: string

Inherited from

AliasPiece.name

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:446


options

Readonly options: O

Inherited from

AliasPiece.options

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:454


preconditions

preconditions: PreconditionContainerArray

Defined in

projects/framework/src/lib/structures/Command.ts:34


store

Readonly store: Store<Piece<PieceOptions>>

Inherited from

AliasPiece.store

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:438


strategy

strategy: IUnorderedStrategy

Defined in

projects/framework/src/lib/structures/Command.ts:56


typing

typing: boolean

Defined in

projects/framework/src/lib/structures/Command.ts:63

Accessors

category

get category(): null | string

Returns

null | string

Defined in

projects/framework/src/lib/structures/Command.ts:140


container

get container(): Container

Returns

Container

Inherited from

AliasPiece.container

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:460


parentCategory

get parentCategory(): null | string

Returns

null | string

Defined in

projects/framework/src/lib/structures/Command.ts:164


subCategory

get subCategory(): null | string

Returns

null | string

Defined in

projects/framework/src/lib/structures/Command.ts:152

Methods

autocompleteRun

Optional autocompleteRun(interaction): unknown

Parameters

NameTypeDescription
interactionAutocompleteInteraction<CacheType>

Returns

unknown

Defined in

projects/framework/src/lib/structures/Command.ts:200


chatInputRun

Optional chatInputRun(interaction, context): unknown

Parameters

NameTypeDescription
interactionCommandInteraction<CacheType>
contextChatInputCommandContext-

Returns

unknown

Defined in

projects/framework/src/lib/structures/Command.ts:180


contextMenuRun

Optional contextMenuRun(interaction, context): unknown

Parameters

NameTypeDescription
interactionContextMenuInteraction<CacheType>
contextContextMenuCommandContext-

Returns

unknown

Defined in

projects/framework/src/lib/structures/Command.ts:186


messagePreParse

messagePreParse(message, parameters, context): Awaitable<PreParseReturn>

Parameters

NameTypeDescription
messageMessage<boolean>
parametersstring
contextMessageCommandContext

Returns

Awaitable<PreParseReturn>

Defined in

projects/framework/src/lib/structures/Command.ts:126


messageRun

Optional messageRun(message, args, context): unknown

Parameters

NameTypeDescription
messageMessage<boolean>
argsPreParseReturn
contextMessageCommandContext

Returns

unknown

Defined in

projects/framework/src/lib/structures/Command.ts:174


onLoad

onLoad(): unknown

Returns

unknown

Inherited from

AliasPiece.onLoad

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:465


onUnload

onUnload(): unknown

Returns

unknown

Inherited from

AliasPiece.onUnload

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:470


parseConstructorPreConditions

Protected parseConstructorPreConditions(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Defined in

projects/framework/src/lib/structures/Command.ts:320


parseConstructorPreConditionsCooldown

Protected parseConstructorPreConditionsCooldown(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Defined in

projects/framework/src/lib/structures/Command.ts:376


parseConstructorPreConditionsNsfw

Protected parseConstructorPreConditionsNsfw(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Defined in

projects/framework/src/lib/structures/Command.ts:332


parseConstructorPreConditionsRequiredClientPermissions

Protected parseConstructorPreConditionsRequiredClientPermissions(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Defined in

projects/framework/src/lib/structures/Command.ts:352


parseConstructorPreConditionsRequiredUserPermissions

Protected parseConstructorPreConditionsRequiredUserPermissions(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Defined in

projects/framework/src/lib/structures/Command.ts:364


parseConstructorPreConditionsRunIn

Protected parseConstructorPreConditionsRunIn(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Defined in

projects/framework/src/lib/structures/Command.ts:342


registerApplicationCommands

Optional registerApplicationCommands(registry): Awaitable<void>

Parameters

NameTypeDescription
registryApplicationCommandRegistry

Returns

Awaitable<void>

Defined in

projects/framework/src/lib/structures/Command.ts:218


reload

reload(): Promise<void>

Returns

Promise<void>

Overrides

AliasPiece.reload

Defined in

projects/framework/src/lib/structures/Command.ts:248


resolveConstructorPreConditionsRunType

Private resolveConstructorPreConditionsRunType(runIn): null | PreconditionContainerArray | CommandPreConditions

Parameters

NameType
runInundefined | null | CommandOptionsRunType | CommandOptionsRunTypeEnum | readonly (CommandOptionsRunType | CommandOptionsRunTypeEnum)[]

Returns

null | PreconditionContainerArray | CommandPreConditions

Defined in

projects/framework/src/lib/structures/Command.ts:396


supportsAutocompleteInteractions

supportsAutocompleteInteractions(): this is AutocompleteCommand

Returns

this is AutocompleteCommand

Defined in

projects/framework/src/lib/structures/Command.ts:244


supportsChatInputCommands

supportsChatInputCommands(): this is ChatInputCommand

Returns

this is ChatInputCommand

Defined in

projects/framework/src/lib/structures/Command.ts:230


supportsContextMenuCommands

supportsContextMenuCommands(): this is ContextMenuCommand

Returns

this is ContextMenuCommand

Defined in

projects/framework/src/lib/structures/Command.ts:237


supportsMessageCommands

supportsMessageCommands(): this is MessageCommand

Returns

this is MessageCommand

Defined in

projects/framework/src/lib/structures/Command.ts:223


toJSON

toJSON(): CommandJSON

Returns

CommandJSON

Overrides

AliasPiece.toJSON

Defined in

projects/framework/src/lib/structures/Command.ts:205


unload

unload(): Promise<void>

Returns

Promise<void>

Inherited from

AliasPiece.unload

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:474