Skip to content

CommandOptions

Defined in: packages/structures/src/options.ts:35

Typed resolver for application command options. Attached as CommandInteraction.options.

get raw(): readonly APIInteractionDataOption[]

Defined in: packages/structures/src/options.ts:339

Returns the raw option list for advanced use cases.

readonly APIInteractionDataOption[]

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.

string

Option name.

false

If true, throws when missing.

Record<string, unknown> | null

getAttachment(name, required): Record<string, unknown>

Defined in: packages/structures/src/options.ts:316

Gets the raw resolved attachment data for an attachment option.

string

Option name.

true

If true, throws when missing.

Record<string, unknown>


getBoolean(name, required?): boolean | null

Defined in: packages/structures/src/options.ts:170

Gets a boolean option.

string

Option name.

false

If true, throws when missing.

boolean | null

getBoolean(name, required): boolean

Defined in: packages/structures/src/options.ts:171

Gets a boolean option.

string

Option name.

true

If true, throws when missing.

boolean


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.

string

Option name.

false

If true, throws when missing.

Record<string, unknown> | null

getChannel(name, required): Record<string, unknown>

Defined in: packages/structures/src/options.ts:221

Gets the raw resolved channel data for a channel option.

string

Option name.

true

If true, throws when missing.

Record<string, unknown>


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.

true

APIInteractionDataOption

If no option is focused.

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.

false

string | number | boolean

If no option is focused.


getInteger(name, required?): number | null

Defined in: packages/structures/src/options.ts:140

Gets an integer option.

string

Option name.

false

If true, throws when missing.

number | null

getInteger(name, required): number

Defined in: packages/structures/src/options.ts:141

Gets an integer option.

string

Option name.

true

If true, throws when missing.

number


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.

string

Option name.

false

If true, throws when missing.

Record<string, unknown> | null

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.

string

Option name.

true

If true, throws when missing.

Record<string, unknown>


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.

string

Option name.

"user" | "role" | null


getNumber(name, required?): number | null

Defined in: packages/structures/src/options.ts:155

Gets a number (float) option.

string

Option name.

false

If true, throws when missing.

number | null

getNumber(name, required): number

Defined in: packages/structures/src/options.ts:156

Gets a number (float) option.

string

Option name.

true

If true, throws when missing.

number


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.

string

Option name.

false

If true, throws when missing.

Record<string, unknown> | null

getRole(name, required): Record<string, unknown>

Defined in: packages/structures/src/options.ts:248

Gets the raw resolved role data for a role option.

string

Option name.

true

If true, throws when missing.

Record<string, unknown>


getString(name, required?): string | null

Defined in: packages/structures/src/options.ts:125

Gets a string option.

string

Option name.

false

If true, throws when missing.

string | null

getString(name, required): string

Defined in: packages/structures/src/options.ts:126

Gets a string option.

string

Option name.

true

If true, throws when missing.

string


getSubcommand(required?): string | null

Defined in: packages/structures/src/options.ts:90

Returns the invoked subcommand name, or null if none.

false

string | null

getSubcommand(required): string

Defined in: packages/structures/src/options.ts:91

Returns the invoked subcommand name, or null if none.

true

string


getSubcommandGroup(required?): string | null

Defined in: packages/structures/src/options.ts:100

Returns the invoked subcommand group name, or null if none.

false

string | null

getSubcommandGroup(required): string

Defined in: packages/structures/src/options.ts:101

Returns the invoked subcommand group name, or null if none.

true

string


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.

string

Option name.

false

If true, throws when missing.

UserData & Record<string, unknown> | null

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.

string

Option name.

true

If true, throws when missing.

UserData & Record<string, unknown>