Skip to content

OptionConfig

OptionConfig<T, R, C> = object & OptionLimits<T> & object

Defined in: option.ts:24

T extends keyof OptionValue

R extends boolean

C

optional choices?: C

The only values the user can pick, keyed by the label Discord shows. For a string, integer or number option.

description: string

The text Discord shows under the option name.

optional locales?: Locales

The name and description in other languages, keyed by Discord locale.

optional required?: R

Whether the user must fill it in. Defaults to false.

optional autocomplete?: [Choice<T>] extends [never] ? never : [C] extends [never] ? (c) => Suggestion<Choice<T>>[] | Promise<Suggestion<Choice<T>>[]> : never

Suggests values as the user types, instead of fixed choices. Gets what the user has typed so far as c.value and returns up to 25 suggestions, as plain values or as { name, value }.