Skip to content
On this page

Command

Represents an application command.

Constructor

js
new Command(client, options);
NameTypeDescriptionDefaultOptional
clientShewenyClientThe client.None
optionsCommandOptionsThe options of the commandNone
Properties
Methods

Properties

adminOnly

If the command is only for admins or not.

Return : Boolean

aliases

The args of the command.

Return : Array<String>

args

The args of the command.

Return : Array<CommandOptions>

category

The category of the command.

Return : String

channel

The channel of the command.

Return : CommandOptionOnly

client

The framework client.

Return : ShewenyClient

clientPermissions

The name of the command.

Return : Array<String>

cooldown

The cooldown of the command.

Return : Number

cooldowns

Actives cooldowns for the command.

Return : Collection<String, Collection<String, Number>>;

defaultPermission

If the command can be used by default or not.

Return : Boolean

description

The description of the command.

Return : String

descriptionLocalizations

The description of the command in other languages.

Return : Object<Locale, String>

enabled

If this structure is enabled or not.

examples

The examples of the command.

Return : String or Array<String>

manager

The manager of this structure.

Return : CommandsManager

name

The name of the command.

Return : String

nameLocalizations

The name of the command in other languages.

Return : Object<Locale, String>

options

The options of the command.

Return : Array<ApplicationCommandOptionData>

path

The path of the file.

Return : String

type

The type of the command.

Return : String

usage

The usage of the command.

Return : String or Array<String>

userPermissions

The userPermissions of the command.

Return : Array<String>

Methods

before()

Executed before command checks.

Parameters :

NameTypeDescription
interactionCommandInteraction or ContextMenuInteractionThe interaction

Return : Promise<any> | any

[abstract] execute()

The execution of command.

Parameters :

NameTypeDescription
interactionCommandInteraction or ContextMenuInteraction or MessageThe interaction
argumentsObjectThe arguments (only message-commands)

Return : Promise<any> | any

onAutocomplete()

The execution of auto-complete (only slash-commands).

Parameters :

NameTypeDescription
interactionCommandInteractionThe auto-complete interaction

Return : Promise<any> | any

[async] register()

Register the command.

Return : Promise<ApplicationCommand> | Null

[async] reload()

Reload a command of bot.

Return : Promise<ApplicationCommand> | Null

unregister()

Unregister a command from the bot.

Return : Boolean