Skip to main content

Class: Subcommand<PreParseReturn, O>

subcommands/src.Subcommand

Type parameters

NameType
PreParseReturnextends Args = Args
Oextends Options = Options

Hierarchy

  • Command<PreParseReturn, O>

    Subcommand

Constructors

constructor

new Subcommand<PreParseReturn, O>(context, options)

Type parameters

NameType
PreParseReturnextends Args<PreParseReturn> = Args
Oextends SubcommandOptions<O> = SubcommandOptions

Parameters

NameType
contextPieceContext
optionsO

Overrides

Command<PreParseReturn, O\>.constructor

Defined in

projects/plugins/packages/subcommands/src/lib/Subcommand.ts:21

Properties

aliases

aliases: readonly string[]

Inherited from

Command.aliases

Defined in

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


applicationCommandRegistry

Readonly applicationCommandRegistry: ApplicationCommandRegistry

Inherited from

Command.applicationCommandRegistry

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2006


caseInsensitiveSubcommands

caseInsensitiveSubcommands: boolean = false

Defined in

projects/plugins/packages/subcommands/src/lib/Subcommand.ts:19


description

description: string

Inherited from

Command.description

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:1971


detailedDescription

detailedDescription: DetailedDescriptionCommand

Inherited from

Command.detailedDescription

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:1981


enabled

enabled: boolean

Inherited from

Command.enabled

Defined in

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


fullCategory

Readonly fullCategory: readonly string[]

Inherited from

Command.fullCategory

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:1990


lexer

Private lexer: Lexer

Inherited from

Command.lexer

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2012


location

Readonly location: PieceLocation

Inherited from

Command.location

Defined in

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


name

Readonly name: string

Inherited from

Command.name

Defined in

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


options

Readonly options: O

Inherited from

Command.options

Defined in

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


parsedSubcommandMappings

parsedSubcommandMappings: SubcommandMappingArray

Defined in

projects/plugins/packages/subcommands/src/lib/Subcommand.ts:18


preconditions

preconditions: PreconditionContainerArray

Inherited from

Command.preconditions

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:1976


store

Readonly store: Store<Piece<PieceOptions>>

Inherited from

Command.store

Defined in

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


strategy

strategy: IUnorderedStrategy

Inherited from

Command.strategy

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:1995


typing

typing: boolean

Inherited from

Command.typing

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2001

Accessors

category

get category(): null | string

Returns

null | string

Inherited from

Command.category

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2034


container

get container(): Container

Returns

Container

Inherited from

Command.container

Defined in

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


parentCategory

get parentCategory(): null | string

Returns

null | string

Inherited from

Command.parentCategory

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2052


subCategory

get subCategory(): null | string

Returns

null | string

Inherited from

Command.subCategory

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2043

Methods

#findSubcommand

Private #findSubcommand(mappings, expectedName): { defaultMatch: false = false; mapping: SubcommandMappingMethod } | { defaultMatch: true = true; mapping: null | SubcommandMappingMethod = foundDefault }

Parameters

NameType
mappingsSubcommandMappingMethod[]
expectedNamestring

Returns

{ defaultMatch: false = false; mapping: SubcommandMappingMethod } | { defaultMatch: true = true; mapping: null | SubcommandMappingMethod = foundDefault }

Defined in

projects/plugins/packages/subcommands/src/lib/Subcommand.ts:335


#handleChatInputInteractionRun

Private #handleChatInputInteractionRun(interaction, context, subcommand): Promise<void>

Parameters

NameType
interactionInteraction<CacheType>
contextChatInputCommandContext
subcommandSubcommandMappingMethod

Returns

Promise<void>

Defined in

projects/plugins/packages/subcommands/src/lib/Subcommand.ts:287


#handleMessageRun

Private #handleMessageRun(message, args, context, subcommand): Promise<void>

Parameters

NameType
messageMessage<boolean>
argsArgs
contextMessageCommandContext
subcommandSubcommandMappingMethod

Returns

Promise<void>

Defined in

projects/plugins/packages/subcommands/src/lib/Subcommand.ts:248


autocompleteRun

Optional autocompleteRun(interaction): unknown

