Classhttpv0.5.1
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 Map 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[]
): Map<string, APIInteractionDataResolvedChannel>public getSelectedMembers(
customId: string
): Map<string, APIInteractionDataResolvedGuildMember> | nullpublic getSelectedMentionables(
customId: string,
required: true
): SelectedMentionablespublic getUploadedFiles(
customId: string,
required: true
): Map<string, APIAttachment>