Skip to main content

Class: InteractionOptionResolver

Utility class for resolving command interaction options while working with the raw API. Based on https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/structures/CommandInteractionOptionResolver.js

Constructors

new InteractionOptionResolver()

new InteractionOptionResolver(interaction: APIApplicationCommandInteraction | APIApplicationCommandAutocompleteInteraction | APIModalSubmitInteraction): InteractionOptionResolver

Parameters

ParameterType
interactionAPIApplicationCommandInteraction | APIApplicationCommandAutocompleteInteraction | APIModalSubmitInteraction

Returns

InteractionOptionResolver

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:30

Properties

data

private readonly data: any

The interaction options array

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:12


getTypedOption

private getTypedOption: any

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:83


group

private readonly group: any

The name of the subcommand group

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:25


hoistedOptions

private readonly hoistedOptions: any

Bottom-level options for the interaction If there is a subcommand (or subcommand and group), this represents the options for the subcommand.

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:21


interaction

private readonly interaction: any

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:8


resolved

private readonly resolved: any

The interaction resolved data

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:16


subcommand

private readonly subcommand: any

The name of the subcommand

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:29

Methods

get()

get(name, required)

get(name: string, required?: boolean): null | APIApplicationCommandInteractionDataOption

Parameters
ParameterType
namestring
required?boolean
Returns

null | APIApplicationCommandInteractionDataOption

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:31

get(name, required)

get(name: string, required: true): APIApplicationCommandInteractionDataOption

Parameters
ParameterType
namestring
requiredtrue
Returns

APIApplicationCommandInteractionDataOption

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:32


getAttachment()

getAttachment(name, required)

getAttachment(name: string, required?: boolean): null | APIAttachment

Parameters
ParameterType
namestring
required?boolean
Returns

null | APIAttachment

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:53

getAttachment(name, required)

getAttachment(name: string, required: true): APIAttachment

Parameters
ParameterType
namestring
requiredtrue
Returns

APIAttachment

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:54


getBoolean()

getBoolean(name, required)

getBoolean(name: string, required?: boolean): null | boolean

Parameters
ParameterType
namestring
required?boolean
Returns

null | boolean

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:37

getBoolean(name, required)

getBoolean(name: string, required: true): boolean

Parameters
ParameterType
namestring
requiredtrue
Returns

boolean

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:38


getChannel()

getChannel(name, required)

getChannel(name: string, required?: boolean): null | APIInteractionDataResolvedChannel

Parameters
ParameterType
namestring
required?boolean
Returns

null | APIInteractionDataResolvedChannel

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:39

getChannel(name, required)

getChannel(name: string, required: true): APIInteractionDataResolvedChannel

Parameters
ParameterType
namestring
requiredtrue
Returns

APIInteractionDataResolvedChannel

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:40


getFocusedOption()

getFocusedOption(): object | object | object

Gets the focused option for an autocomplete interaction

Returns

object | object | object

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:70


getInteger()

getInteger(name, required)

getInteger(name: string, required?: boolean): null | number

Parameters
ParameterType
namestring
required?boolean
Returns

null | number

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:43

getInteger(name, required)

getInteger(name: string, required: true): number

Parameters
ParameterType
namestring
requiredtrue
Returns

number

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:44


getMember()

getMember(name, required)

getMember(name: string, required?: boolean): null | APIInteractionDataResolvedGuildMember

Parameters
ParameterType
namestring
required?boolean
Returns

null | APIInteractionDataResolvedGuildMember

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:49

getMember(name, required)

getMember(name: string, required: true): APIInteractionDataResolvedGuildMember

Parameters
ParameterType
namestring
requiredtrue
Returns

APIInteractionDataResolvedGuildMember

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:50


getMentionable()

getMentionable(name, required)

getMentionable(name: string, required?: boolean): null | APIRole | APIUser | APIInteractionDataResolvedGuildMember

Parameters
ParameterType
namestring
required?boolean
Returns

null | APIRole | APIUser | APIInteractionDataResolvedGuildMember

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:55

getMentionable(name, required)

getMentionable(name: string, required: true): APIRole | APIUser | APIInteractionDataResolvedGuildMember

Parameters
ParameterType
namestring
requiredtrue
Returns

APIRole | APIUser | APIInteractionDataResolvedGuildMember

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:56


getNumber()

getNumber(name, required)

getNumber(name: string, required?: boolean): null | number

Parameters
ParameterType
namestring
required?boolean
Returns

null | number

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:45

getNumber(name, required)

getNumber(name: string, required: true): number

Parameters
ParameterType
namestring
requiredtrue
Returns

number

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:46


getRole()

getRole(name, required)

getRole(name: string, required?: boolean): null | APIRole

Parameters
ParameterType
namestring
required?boolean
Returns

null | APIRole

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:51

getRole(name, required)

getRole(name: string, required: true): APIRole

Parameters
ParameterType
namestring
requiredtrue
Returns

APIRole

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:52


getString()

getString(name, required)

getString(name: string, required?: boolean): null | string

Parameters
ParameterType
namestring
required?boolean
Returns

null | string

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:41

getString(name, required)

getString(name: string, required: true): string

Parameters
ParameterType
namestring
requiredtrue
Returns

string

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:42


getSubcommand()

getSubcommand(required)

getSubcommand(required?: boolean): null | string

Parameters
ParameterType
required?boolean
Returns

null | string

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:33

getSubcommand(required)

getSubcommand(required: true): string

Parameters
ParameterType
requiredtrue
Returns

string

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:34


getSubcommandGroup()

getSubcommandGroup(required)

getSubcommandGroup(required?: boolean): null | string

Parameters
ParameterType
required?boolean
Returns

null | string

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:35

getSubcommandGroup(required)

getSubcommandGroup(required: true): string

Parameters
ParameterType
requiredtrue
Returns

string

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:36


getTargetMember()

getTargetMember(required)

getTargetMember(required?: boolean): null | APIInteractionDataResolvedGuildMember

Parameters
ParameterType
required?boolean
Returns

null | APIInteractionDataResolvedGuildMember

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:61

getTargetMember(required)

getTargetMember(required: true): APIInteractionDataResolvedGuildMember

Parameters
ParameterType
requiredtrue
Returns

APIInteractionDataResolvedGuildMember

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:62


getTargetMessage()

getTargetMessage(): APIMessage

Gets the target message for a context menu interaction

Returns

APIMessage

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:66


getTargetUser()

getTargetUser(): APIUser

Gets the target user for a context menu interaction

Returns

APIUser

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:60


getUser()

getUser(name, required)

getUser(name: string, required?: boolean): null | APIUser

Parameters
ParameterType
namestring
required?boolean
Returns

null | APIUser

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:47

getUser(name, required)

getUser(name: string, required: true): APIUser

Parameters
ParameterType
namestring
requiredtrue
Returns

APIUser

Source

node_modules/@sapphire/discord-utilities/dist/esm/index.d.mts:48