Classhttpv0.6.0
ModalFields
The fields a modal carries, read by custom id.
Every getter throws when no field in the modal has that custom id. It also throws when the field holds a kind that getter does not read. The message names the getter that does.
A select getter resolves the ids its field picked against the interaction's resolved data and returns a Collection keyed by id. A field that picked nothing returns null. Pass required to throw there instead.
class ModalFieldsMember visibility
Filter class members by access level.
ModalFields(data: APIModalSubmission)Showing members with Protected visibility and higher.
public getField<Kind>(
customId: string,
kind: Kind
): Extract<ModalSubmitComponent, { type: Kind }>public getSelectedChannels(
customId: string,
required: true,
channelTypes?: readonly ChannelType[]
): Collection<string, APIInteractionDataResolvedChannel>public getSelectedMembers(
customId: string
): Collection<string, APIInteractionDataResolvedGuildMember> | nullpublic getSelectedMentionables(
customId: string,
required: true
): SelectedMentionablespublic getSelectedRoles(
customId: string,
required: true
): Collection<string, APIRole>public getSelectedUsers(
customId: string,
required: true
): Collection<string, APIUser>public getUploadedFiles(
customId: string,
required: true
): Collection<string, APIAttachment>