Interface NumberOption

interface NumberOption {
    autocomplete?: boolean;
    choises?: { name: string; value: number }[];
    description: string;
    description_localizations?: Partial<Record<Locale, null | string>>;
    max_value?: number;
    min_value?: number;
    name: string;
    name_localizations?: Partial<Record<Locale, null | string>>;
    required?: boolean;
    type: "number" | "integer";
}

Hierarchy (View Summary)

Properties

autocomplete?: boolean

Whether the option supports autocomplete. If true, the user can type in the option and get suggestions. If false, the user must provide a value for this option.

choises?: { name: string; value: number }[]

The choices for the option. This should be an array of objects with a name and value. The name is what the user sees, and the value is what is sent to the server.

description: string

The description of the option. This should be a string that describes what the option does.

description_localizations?: Partial<Record<Locale, null | string>>

The localizations for the command description. This should be an object where the keys are locale codes and the values are the localized descriptions.

{ "en-US": "This is my command" }
max_value?: number

The maximum value of the integer or number. If not specified, there is no maximum value.

min_value?: number

The minimum value of the integer or number. If not specified, there is no minimum value.

name: string

The name of the command, subcommand, subcommand group, option. This should be a lowercase string with no spaces. It can only contain alphanumeric characters, underscores, and dashes.

name_localizations?: Partial<Record<Locale, null | string>>

The localizations for the command name. This should be an object where the keys are locale codes and the values are the localized names.

{ "en-US": "My Command" }
required?: boolean

Whether the option is required. If true, the user must provide a value for this option. If false, the user can skip this option.

type: "number" | "integer"

The type of the option. This should be one of the following:

  • "integer": An integer option
  • "number": A number option