CreateCommandOption
Defined in: packages/builders/src/commands.ts:155
Base builder for command options.
Extended by
Section titled “Extended by”CreateStringOptionCreateBooleanOptionCreateUserOptionCreateChannelOptionCreateRoleOptionCreateMentionableOptionCreateAttachmentOptionCreateSubcommandCreateSubcommandGroup
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CreateCommandOption(
type):CreateCommandOption
Defined in: packages/builders/src/commands.ts:158
Creates an option builder.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”CreateCommandOption
Methods
Section titled “Methods”setAutocomplete()
Section titled “setAutocomplete()”setAutocomplete(
enabled?):this
Defined in: packages/builders/src/commands.ts:179
Sets autocomplete; options with choices cannot use it.
Parameters
Section titled “Parameters”enabled?
Section titled “enabled?”boolean = true
Returns
Section titled “Returns”this
setDescription()
Section titled “setDescription()”setDescription(
description):this
Defined in: packages/builders/src/commands.ts:168
Sets the option description.
Parameters
Section titled “Parameters”description
Section titled “description”string
Returns
Section titled “Returns”this
setName()
Section titled “setName()”setName(
name):this
Defined in: packages/builders/src/commands.ts:162
Sets the option name.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”this
setRequired()
Section titled “setRequired()”setRequired(
required?):this
Defined in: packages/builders/src/commands.ts:174
Makes the option required or optional.
Parameters
Section titled “Parameters”required?
Section titled “required?”boolean = true
Returns
Section titled “Returns”this
toJSON()
Section titled “toJSON()”toJSON():
Record<string,unknown>
Defined in: packages/builders/src/commands.ts:190
Serializes the option payload.
Returns
Section titled “Returns”Record<string, unknown>