import { type APIInteraction, type InteractionType } from "discord-api-types/v10"; import { type Client, Embed, Guild, Message, type Modal, User } from "../index.js"; import { GuildMember } from "../structures/GuildMember.js"; import type { MessagePayload } from "../types/index.js"; import { Base } from "./Base.js"; export type InteractionDefaults = { ephemeral?: boolean; }; /** * This is the base type interaction, all interaction types extend from this */ export declare abstract class BaseInteraction extends Base { /** * The type of interaction */ type: InteractionType; /** * The internal raw data of the interaction */ protected _rawData: T; /** * The raw Discord API data for this interaction */ get rawData(): Readonly; /** * The user who sent the interaction */ userId: string | undefined; /** * Whether the interaction is deferred already * @internal */ _deferred: boolean; private defaultEphemeral; constructor(client: Client, data: T, defaults: InteractionDefaults); get embeds(): Embed[] | null; get message(): Message | null; get guild(): Guild | null; get user(): User | null; get channel(): import("../index.js").DmChannel | import("../index.js").GroupDmChannel | import("../index.js").GuildTextChannel | import("../index.js").GuildVoiceChannel | import("../index.js").GuildCategoryChannel | import("../index.js").GuildAnnouncementChannel | import("../index.js").GuildThreadChannel | import("../index.js").GuildThreadChannel | import("../index.js").GuildThreadChannel | import("../index.js").GuildStageChannel | import("../index.js").GuildForumChannel | import("../index.js").GuildMediaChannel | null; get member(): GuildMember | null; /** * @internal * Automatically register components found in a message payload when sending the message. */ protected _internalAutoRegisterComponentsOnSend(data: MessagePayload): void; /** * @internal * Register components found in a message payload when sending the message. */ private _internalRegisterComponentsOnSend; /** * Reply to an interaction. * If the interaction is deferred, this will edit the original response. * @param data The message data to send */ reply(data: MessagePayload, overrideAutoRegister?: boolean): Promise>; /** * Set the default ephemeral value for this interaction * @internal */ setDefaultEphemeral(ephemeral: boolean): void; /** * Defer the interaction response. This is used automatically by commands that are set to defer. * If the interaction is already deferred, this will do nothing. * @internal */ defer({ ephemeral }?: { ephemeral?: boolean | undefined; }): Promise; /** * Show a modal to the user * This can only be used if the interaction is not deferred */ showModal(modal: Modal): Promise; /** * Send a followup message to the interaction */ followUp(reply: MessagePayload): Promise; /** * This function will reply to the interaction and wait for a component to be pressed. * Any components passed in the message will not have run() functions called and * will only trigger the interaction.acknowledge() function. * This function will also return a promise that resolves * to the custom ID of the component that was pressed. * * @param data The message data to send * @param timeout After this many milliseconds, the promise will resolve to null */ replyAndWaitForComponent(data: MessagePayload, timeout?: number): Promise<{ /** * Whether the interaction was successful */ success: true; /** * The custom ID of the component that was pressed */ customId: string; /** * The message object returned by the interaction reply */ message: Message; /** * If this is a select menu, this will be the values of the selected options */ values?: string[]; } | { /** * Whether the interaction was successful */ success: false; /** * The message object returned by the interaction reply */ message: Message; /** * The reason the interaction failed */ reason: "timed out"; }>; /** * This function will edit to the interaction and wait for a component to be pressed. * Any components passed in the message will not have run() functions called and * will only trigger the interaction.acknowledge() function. * This function will also return a promise that resolves * to the custom ID of the component that was pressed. * * @param data The message data to send * @param message The message to edit (defaults to the interaction's original message) * @param {number} [timeout=300000] After this many milliseconds, the promise will resolve to null * * @returns Will return null if the interaction has not yet been replied to or if the message provided no longer exists */ editAndWaitForComponent(data: MessagePayload, message?: Message, timeout?: number): Promise<{ /** * Whether the interaction was successful */ success: true; /** * The custom ID of the component that was pressed */ customId: string; /** * The message object returned by the interaction reply */ message: Message; /** * If this is a select menu, this will be the values of the selected options */ values?: string[]; } | { /** * Whether the interaction was successful */ success: false; /** * The message object returned by the interaction reply */ message: Message; /** * The reason the interaction failed */ reason: "timed out"; } | null>; } //# sourceMappingURL=BaseInteraction.d.ts.map