Command
Represents an application command.
Constructor
new Command(client, options);
Name | Type | Description | Default | Optional |
---|---|---|---|---|
client | ShewenyClient | The client. | None | |
options | CommandOptions | The options of the command | None |
Properties
Properties
adminOnly
If the command is only for admins or not.
Return : Boolean
aliases
The args of the command.
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.
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.
Methods
before()
Executed before command checks.
Parameters :
Name | Type | Description |
---|---|---|
interaction | CommandInteraction or ContextMenuInteraction | The interaction |
Return : Promise<any> | any
[abstract] execute()
The execution of command.
Parameters :
Name | Type | Description |
---|---|---|
interaction | CommandInteraction or ContextMenuInteraction or Message | The interaction |
arguments | Object | The arguments (only message-commands) |
Return : Promise<any> | any
onAutocomplete()
The execution of auto-complete (only slash-commands).
Parameters :
Name | Type | Description |
---|---|---|
interaction | CommandInteraction | The 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