Module command

Source
Expand description

Constants, error types, and functions for validating [Command]s.

Structs§

CommandValidationError
Error created when a [Command] is invalid.

Enums§

CommandValidationErrorType
Type of CommandValidationError that occurred.

Constants§

CHOICES_LIMIT
Maximum number of choices an option can have.
COMMAND_TOTAL_LENGTH
The maximum combined command length in codepoints.
DESCRIPTION_LENGTH_MAX
Maximum length of a command’s description.
DESCRIPTION_LENGTH_MIN
Minimum length of a command’s description.
GUILD_COMMAND_LIMIT
Maximum number of commands an application may have in an individual guild.
GUILD_COMMAND_PERMISSION_LIMIT
Maximum number of permission overwrites an application may have in an individual guild command.
NAME_LENGTH_MAX
Maximum length of a command’s name.
NAME_LENGTH_MIN
Minimum length of a command’s name.
OPTIONS_LIMIT
Maximum amount of options a command may have.
OPTION_CHOICE_NAME_LENGTH_MAX
Maximum length of an option choice name.
OPTION_CHOICE_NAME_LENGTH_MIN
Minimum length of an option choice name.
OPTION_CHOICE_STRING_VALUE_LENGTH_MAX
Maximum length of an option choice string value.
OPTION_CHOICE_STRING_VALUE_LENGTH_MIN
Minimum length of an option choice string value.
OPTION_DESCRIPTION_LENGTH_MAX
Maximum length of a command’s description.
OPTION_DESCRIPTION_LENGTH_MIN
Minimum length of a command’s description.
OPTION_NAME_LENGTH_MAX
Maximum length of a command’s name.
OPTION_NAME_LENGTH_MIN
Minimum length of a command’s name.

Functions§

chat_input_name
Validate the name of a ChatInput command.
choice
Validate a single [CommandOptionChoice].
choice_name
Validate a single name localization in a [CommandOptionChoice].
command
Validate a [Command].
command_characters
Calculate the total character count of a command.
description
Validate the description of a [Command].
guild_permissions
Validate the number of guild command permission overwrites.
name
Validate the name of a User or Message command.
option
Validate a single [CommandOption].
option_characters
Calculate the total character count of a command option.
option_name
Validate the name of a [CommandOption].
options
Validate a list of command options for count, order, and internal validity.