Class: Subcommand<PreParseReturn, O>
subcommands/src.Subcommand
Type parameters
Name | Type |
---|---|
PreParseReturn | extends Args = Args |
O | extends Options = Options |
Hierarchy
Command
<PreParseReturn
,O
>↳
Subcommand
Constructors
constructor
• new Subcommand<PreParseReturn
, O
>(context
, options
)
Type parameters
Name | Type |
---|---|
PreParseReturn | extends Args <PreParseReturn > = Args |
O | extends SubcommandOptions <O > = SubcommandOptions |
Parameters
Name | Type |
---|---|
context | PieceContext |
options | O |
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:2145
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:2110
detailedDescription
• detailedDescription: DetailedDescriptionCommand
Inherited from
Command.detailedDescription
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2120
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:2129
lexer
• Private
lexer: Lexer
Inherited from
Command.lexer
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2151
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:2115
store
• store: CommandStore
Inherited from
Command.store
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2105
strategy
• strategy: IUnorderedStrategy
Inherited from
Command.strategy
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2134
typing
• typing: boolean
Inherited from
Command.typing
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2140
Accessors
category
• get
category(): null
| string
Returns
null
| string
Inherited from
Command.category
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2173
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:2191
subCategory
• get
subCategory(): null
| string
Returns
null
| string
Inherited from
Command.subCategory
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2182
Methods
#findSubcommand
▸ Private
#findSubcommand(mappings
, expectedName
): { defaultMatch
: false
= false; mapping
: SubcommandMappingMethod
} | { defaultMatch
: true
= true; mapping
: null
| SubcommandMappingMethod
= foundDefault }
Parameters
Name | Type |
---|---|
mappings | SubcommandMappingMethod [] |
expectedName | string |
Returns
{ defaultMatch
: false
= false; mapping
: SubcommandMappingMethod
} | { defaultMatch
: true
= true; mapping
: null
| SubcommandMappingMethod
= foundDefault }
Defined in
projects/plugins/packages/subcommands/src/lib/Subcommand.ts:339
#handleChatInputInteractionRun
▸ Private
#handleChatInputInteractionRun(interaction
, context
, subcommand
): Promise
<void
>
Parameters
Name | Type |
---|---|
interaction | Interaction <CacheType > |
context | ChatInputCommandContext |
subcommand | SubcommandMappingMethod |
Returns
Promise
<void
>
Defined in
projects/plugins/packages/subcommands/src/lib/Subcommand.ts:291
#handleMessageRun
▸ Private
#handleMessageRun(message
, args
, context
, subcommand
): Promise
<void
>
Parameters
Name | Type |
---|---|
message | Message <boolean > |
args | Args |
context | MessageCommandContext |
subcommand | SubcommandMappingMethod |
Returns
Promise
<void
>
Defined in
projects/plugins/packages/subcommands/src/lib/Subcommand.ts:252
#supportsCommandType
▸ Private
#supportsCommandType(commandType
): boolean
Parameters
Name | Type |
---|---|
commandType | "messageRun" | "chatInputRun" |
Returns
boolean
Defined in
projects/plugins/packages/subcommands/src/lib/Subcommand.ts:357
autocompleteRun
▸ Optional
autocompleteRun(interaction
): unknown
Parameters
Name | Type | Description |
---|---|---|
interaction | AutocompleteInteraction <CacheType > |
Returns
unknown
Inherited from
Command.autocompleteRun
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2223
chatInputRun
▸ chatInputRun(interaction
, context
): Promise
<void
>
Parameters
Name | Type |
---|---|
interaction | Interaction <CacheType > |
context | ChatInputCommandContext |
Returns
Promise
<void
>
Overrides
Command.chatInputRun
Defined in
projects/plugins/packages/subcommands/src/lib/Subcommand.ts:215
contextMenuRun
▸ Optional
contextMenuRun(interaction
, context
): unknown
Parameters
Name | Type | Description |
---|---|---|
interaction | ContextMenuCommandInteraction <CacheType > | |
context | ContextMenuCommandContext |
Returns
unknown
Inherited from
Command.contextMenuRun
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2210
messagePreParse
▸ messagePreParse(message
, parameters
, context
): Awaitable
<PreParseReturn
>
Parameters
Name | Type | Description |
---|---|---|
message | Message <boolean > | |
parameters | string | |
context | MessageCommandContext |
Returns
Awaitable
<PreParseReturn
>
Inherited from
Command.messagePreParse
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2164
messageRun
▸ messageRun(message
, args
, context
): Promise
<void
>
Parameters
Name | Type |
---|---|
message | Message <boolean > |
args | PreParseReturn |
context | MessageCommandContext |
Returns
Promise
<void
>
Overrides
Command.messageRun
Defined in
projects/plugins/packages/subcommands/src/lib/Subcommand.ts:127
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
Name | Type | Description |
---|---|---|
options | CommandOptions |
Returns
void
Inherited from
Command.parseConstructorPreConditions
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2258
parseConstructorPreConditionsCooldown
▸ Protected
parseConstructorPreConditionsCooldown(options
): void
Parameters
Name | Type | Description |
---|---|---|
options | CommandOptions |
Returns
void
Inherited from
Command.parseConstructorPreConditionsCooldown
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2288
parseConstructorPreConditionsNsfw
▸ Protected
parseConstructorPreConditionsNsfw(options
): void
Parameters
Name | Type | Description |
---|---|---|
options | CommandOptions |
Returns
void
Inherited from
Command.parseConstructorPreConditionsNsfw
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2263
parseConstructorPreConditionsRequiredClientPermissions
▸ Protected
parseConstructorPreConditionsRequiredClientPermissions(options
): void
Parameters
Name | Type | Description |
---|---|---|
options | CommandOptions |
Returns
void
Inherited from
Command.parseConstructorPreConditionsRequiredClientPermissions
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2276
parseConstructorPreConditionsRequiredUserPermissions
▸ Protected
parseConstructorPreConditionsRequiredUserPermissions(options
): void
Parameters
Name | Type | Description |
---|---|---|
options | CommandOptions |
Returns
void
Inherited from
Command.parseConstructorPreConditionsRequiredUserPermissions
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2282
parseConstructorPreConditionsRunIn
▸ Protected
parseConstructorPreConditionsRunIn(options
): void
Parameters
Name | Type | Description |
---|---|---|
options | CommandOptions |
Returns
void
Inherited from
Command.parseConstructorPreConditionsRunIn
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2270
registerApplicationCommands
▸ Optional
registerApplicationCommands(registry
): Awaitable
<void
>
Parameters
Name | Type | Description |
---|---|---|
registry | ApplicationCommandRegistry |
Returns
Awaitable
<void
>
Inherited from
Command.registerApplicationCommands
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2232
reload
▸ reload(): Promise
<void
>
Returns
Promise
<void
>
Inherited from
Command.reload
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2249
supportsAutocompleteInteractions
▸ supportsAutocompleteInteractions(): this is AutocompleteCommand
Returns
this is AutocompleteCommand
Inherited from
Command.supportsAutocompleteInteractions
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2248
supportsChatInputCommands
▸ supportsChatInputCommands(): this is ChatInputCommand
Returns
this is ChatInputCommand
Overrides
Command.supportsChatInputCommands
Defined in
projects/plugins/packages/subcommands/src/lib/Subcommand.ts:123
supportsContextMenuCommands
▸ supportsContextMenuCommands(): this is ContextMenuCommand
Returns
this is ContextMenuCommand
Inherited from
Command.supportsContextMenuCommands
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2244
supportsMessageCommands
▸ supportsMessageCommands(): boolean
Returns
boolean
Overrides
Command.supportsMessageCommands
Defined in
projects/plugins/packages/subcommands/src/lib/Subcommand.ts:119
toJSON
▸ toJSON(): CommandJSON
Returns
CommandJSON
Inherited from
Command.toJSON
Defined in
node_modules/@sapphire/framework/dist/index.d.ts:2227
unload
▸ unload(): Promise
<void
>
Returns
Promise
<void
>
Inherited from
Command.unload
Defined in
node_modules/@sapphire/pieces/dist/index.d.ts:474