Skip to main content

Class: InteractionOptionResolver

discord-utilities/src.InteractionOptionResolver

Constructors

constructor

new InteractionOptionResolver(interaction)

Parameters

NameType
interactionAPIApplicationCommandInteraction | APIApplicationCommandAutocompleteInteraction | APIModalSubmitInteraction

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:61

Properties

data

Private Readonly data: null | APIApplicationCommandInteractionDataOption[] = null

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:34


group

Private Readonly group: null | string = null

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:54


hoistedOptions

Private Readonly hoistedOptions: null | APIApplicationCommandInteractionDataOption[] = null

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:49


interaction

Private Readonly interaction: APIApplicationCommandInteraction | APIApplicationCommandAutocompleteInteraction | APIModalSubmitInteraction

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:29


resolved

Private Readonly resolved: null | APIChatInputApplicationCommandInteractionDataResolved | APIUserApplicationCommandInteractionDataResolved | APIMessageApplicationCommandInteractionDataResolved = null

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:39


subcommand

Private Readonly subcommand: null | string = null

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:59

Methods

get

get(name, required?): null | APIApplicationCommandInteractionDataOption

Parameters

NameTypeDescription
namestring
required?boolean

Returns

null | APIApplicationCommandInteractionDataOption

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:83

get(name, required): APIApplicationCommandInteractionDataOption

Parameters

NameTypeDescription
namestring
requiredtrue

Returns

APIApplicationCommandInteractionDataOption

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:84


getAttachment

getAttachment(name, required?): null | APIAttachment

Parameters

NameTypeDescription
namestring
required?boolean

Returns

null | APIAttachment

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:238

getAttachment(name, required): APIAttachment

Parameters

NameTypeDescription
namestring
requiredtrue

Returns

APIAttachment

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:239


getBoolean

getBoolean(name, required?): null | boolean

Parameters

NameTypeDescription
namestring
required?boolean

Returns

null | boolean

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:134

getBoolean(name, required): boolean

Parameters

NameTypeDescription
namestring
requiredtrue

Returns

boolean

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:135


getChannel

getChannel(name, required?): null | APIInteractionDataResolvedChannel

Parameters

NameTypeDescription
namestring
required?boolean

Returns

null | APIInteractionDataResolvedChannel

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:147

getChannel(name, required): APIInteractionDataResolvedChannel

Parameters

NameTypeDescription
namestring
requiredtrue

Returns

APIInteractionDataResolvedChannel

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:148


getFocusedOption

getFocusedOption(): { name: string ; type: String ; value: string } | { name: string ; type: Integer ; value: number } | { name: string ; type: Number ; value: number }

Returns

{ name: string ; type: String ; value: string } | { name: string ; type: Integer ; value: number } | { name: string ; type: Number ; value: number }

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:327


getInteger

getInteger(name, required?): null | number

Parameters

NameTypeDescription
namestring
required?boolean

Returns

null | number

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:173

getInteger(name, required): number

Parameters

NameTypeDescription
namestring
requiredtrue

Returns

number

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:174


getMember

getMember(name, required?): null | APIInteractionDataResolvedGuildMember

Parameters

NameTypeDescription
namestring
required?boolean

Returns

null | APIInteractionDataResolvedGuildMember

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:212

getMember(name, required): APIInteractionDataResolvedGuildMember

Parameters

NameTypeDescription
namestring
requiredtrue

Returns

APIInteractionDataResolvedGuildMember

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:213


getMentionable

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

Parameters

NameTypeDescription
namestring
required?boolean

Returns

null | APIUser | APIInteractionDataResolvedGuildMember | APIRole

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:251

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

Parameters

NameTypeDescription
namestring
requiredtrue

Returns

APIUser | APIInteractionDataResolvedGuildMember | APIRole

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:252


getNumber

getNumber(name, required?): null | number

Parameters

NameTypeDescription
namestring
required?boolean

Returns

null | number

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:186

getNumber(name, required): number

Parameters

NameTypeDescription
namestring
requiredtrue

Returns

number

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:187


getRole

getRole(name, required?): null | APIRole

Parameters

NameTypeDescription
namestring
required?boolean

Returns

null | APIRole

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:225

getRole(name, required): APIRole

Parameters

NameTypeDescription
namestring
requiredtrue

Returns

APIRole

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:226


getString

getString(name, required?): null | string

Parameters

NameTypeDescription
namestring
required?boolean

Returns

null | string

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:160

getString(name, required): string

Parameters

NameTypeDescription
namestring
requiredtrue

Returns

string

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:161


getSubcommand

getSubcommand(required?): null | string

Parameters

NameTypeDescription
required?boolean

Returns

null | string

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:104

getSubcommand(required): string

Parameters

NameTypeDescription
requiredtrue

Returns

string

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:105


getSubcommandGroup

getSubcommandGroup(required?): null | string

Parameters

NameTypeDescription
required?boolean

Returns

null | string

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:119

getSubcommandGroup(required): string

Parameters

NameTypeDescription
requiredtrue

Returns

string

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:120


getTargetMember

getTargetMember(required?): null | APIInteractionDataResolvedGuildMember

Parameters

NameTypeDescription
required?boolean

Returns

null | APIInteractionDataResolvedGuildMember

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:292

getTargetMember(required): APIInteractionDataResolvedGuildMember

Parameters

NameTypeDescription
requiredtrue

Returns

APIInteractionDataResolvedGuildMember

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:293


getTargetMessage

getTargetMessage(): APIMessage

Returns

APIMessage

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:316


getTargetUser

getTargetUser(): APIUser

Returns

APIUser

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:284


getTypedOption

Private getTypedOption<Option>(name, type, required?): null | TypeToOptionMap[Option]

Type parameters

NameType
Optionextends String | Integer | Boolean | User | Channel | Role | Mentionable | Number | Attachment

Parameters

NameType
namestring
typeOption
required?boolean

Returns

null | TypeToOptionMap[Option]

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:348

Private getTypedOption<Option>(name, type, required): TypeToOptionMap[Option]

Type parameters

NameType
Optionextends String | Integer | Boolean | User | Channel | Role | Mentionable | Number | Attachment

Parameters

NameType
namestring
typeOption
requiredtrue

Returns

TypeToOptionMap[Option]

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:354


getUser

getUser(name, required?): null | APIUser

Parameters

NameTypeDescription
namestring
required?boolean

Returns

null | APIUser

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:199

getUser(name, required): APIUser

Parameters

NameTypeDescription
namestring
requiredtrue

Returns

APIUser

Defined in

projects/utilities/packages/discord-utilities/src/lib/InteractionOptionResolver.ts:200