CommandOptionTypes
Last updated
Last updated
The command options can have different types. You can for example let a user type a string or a number, but also provide a channel or a user in the option. These command option types can be imported from the CommandOptionTypes
object. Here is an overview of which command option types there are:
Type | Description |
---|---|
* There is no support for these types yet
** Is supported, but still in bèta
SUB_COMMAND**
Allows you to create a sub command for the main command.
SUB_COMMAND_GROUP**
Allows you to create a sub command group for the main command.
STRING
Allows the user to type something in the option.
INTEGER
Allows the user to type an integer in the option. The difference between an integer and a number is that an integer can only be whole numbers and numbers can have a decimal.
BOOLEAN*
Allows you to receive a boolean from the command option.
USER
Allows a user to search for another user in the command option and provide that user to the bot. The bot will receive it as the User class.
CHANNEL
Allows a user to search for a channel in the command option and provide that channel to the bot. The bot will receive it as a channel class depending on the type of the channel.
ROLE
Allows a user to search for a role in the command option and provide that role to the bot. The bot will receive it as the Role class.
MENTIONABLE*
Allows a user to search for mentionable things, like channels, roles and users, and provide that to the bot. What the bot receives, depends on what kind of mentionable was provided by the user.
NUMBER
Allows the user to type a number in the option. The difference between an integer and a number is that an integer can only be whole numbers and numbers can have a decimal.
ATTACHMENT*
Allows the user to upload an attachment to the bot.