Interface OptionBase<T>

interface OptionBase<T> {
    autocomplete?: boolean;
    choises?: { name: string; value: T }[];
    description: string;
    description_localizations?: Partial<Record<Locale, null | string>>;
    name: string;
    name_localizations?: Partial<Record<Locale, null | string>>;
    required?: boolean;
}

Type Parameters

  • T

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: T }[]

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" }
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.