import type { AllChannels, Attachment, ModalCommand, ModalSubmitInteraction, ReturnCache } from '..'; import type { GuildMemberStructure, GuildRoleStructure, GuildStructure, InteractionGuildMemberStructure, UserStructure, WebhookMessageStructure } from '../client/transformers'; import type { CommandMetadata, ExtendContext, GlobalMetadata, ResolvedRegisteredMiddlewares, UsingClient } from '../commands'; import { BaseContext } from '../commands/basecontext'; import type { ComponentInteractionMessageUpdate, InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest, MakeRequired, MessageWebhookCreateBodyRequest, ModalCreateBodyRequest, ModalCreateOptions, When } from '../common'; import { type RESTGetAPIGuildQuery } from '../types'; export interface ModalContext extends BaseContext, ExtendContext { } /** * Represents a context for interacting with components in a Discord bot. * @template Type - The type of component interaction. */ export declare class ModalContext extends BaseContext { readonly client: UsingClient; interaction: ModalSubmitInteraction; /** * Creates a new instance of the ComponentContext class. * @param client - The UsingClient instance. * @param interaction - The component interaction object. */ constructor(client: UsingClient, interaction: ModalSubmitInteraction); command: ModalCommand; metadata: CommandMetadata; globalMetadata: GlobalMetadata; get components(): { type: import("..").ComponentType.Label; id?: number | undefined; component?: { type: import("..").ComponentType.FileUpload; values: string[]; id?: number | undefined; customId: string; } | { type: import("..").ComponentType.RadioGroup; value: string; id?: number | undefined; customId: string; } | { type: import("..").ComponentType.CheckboxGroup; values: string[]; id?: number | undefined; customId: string; } | { type: import("..").ComponentType.Checkbox; value: boolean; id?: number | undefined; customId: string; } | { type: import("..").ComponentType.TextInput; value: string; id?: number | undefined; customId: string; } | { type: import("..").ComponentType.StringSelect | import("..").ComponentType.UserSelect | import("..").ComponentType.RoleSelect | import("..").ComponentType.MentionableSelect | import("..").ComponentType.ChannelSelect; values: string[]; id?: number | undefined; customId: string; } | undefined; }[]; get customId(): string; /** * Gets the language object for the interaction's locale. */ get t(): import("..").SeyfertLocale; getChannels(customId: string, required: true): AllChannels[]; getChannels(customId: string, required?: false): AllChannels[] | void; getRoles(customId: string, required: true): GuildRoleStructure[]; getRoles(customId: string, required?: false): GuildRoleStructure[] | void; getUsers(customId: string, required: true): UserStructure[]; getUsers(customId: string, required?: false): UserStructure[] | void; getMentionables(customId: string, required: true): (UserStructure | GuildRoleStructure | InteractionGuildMemberStructure)[]; getMentionables(customId: string, required?: false): (UserStructure | GuildRoleStructure | InteractionGuildMemberStructure)[] | void; getRadioValues(customId: string, required: true): string; getRadioValues(customId: string, required?: false): string | void; getCheckboxValues(customId: string, required: true): string[]; getCheckboxValues(customId: string, required?: false): string[] | void; getCheckbox(customId: string, required: true): boolean; getCheckbox(customId: string, required?: false): boolean | void; getInputValue(customId: string, required: true): string | string[]; getInputValue(customId: string, required?: false): string | string[] | undefined; getFiles(customId: string, required: true): Attachment[]; getFiles(customId: string, required?: false): Attachment[] | undefined; /** * Writes a response to the interaction. * @param body - The body of the response. * @param fetchReply - Whether to fetch the reply or not. */ write(body: InteractionCreateBodyRequest, fetchReply?: FR): Promise>; /** * Defers the reply to the interaction. * @param ephemeral - Whether the reply should be ephemeral or not. */ deferReply(ephemeral?: boolean, fetchReply?: FR): Promise>; update(body: ComponentInteractionMessageUpdate, withResponse?: WR): Promise>; deferUpdate(): Promise; /** * Edits the response of the interaction. * @param body - The updated body of the response. */ editResponse(body: InteractionMessageUpdateBodyRequest): Promise; /** * Edits the response or replies to the interaction. * @param body - The body of the response or updated body of the interaction. * @param fetchReply - Whether to fetch the reply or not. */ editOrReply(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, fetchReply?: FR): Promise>; followup(body: MessageWebhookCreateBodyRequest): Promise; /** * @returns A Promise that resolves to the fetched message */ fetchResponse(): Promise; /** * Deletes the response of the interaction. * @returns A promise that resolves when the response is deleted. */ deleteResponse(): Promise; modal(body: ModalCreateBodyRequest, options?: undefined): Promise; modal(body: ModalCreateBodyRequest, options: ModalCreateOptions): Promise; /** * Gets the channel of the interaction. * @param mode - The mode to fetch the channel. * @returns A promise that resolves to the channel. */ channel(mode?: 'rest' | 'flow'): Promise; channel(mode: 'cache'): ReturnCache; /** * Gets the bot member in the guild of the interaction. * @param mode - The mode to fetch the member. * @returns A promise that resolves to the bot member. */ me(mode?: 'rest' | 'flow'): Promise; me(mode: 'cache'): ReturnCache; /** * Gets the guild of the interaction. * @param mode - The mode to fetch the guild. * @returns A promise that resolves to the guild. */ guild(mode?: 'rest' | 'flow', query?: RESTGetAPIGuildQuery): Promise | undefined>; guild(mode: 'cache'): ReturnCache | undefined>; /** * Gets the ID of the guild of the interaction. */ get guildId(): string | undefined; /** * Gets the ID of the channel of the interaction. */ get channelId(): string; /** * Gets the author of the interaction. */ get author(): UserStructure; /** * Gets the member of the interaction. */ get member(): InteractionGuildMemberStructure | undefined; isModal(): this is ModalContext; inGuild(): this is GuildModalContext; } export interface GuildModalContext extends Omit, 'guildId' | 'member'>, 'guild' | 'me'> { guild(mode?: 'rest' | 'flow', query?: RESTGetAPIGuildQuery): Promise>; guild(mode: 'cache'): ReturnCache | undefined>; me(mode?: 'rest' | 'flow'): Promise; me(mode: 'cache'): ReturnCache; }