Skip to content

CreateNumberOption

Defined in: packages/builders/src/commands.ts:290

Builds a number command option.

  • CreateNumericOption

new CreateNumberOption(): CreateNumberOption

Defined in: packages/builders/src/commands.ts:291

CreateNumberOption

CreateNumericOption.constructor

addChoices(…choices): this

Defined in: packages/builders/src/commands.ts:278

Adds fixed choices.

…object[]

this

CreateNumericOption.addChoices


setAutocomplete(enabled?): this

Defined in: packages/builders/src/commands.ts:267

Enables autocomplete; options with choices cannot use it.

boolean = true

this

CreateNumericOption.setAutocomplete


setDescription(description): this

Defined in: packages/builders/src/commands.ts:168

Sets the option description.

string

this

CreateNumericOption.setDescription


setMaxValue(value): this

Defined in: packages/builders/src/commands.ts:252

Sets the maximum value; it cannot be below the minimum.

number

this

CreateNumericOption.setMaxValue


setMinValue(value): this

Defined in: packages/builders/src/commands.ts:237

Sets the minimum value.

number

this

CreateNumericOption.setMinValue


setName(name): this

Defined in: packages/builders/src/commands.ts:162

Sets the option name.

string

this

CreateNumericOption.setName


setRequired(required?): this

Defined in: packages/builders/src/commands.ts:174

Makes the option required or optional.

boolean = true

this

CreateNumericOption.setRequired


toJSON(): Record<string, unknown>

Defined in: packages/builders/src/commands.ts:190

Serializes the option payload.

Record<string, unknown>

CreateNumericOption.toJSON