CommandDecorators

Grouping of static decorator methods for the Command class and Command#action method

Note: This is a TypeScript feature. JavaScript users are limited to using CommandInfo to define their commands and Command#use for assigning middleware functions to commands

Source:

Properties

.guildOnly: ClassDecorator

Set guildOnly flag metadata

Type:
ClassDecorator
Source:

.hidden: ClassDecorator

Set hidden flag metadata

Type:
ClassDecorator
Source:

.localizable: MethodDecorator

Creates a ResourceLoader function using the localization language for the command call and passes it as the first argument for that command call.

Identical to localize but used as a Command action method decorator.

Like the localize middleware, you will want to use this after any other usages of middleware via @using(). Middleware added via Command#use is evaluated before middleware added via @using().

Type:
MethodDecorator
Source:

.ownerOnly: ClassDecorator

Set owneronly flag metadata

Type:
ClassDecorator
Source:

Methods

(static) .aliases(values: string) → ClassDecorator

Set aliases metadata

Parameters:
Name Type Attributes Description
values
string
<repeatable>

Values to set

Source:
Returns:
ClassDecorator

(static) .argOpts(value: ArgOpts) → ClassDecorator

Set argOpts metadata

Parameters:
Name Type Description
value
ArgOpts

Value to set

Source:
Returns:
ClassDecorator

(static) .callerPermissions(values: PermissionResolvable) → ClassDecorator

Set callerPermissions metadata

Parameters:
Name Type Attributes Description
values
PermissionResolvable
<repeatable>

Values to set

Source:
Returns:
ClassDecorator

(static) .clientPermissions(values: PermissionResolvable) → ClassDecorator

Set clientPermissions metadata

Parameters:
Name Type Attributes Description
values
PermissionResolvable
<repeatable>

Values to set

Source:
Returns:
ClassDecorator

(static) .desc(value: string) → ClassDecorator

Set desc metadata

Parameters:
Name Type Description
value
string

Value to set

Source:
Returns:
ClassDecorator

(static) .group(value: string) → ClassDecorator

Set group metadata

Parameters:
Name Type Description
value
string

Value to set

Source:
Returns:
ClassDecorator

(static) .info(value: string) → ClassDecorator

Set info metadata

Parameters:
Name Type Description
value
string

Value to set

Source:
Returns:
ClassDecorator

(static) .name(value: string) → ClassDecorator

Set name metadata

Parameters:
Name Type Description
value
string

Value to set

Source:
Returns:
ClassDecorator

(static) .overloads(value: string) → ClassDecorator

Set overloads metadata

Parameters:
Name Type Description
value
string

Value to set

Source:
Returns:
ClassDecorator

(static) .ratelimit(value: string) → ClassDecorator

Set ratelimit metadata

Parameters:
Name Type Description
value
string

Value to set

Source:
Returns:
ClassDecorator

(static) .roles(values: string) → ClassDecorator

Set roles metadata

Parameters:
Name Type Attributes Description
values
string
<repeatable>

Values to set

Source:
Returns:
ClassDecorator

(static) .usage(value: string) → ClassDecorator

Set usage metadata

Parameters:
Name Type Description
value
string

Value to set

Source:
Returns:
ClassDecorator

(static) .using(func: MiddlewareFunction) → MethodDecorator

Apply a middleware function to the action method of a Command. Identical to Command#use but used as a Command action method decorator

Parameters:
Name Type Description
func
MiddlewareFunction

Middleware function to use for the decorated Command action

Source:
Returns:
MethodDecorator