Skip to content

The @Command Annotation In Depth

Badbird-5907 edited this page Oct 9, 2021 · 6 revisions

What is the @Command annotation

The @Command annotation defines a command that the bot will listen to and respond to.

Command properties/settings

Name Value Type Required Description Default Value Notes
Name String Yes Defines the name of the command being executed. N/A N/A
Description String No A brief description of what the command does Nothing N/A
Aliases String[] No Any aliases for the command {} N/A
Permission Permission[] No The permission required to execute the command {} JDACommand only checks the first permission defined. because you can't use enums in tables
botOwnerOnly Boolean No Whether the command is owner only false See Defining Bot Owners
serverOwnerOnly Boolean No Whether the command is server OWNER only false This will mark the command as server only
adminOnly Boolean No Whether the command is server ADMIN and ABOVE only false This will mark the command as server only
disable Boolean No Disable the command, especially useful if you're using auto-register commands. false N/A
dmsOnly Boolean No Makes the command only execute if the command is sent through private messages false Will not work in servers
serverOnly Boolean No Makes the command only execute if the command is sent in a server channel. false Will not work in private-messages
cooldown Integer No Sets a cooldown for the command 0 N/A
Clone this wiki locally