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

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


description

description: string

Defined in

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


detailedDescription

detailedDescription: DetailedDescriptionCommand

Defined in

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


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


lexer

Private lexer: Lexer

Defined in

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


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


store

store: CommandStore

Overrides

AliasPiece.store

Defined in

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


strategy

strategy: IUnorderedStrategy

Defined in

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


typing

typing: boolean

Defined in

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

Accessors

category

get category(): null | string

Returns

null | string

Defined in

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


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


subCategory

get subCategory(): null | string

Returns

null | string

Defined in

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

Methods

autocompleteRun

Optional autocompleteRun(interaction): unknown

Parameters

NameTypeDescription
interactionAutocompleteInteraction<CacheType>

Returns

unknown

Defined in

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


chatInputRun

Optional chatInputRun(interaction, context): unknown

Parameters

NameTypeDescription
interactionChatInputCommandInteraction<CacheType>
contextChatInputCommandContext

Returns

unknown

Defined in

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


contextMenuRun

Optional contextMenuRun(interaction, context): unknown

Parameters

NameTypeDescription
interactionContextMenuCommandInteraction<CacheType>
contextContextMenuCommandContext

Returns

unknown

Defined in

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


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


messageRun

Optional messageRun(message, args, context): unknown

Parameters

NameTypeDescription
messageMessage<boolean>
argsPreParseReturn
contextMessageCommandContext

Returns

unknown

Defined in

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


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


parseConstructorPreConditionsCooldown

Protected parseConstructorPreConditionsCooldown(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Defined in

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


parseConstructorPreConditionsNsfw

Protected parseConstructorPreConditionsNsfw(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Defined in

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


parseConstructorPreConditionsRequiredClientPermissions

Protected parseConstructorPreConditionsRequiredClientPermissions(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Defined in

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


parseConstructorPreConditionsRequiredUserPermissions

Protected parseConstructorPreConditionsRequiredUserPermissions(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Defined in

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


parseConstructorPreConditionsRunIn

Protected parseConstructorPreConditionsRunIn(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Defined in

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


registerApplicationCommands

Optional registerApplicationCommands(registry): Awaitable<void>

Parameters

NameTypeDescription
registryApplicationCommandRegistry

Returns

Awaitable<void>

Defined in

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


reload

reload(): Promise<void>

Returns

Promise<void>

Overrides

AliasPiece.reload

Defined in

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


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


supportsAutocompleteInteractions

supportsAutocompleteInteractions(): this is AutocompleteCommand

Returns

this is AutocompleteCommand

Defined in

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


supportsChatInputCommands

supportsChatInputCommands(): this is ChatInputCommand

Returns

this is ChatInputCommand

Defined in

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


supportsContextMenuCommands

supportsContextMenuCommands(): this is ContextMenuCommand

Returns

this is ContextMenuCommand

Defined in

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


supportsMessageCommands

supportsMessageCommands(): this is MessageCommand

Returns

this is MessageCommand

Defined in

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


toJSON

toJSON(): CommandJSON

Returns

CommandJSON

Overrides

AliasPiece.toJSON

Defined in

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


unload

unload(): Promise<void>

Returns

Promise<void>

Inherited from

AliasPiece.unload

Defined in

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