CommandOptions
Defined in: packages/structures/src/options.ts:35
Typed resolver for application command options.
Attached as CommandInteraction.options.
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get raw(): readonly
APIInteractionDataOption[]
Defined in: packages/structures/src/options.ts:339
Returns the raw option list for advanced use cases.
Returns
Section titled “Returns”readonly APIInteractionDataOption[]
Methods
Section titled “Methods”getAttachment()
Section titled “getAttachment()”Call Signature
Section titled “Call Signature”getAttachment(
name,required?):Record<string,unknown> |null
Defined in: packages/structures/src/options.ts:312
Gets the raw resolved attachment data for an attachment option.
Parameters
Section titled “Parameters”string
Option name.
required?
Section titled “required?”false
If true, throws when missing.
Returns
Section titled “Returns”Record<string, unknown> | null
Call Signature
Section titled “Call Signature”getAttachment(
name,required):Record<string,unknown>
Defined in: packages/structures/src/options.ts:316
Gets the raw resolved attachment data for an attachment option.
Parameters
Section titled “Parameters”string
Option name.
required
Section titled “required”true
If true, throws when missing.
Returns
Section titled “Returns”Record<string, unknown>
getBoolean()
Section titled “getBoolean()”Call Signature
Section titled “Call Signature”getBoolean(
name,required?):boolean|null
Defined in: packages/structures/src/options.ts:170
Gets a boolean option.
Parameters
Section titled “Parameters”string
Option name.
required?
Section titled “required?”false
If true, throws when missing.
Returns
Section titled “Returns”boolean | null
Call Signature
Section titled “Call Signature”getBoolean(
name,required):boolean
Defined in: packages/structures/src/options.ts:171
Gets a boolean option.
Parameters
Section titled “Parameters”string
Option name.
required
Section titled “required”true
If true, throws when missing.
Returns
Section titled “Returns”boolean
getChannel()
Section titled “getChannel()”Call Signature
Section titled “Call Signature”getChannel(
name,required?):Record<string,unknown> |null
Defined in: packages/structures/src/options.ts:217
Gets the raw resolved channel data for a channel option.
Parameters
Section titled “Parameters”string
Option name.
required?
Section titled “required?”false
If true, throws when missing.
Returns
Section titled “Returns”Record<string, unknown> | null
Call Signature
Section titled “Call Signature”getChannel(
name,required):Record<string,unknown>
Defined in: packages/structures/src/options.ts:221
Gets the raw resolved channel data for a channel option.
Parameters
Section titled “Parameters”string
Option name.
required
Section titled “required”true
If true, throws when missing.
Returns
Section titled “Returns”Record<string, unknown>
getFocused()
Section titled “getFocused()”Call Signature
Section titled “Call Signature”getFocused(
full):APIInteractionDataOption
Defined in: packages/structures/src/options.ts:112
Returns the focused option’s value (autocomplete), or the full option when full is true.
Parameters
Section titled “Parameters”true
Returns
Section titled “Returns”Throws
Section titled “Throws”If no option is focused.
Call Signature
Section titled “Call Signature”getFocused(
full?):string|number|boolean
Defined in: packages/structures/src/options.ts:113
Returns the focused option’s value (autocomplete), or the full option when full is true.
Parameters
Section titled “Parameters”false
Returns
Section titled “Returns”string | number | boolean
Throws
Section titled “Throws”If no option is focused.
getInteger()
Section titled “getInteger()”Call Signature
Section titled “Call Signature”getInteger(
name,required?):number|null
Defined in: packages/structures/src/options.ts:140
Gets an integer option.
Parameters
Section titled “Parameters”string
Option name.
required?
Section titled “required?”false
If true, throws when missing.
Returns
Section titled “Returns”number | null
Call Signature
Section titled “Call Signature”getInteger(
name,required):number
Defined in: packages/structures/src/options.ts:141
Gets an integer option.
Parameters
Section titled “Parameters”string
Option name.
required
Section titled “required”true
If true, throws when missing.
Returns
Section titled “Returns”number
getMentionable()
Section titled “getMentionable()”Call Signature
Section titled “Call Signature”getMentionable(
name,required?):Record<string,unknown> |null
Defined in: packages/structures/src/options.ts:271
Gets the raw resolved user or role data for a mentionable option.
Parameters
Section titled “Parameters”string
Option name.
required?
Section titled “required?”false
If true, throws when missing.
Returns
Section titled “Returns”Record<string, unknown> | null
Call Signature
Section titled “Call Signature”getMentionable(
name,required):Record<string,unknown>
Defined in: packages/structures/src/options.ts:275
Gets the raw resolved user or role data for a mentionable option.
Parameters
Section titled “Parameters”string
Option name.
required
Section titled “required”true
If true, throws when missing.
Returns
Section titled “Returns”Record<string, unknown>
getMentionableType()
Section titled “getMentionableType()”getMentionableType(
name):"user"|"role"|null
Defined in: packages/structures/src/options.ts:302
Whether a mentionable option picked a user or a role; null when the option is missing.
Parameters
Section titled “Parameters”string
Option name.
Returns
Section titled “Returns”"user" | "role" | null
getNumber()
Section titled “getNumber()”Call Signature
Section titled “Call Signature”getNumber(
name,required?):number|null
Defined in: packages/structures/src/options.ts:155
Gets a number (float) option.
Parameters
Section titled “Parameters”string
Option name.
required?
Section titled “required?”false
If true, throws when missing.
Returns
Section titled “Returns”number | null
Call Signature
Section titled “Call Signature”getNumber(
name,required):number
Defined in: packages/structures/src/options.ts:156
Gets a number (float) option.
Parameters
Section titled “Parameters”string
Option name.
required
Section titled “required”true
If true, throws when missing.
Returns
Section titled “Returns”number
getRole()
Section titled “getRole()”Call Signature
Section titled “Call Signature”getRole(
name,required?):Record<string,unknown> |null
Defined in: packages/structures/src/options.ts:244
Gets the raw resolved role data for a role option.
Parameters
Section titled “Parameters”string
Option name.
required?
Section titled “required?”false
If true, throws when missing.
Returns
Section titled “Returns”Record<string, unknown> | null
Call Signature
Section titled “Call Signature”getRole(
name,required):Record<string,unknown>
Defined in: packages/structures/src/options.ts:248
Gets the raw resolved role data for a role option.
Parameters
Section titled “Parameters”string
Option name.
required
Section titled “required”true
If true, throws when missing.
Returns
Section titled “Returns”Record<string, unknown>
getString()
Section titled “getString()”Call Signature
Section titled “Call Signature”getString(
name,required?):string|null
Defined in: packages/structures/src/options.ts:125
Gets a string option.
Parameters
Section titled “Parameters”string
Option name.
required?
Section titled “required?”false
If true, throws when missing.
Returns
Section titled “Returns”string | null
Call Signature
Section titled “Call Signature”getString(
name,required):string
Defined in: packages/structures/src/options.ts:126
Gets a string option.
Parameters
Section titled “Parameters”string
Option name.
required
Section titled “required”true
If true, throws when missing.
Returns
Section titled “Returns”string
getSubcommand()
Section titled “getSubcommand()”Call Signature
Section titled “Call Signature”getSubcommand(
required?):string|null
Defined in: packages/structures/src/options.ts:90
Returns the invoked subcommand name, or null if none.
Parameters
Section titled “Parameters”required?
Section titled “required?”false
Returns
Section titled “Returns”string | null
Call Signature
Section titled “Call Signature”getSubcommand(
required):string
Defined in: packages/structures/src/options.ts:91
Returns the invoked subcommand name, or null if none.
Parameters
Section titled “Parameters”required
Section titled “required”true
Returns
Section titled “Returns”string
getSubcommandGroup()
Section titled “getSubcommandGroup()”Call Signature
Section titled “Call Signature”getSubcommandGroup(
required?):string|null
Defined in: packages/structures/src/options.ts:100
Returns the invoked subcommand group name, or null if none.
Parameters
Section titled “Parameters”required?
Section titled “required?”false
Returns
Section titled “Returns”string | null
Call Signature
Section titled “Call Signature”getSubcommandGroup(
required):string
Defined in: packages/structures/src/options.ts:101
Returns the invoked subcommand group name, or null if none.
Parameters
Section titled “Parameters”required
Section titled “required”true
Returns
Section titled “Returns”string
getUser()
Section titled “getUser()”Call Signature
Section titled “Call Signature”getUser(
name,required?):UserData&Record<string,unknown> |null
Defined in: packages/structures/src/options.ts:187
Gets the raw resolved user data for a user option.
Parameters
Section titled “Parameters”string
Option name.
required?
Section titled “required?”false
If true, throws when missing.
Returns
Section titled “Returns”UserData & Record<string, unknown> | null
Call Signature
Section titled “Call Signature”getUser(
name,required):UserData&Record<string,unknown>
Defined in: packages/structures/src/options.ts:191
Gets the raw resolved user data for a user option.
Parameters
Section titled “Parameters”string
Option name.
required
Section titled “required”true
If true, throws when missing.
Returns
Section titled “Returns”UserData & Record<string, unknown>