dressed
Version:
A sleek, serverless-ready Discord bot framework.
20 lines (19 loc) • 1.58 kB
TypeScript
import { type APIAttachment, type APIInteractionDataResolved, type APIInteractionDataResolvedChannel, type APIRole, type APIUser, type ModalSubmitComponent } from "discord-api-types/v10";
import type { Requirable } from "../../types/utilities.ts";
export interface FieldValueGetters {
/** Return the select menu's values as an array of strings - Component must be a select with type `String` */
stringSelect: () => string[];
/** Return the input's value as a string - Component must be a text input */
textInput: () => string;
/** Return the select menu's values as an array of users - Component type must be a select with type `User` */
userSelect: () => APIUser[];
/** Return the select menu's values as an array of roles - Component type must be a select with type `Role` */
roleSelect: () => APIRole[];
/** Return the select menu's values as an array of users and roles (mentionables) - Component type must be a select with type `Mentionable` */
mentionableSelect: () => (APIUser | APIRole)[];
/** Return the select menu's values as an array of channels - Component type must be a select with type `Channel` */
channelSelect: () => APIInteractionDataResolvedChannel[];
/** Return the file upload's values as an array of attachments - Component type must be a select with type `FileUpload` */
fileUpload: () => APIAttachment[];
}
export declare function getField<R extends boolean>(custom_id: string, required: R, components: ModalSubmitComponent[], resolved?: APIInteractionDataResolved): Requirable<R, FieldValueGetters>;