Skip to main content

Class: SubCommandManager<ArgType, CommandType>

@sapphire/plugin-subcommands.SubCommandManager

Type parameters

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

Constructors

constructor

โ€ข new SubCommandManager<ArgType, CommandType>(entries)

Type parameters

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

Parameters

NameType
entriesRawEntries<ArgType, CommandType>

Defined in

projects/plugins/packages/subcommands/src/lib/SubCommandManager.ts:10

Properties

default

โ€ข Private Readonly default: null | SubCommandEntry<ArgType, CommandType> = null

Defined in

projects/plugins/packages/subcommands/src/lib/SubCommandManager.ts:8


entries

โ€ข Private Readonly entries: SubCommandEntry<ArgType, CommandType>[] = []

Defined in

projects/plugins/packages/subcommands/src/lib/SubCommandManager.ts:7


handlers

โ–ช Static Readonly handlers: Map<string, typeof SubCommandEntryCommand>

Defined in

projects/plugins/packages/subcommands/src/lib/SubCommandManager.ts:50

Methods

messageRun

โ–ธ messageRun(context): Promise<unknown>

Parameters

NameType
contextMessageRunContext<ArgType, CommandType>

Returns

Promise<unknown>

Defined in

projects/plugins/packages/subcommands/src/lib/SubCommandManager.ts:26


resolve

โ–ธ Protected resolve(value): Entry<ArgType, CommandType>

Parameters

NameType
valuestring | Entry<ArgType, CommandType>

Returns

Entry<ArgType, CommandType>

Defined in

projects/plugins/packages/subcommands/src/lib/SubCommandManager.ts:45