CommandBuilder class
Last updated
Last updated
The constructor provides one optional argument, which is an object which provides the data for the Command Builder.
The object may contain the following information:
name
: The name of the command you want to create.
description
: The description of the command you want to create.
options
: An array with raw data of the command options which users can fill in in the slash command.
nsfw
: A boolean which defines whether the command is NSFW or not.
dm_permission
: Whether the command may be executed in a DM channel.
permissions
: A bigint which defines a permission the user needs to execute the command, converted to a string.
overwrite
: Whether to overwrite any existing commands with the same name.
Argument | Description |
---|---|
The name of the command which was set with the setName function.
The description of the command which was set with the setDescription function.
An array with the options converted to an object to make it a valid Discord API object, that have been set with the addOptions function.
A boolean which defines whether the command should be available in the DM channel of the bot or not.
A permission that has been set with the setPermission function which defines the permission a user needs to execute the command.
A boolean which defines whether the command should be marked as NSFW or not, which was set with the setNSFW function.
A boolean which defines whether the command should overwrite any other existing commands with the same name, which was set with the setOverwrite function.
Sets a name for the command and returns the same CommandBuilder class so you don't have to declare it everytime again. This is required to create a command.
Sets a description for the command and returns the same CommandBuilder class so you don't have to declare it everytime again. This is required to create a command.
Gives the command a category which will be used to display the command in the help embed. The function returns the same CommandBuilder class so you don't have to declare it everytime again. By not using this function, the command will by default get the General
category.
Sets a permission to the command so only users with the set permission can execute the command and returns the same CommandBuilder class so you don't have to declare it everytime again. See the permissionsBitfield page for the available permissions.
Marks or unmarks the command as NSFW and returns the same CommandBuilder class so you don't have to declare it everytime again. If there aren't any arguments provided, the bot will automatically mark the command as NSFW. By setting the nsfw argument to false
, it will unmark the command as nsfw.
Changes the overwrite status of the command and returns the same CommandBuilder class so you don't have to declare it everytime again. The overwrite argument defines whether the command should overwrite any other existing commands with the same name. If there aren't any arguments provided, the bot will automatically overwrite any existing commands with the same name.
Adds options to the command which users can fill in and returns the same CommandBuilder class so you don't have to declare it everytime again. The options will be returned to the addon once the user executes the command.
Converts the CommandBuilder to an object to make it a valid object for the Discord API.
Argument | Description |
---|---|
Argument | Description |
---|---|
Argument | Description |
---|---|
Argument | Description |
---|---|
Argument | Description |
---|---|
Argument | Description |
---|---|
Argument | Description |
---|---|
data
An object with the data to create the Command Builder from. The data which can be added is mentioned above.
name
The name for the command you want to create. This must be a string between 1-32 characters.
description
The description you want to give to the command. This must be a string between 1-100 characters.
category
The category you'd like to give to the command you're creating. This must be one of the categories shown in the help embed of Zyno Bot.
permission
The permission the user needs to execute and view the command. The available permissions can be found here.
nsfw
A boolean which defines whether the command should be marked as NSFW or not.
overwrite
A boolean which defines whether any other commands with the same name should be overwritten or not.
options
An array or a row of CommandOptionsBuilder classes which define the options the users have for this command.