Abstract
Optional
aliasesThe aliases of the command.
The arguments of the command. You can put your own custom arguments but you must add the type to the argument types.
Optional
categoryThe category of the command.
The command parent directory.
Optional
channelsThe channels where the command should only be executed if used (if using the default message event).
Optional
clientThe client permissions needed to run the command (if using the default message event).
['SEND_MESSAGES']
Optional
cooldownThe cooldown of the command in seconds.
Optional
descriptionThe description of the command.
Readonly
Abstract
nameThe name of the command.
The SubCommands of this command.
Register SubCommands using the Command#registerSubCommands method.
Optional
tagsThe tags of the command.
Optional
usageThe usage of the command.
userinfo
userinfo me
userinfo <ID/Username/Mention of User>
If no value is set, in most places it will use the result of the Command#signatures method.
Optional
userThe user permissions needed to run the command (if using the default message event).
['SEND_MESSAGES']
Returns the names and aliases of this command in an array.
Returns the names and aliases of the subCommands of this command in an array flatted.
Static
Private
getDeletes a message if deletable.
The options, see DeleteMessageOptions.
Execute the run method, but perform validations before, prefer using this method in your custom Message Event.
The CContext.
Get the actual cooldown of the user for this command plus when command has been executed and how many seconds to wait.
Where to get the cooldown from, can be a user/guild/message, see types.
Internal
Returns the invalid permissions (not presents in Permissions.FLAGS).
Returns the missing permissions from the client & user for a context.
The context to validate permissions for.
Gives the tags of this command which are not validated by the context.
i.e. If a command is executed on a guild and the command has the dmOnly
Tag, it will be returned.
The context to test tags from.
Returns true if the user is in a cooldown for this command.
From where to test if user/guild/message is in a cooldown, see types.
If cooldown not set, this will always return false
.
Returns false if channels are defined for this command but the message doesn't come from one of it.
The context to test where it comes from.
Optional
registerAbstract
runThe function to run when executing the command.
The command context.
Use the Command#execute method if you want to have a validation before executing the run method.
Put all the required properties in CommandHandler.cooldowns plus the setTimeout
to remove the user from the cooldowns.
What to use to select the user to set the cooldown from, can be a guild/message/member.
Get the signature of this command.
Optional
options: CommandSignatureOptionsThe options for the signature, show the type of the arguments or the default values.
// The help
command with an optional command
commandArgument argument.
help [command]
Returns the signature of the command plus the signature of the subCommands of this command.
Optional
options: CommandSignatureOptionsThe options for the signature, show the type of the arguments or the default values.
// The help
command with an optional command
commandArgument argument and a all
subCommand with no arguments.
help [command]
help all
Validate a command, returning an error if any of the validation methods are not valid.
The CommandContext.
Protected
subGenerated using TypeDoc
See
https://ayfri.gitbook.io/advanced-command-handler/concepts/commands