Skip to content

CreateStringOption

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

Builds a string command option.

new CreateStringOption(): CreateStringOption

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

Creates a string option.

CreateStringOption

CreateCommandOption.constructor

addChoices(…choices): this

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

Adds string choices.

…object[]

this


setAutocomplete(enabled?): this

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

Sets autocomplete; options with choices cannot use it.

boolean = true

this

CreateCommandOption.setAutocomplete


setDescription(description): this

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

Sets the option description.

string

this

CreateCommandOption.setDescription


setMaxLength(value): this

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

Sets the maximum string length.

number

this


setMinLength(value): this

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

Sets the minimum string length.

number

this


setName(name): this

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

Sets the option name.

string

this

CreateCommandOption.setName


setRequired(required?): this

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

Makes the option required or optional.

boolean = true

this

CreateCommandOption.setRequired


toJSON(): Record<string, unknown>

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

Serializes the option payload.

Record<string, unknown>

CreateCommandOption.toJSON