Skip to main content

Class: SubCommandEntryCommand<ArgType, CommandType>

@sapphire/plugin-subcommands.SubCommandEntryCommand

SubCommandEntryCommand uses other commands as the caller function for subcommands.

example

// here, using `command set` would call the command `modify-settings`.
subCommands: [{
input: 'set',
output: 'modify-settings'
}]

Type parameters

NameType
ArgTypeextends Args = Args
CommandTypeextends Command<ArgType> = Command<ArgType>

Hierarchy

Constructors

constructor

โ€ข new SubCommandEntryCommand<ArgType, CommandType>(options)

Type parameters

NameType
ArgTypeextends Args<ArgType> = Args
CommandTypeextends Command<ArgType, CommandOptions, CommandType> = Command<ArgType, CommandOptions>

Parameters

NameType
optionsOptions<ArgType, CommandType>

Inherited from

SubCommandEntry.constructor

Defined in

projects/plugins/packages/subcommands/src/lib/SubCommandEntry.ts:15

Properties

input

โ€ข Readonly input: string | (context: MessageRunContext<ArgType, CommandType>) => Awaitable<string>

Inherited from

SubCommandEntry.input

Defined in

projects/plugins/packages/subcommands/src/lib/SubCommandEntry.ts:12


output

โ€ข Readonly output: string

Inherited from

SubCommandEntry.output

Defined in

projects/plugins/packages/subcommands/src/lib/SubCommandEntry.ts:13

Methods

match

โ–ธ match(value, context): Promise<boolean>

Parameters

NameType
valuestring
contextMessageRunContext<ArgType, CommandType>

Returns

Promise<boolean>

Inherited from

SubCommandEntry.match

Defined in

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


messageRun

โ–ธ messageRun(context): unknown

Parameters

NameType
contextMessageRunContext<ArgType, CommandType>

Returns

unknown

Overrides

SubCommandEntry.messageRun

Defined in

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