class ModalComponentResolver

export class ModalComponentResolver<Cached extends CacheType = CacheType>

A resolver for modal submit components

Type Parameters

optional
Cached? extends CacheType = CacheType

readonly
client : Client<true>

The client that instantiated this.

readonly
data : readonly (ActionRowModalData | LabelModalData | TextDisplayModalData)[]

The components within the modal

readonly
hoistedComponents : ReadonlyCollection<string, ModalData>

The bottom-level components of the interaction

The interaction resolved data

getComponent(
customId: string
) : ModalData

Gets a component by custom id.

getSelectedChannels<

Type? extends ChannelType = ChannelType

>(
customId: string
required: true = false
channelTypes?: readonly Type[] = []
) : ReadonlyCollection<Snowflake, Extract<NonNullable<CommandInteractionOption<Cached>['channel']>, { type: Type extends ChannelType.AnnouncementThread | ChannelType.PublicThread ? ChannelType.AnnouncementThread | ChannelType.PublicThread : Type; }>>

Gets channels component

Returns: The selected channels, or null if none were selected and not required

getSelectedMembers(
customId: string
) : NonNullable<SelectMenuModalData<Cached>['members']> | null

Gets members component

Returns: The selected members, or null if none were selected or the users were not present in the guild

getSelectedMentionables(
customId: string
required: true = false
) : ModalSelectedMentionables<Cached>

Gets mentionables component

Returns: The selected mentionables, or null if none were selected and not required

getSelectedRoles(
customId: string
required: true = false
) : NonNullable<SelectMenuModalData<Cached>['roles']>

Gets roles component

Returns: The selected roles, or null if none were selected and not required

getSelectedUsers(
customId: string
required: true = false
) : ReadonlyCollection<Snowflake, User>

Gets users component

Returns: The selected users, or null if none were selected and not required

getStringSelectValues(
customId: string
) : readonly string[]

Gets the values of a string select component

getTextInputValue(
customId: string
) : string

Gets the value of a text input component