Parameters

NameTypeDescription
interactionAutocompleteInteraction<CacheType>

Returns

unknown

Inherited from

Command.autocompleteRun

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2082


chatInputRun

chatInputRun(interaction, context): Promise<void>

Parameters

NameType
interactionInteraction<CacheType>
contextChatInputCommandContext

Returns

Promise<void>

Overrides

Command.chatInputRun

Defined in

projects/plugins/packages/subcommands/src/lib/Subcommand.ts:211


contextMenuRun

Optional contextMenuRun(interaction, context): unknown

Parameters

NameTypeDescription
interactionContextMenuInteraction<CacheType>
contextContextMenuCommandContext-

Returns

unknown

Inherited from

Command.contextMenuRun

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2069


messagePreParse

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

Parameters

NameTypeDescription
messageMessage<boolean>
parametersstring
contextMessageCommandContext

Returns

Awaitable<PreParseReturn>

Inherited from

Command.messagePreParse

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2025


messageRun

messageRun(message, args, context): Promise<void>

Parameters

NameType
messageMessage<boolean>
argsPreParseReturn
contextMessageCommandContext

Returns

Promise<void>

Overrides

Command.messageRun

Defined in

projects/plugins/packages/subcommands/src/lib/Subcommand.ts:119


onLoad

onLoad(): void

Returns

void

Overrides

Command.onLoad

Defined in

projects/plugins/packages/subcommands/src/lib/Subcommand.ts:108


onUnload

onUnload(): unknown

Returns

unknown

Inherited from

Command.onUnload

Defined in

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


parseConstructorPreConditions

Protected parseConstructorPreConditions(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Inherited from

Command.parseConstructorPreConditions

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2117


parseConstructorPreConditionsCooldown

Protected parseConstructorPreConditionsCooldown(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Inherited from

Command.parseConstructorPreConditionsCooldown

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2147


parseConstructorPreConditionsNsfw

Protected parseConstructorPreConditionsNsfw(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Inherited from

Command.parseConstructorPreConditionsNsfw

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2122


parseConstructorPreConditionsRequiredClientPermissions

Protected parseConstructorPreConditionsRequiredClientPermissions(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Inherited from

Command.parseConstructorPreConditionsRequiredClientPermissions

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2135


parseConstructorPreConditionsRequiredUserPermissions

Protected parseConstructorPreConditionsRequiredUserPermissions(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Inherited from

Command.parseConstructorPreConditionsRequiredUserPermissions

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2141


parseConstructorPreConditionsRunIn

Protected parseConstructorPreConditionsRunIn(options): void

Parameters

NameTypeDescription
optionsCommandOptions

Returns

void

Inherited from

Command.parseConstructorPreConditionsRunIn

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2129


registerApplicationCommands

Optional registerApplicationCommands(registry): Awaitable<void>

Parameters

NameTypeDescription
registryApplicationCommandRegistry

Returns

Awaitable<void>

Inherited from

Command.registerApplicationCommands

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2091


reload

reload(): Promise<void>

Returns

Promise<void>

Inherited from

Command.reload

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2108


supportsAutocompleteInteractions

supportsAutocompleteInteractions(): this is AutocompleteCommand

Returns

this is AutocompleteCommand

Inherited from

Command.supportsAutocompleteInteractions

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2107


supportsChatInputCommands

supportsChatInputCommands(): this is ChatInputCommand

Returns

this is ChatInputCommand

Inherited from

Command.supportsChatInputCommands

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2099


supportsContextMenuCommands

supportsContextMenuCommands(): this is ContextMenuCommand

Returns

this is ContextMenuCommand

Inherited from

Command.supportsContextMenuCommands

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2103


supportsMessageCommands

supportsMessageCommands(): this is MessageCommand

Returns

this is MessageCommand

Inherited from

Command.supportsMessageCommands

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2095


toJSON

toJSON(): CommandJSON

Returns

CommandJSON

Inherited from

Command.toJSON

Defined in

node_modules/@sapphire/framework/dist/index.d.ts:2086


unload

unload(): Promise<void>

Returns

Promise<void>

Inherited from

Command.unload

Defined in

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