import type { APIActionRowComponent, APIAllowedMentions, APIInteractionResponseCallbackData, APIInteractionResponseChannelMessageWithSource, APIInteractionResponseUpdateMessage, APIMessageActionRowComponent, RESTPostAPIWebhookWithTokenJSONBody } from "discord-api-types/v10"; import { InteractionResponseType } from "discord-api-types/v10"; import { Blob, FormData } from "formdata-node"; import type { ActionRowBuilder, MessageActionRowComponentBuilders } from "../components/ActionRowBuilder.js"; import { EmbedBuilder } from "./EmbedBuilder.js"; export interface AttachedFile { name?: string; description?: string; data: Uint8Array | Blob | string; } export declare class MessageBuilder { data: APIInteractionResponseCallbackData; files?: AttachedFile[]; constructor(data?: string | EmbedBuilder | APIInteractionResponseCallbackData); /** * Sets the content of the message. * @param content Text content for your message. * @returns */ setContent(content: string): this; /** * Set whether to enable TTS for this message. * @param tts Whether or not the message should be read aloud. * @returns */ setTts(tts: boolean): this; /** * Set which mentions will be allowed in this message. * @param allowedMentions Allowed mentions for this message. https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure - TODO: Builder for this * @returns */ setAllowedMentions(allowedMentions: APIAllowedMentions): this; private setMessageFlag; /** * Set the SuppressEmbeds flag on this messgae. * @param value Whether or not embeds in this message should be suppressed (hidden). * @returns */ suppressEmbeds(value: boolean): this; /** * Set the Ephemeral flag on this message. https://discord.com/developers/docs/tutorials/upgrading-to-application-commands#responding-to-a-command * @param value Whether or not the message should be ephemeral. * @returns */ setEphemeral(value: boolean): this; /** * Add one or more embeds to this message. Maximum of 10. * @param embeds Embeds to add to this message. * @returns */ addEmbeds(...embeds: EmbedBuilder[]): this; /** * Set an array of embeds to be sent with this message. * @param embeds Array of embeds to be sent. * @returns */ setEmbeds(...embeds: EmbedBuilder[]): this; /** * Add one or more Action Rows to the message. Maximum of 5. * @param components Action Rows to add to this message. * @returns */ addComponents(...components: ActionRowBuilder[]): this; /** * Set an array of Action Rows to be sent with this message. * @param components Array of Action Rows to be sent. * @returns */ setComponents(components?: APIActionRowComponent[]): this; /** * Add one or more files to this message. * @param files Files to attach to this message. * @returns */ addAttachments(...files: AttachedFile[]): this; /** * Set an array of files to be sent with this message. * @param files Array of files to be sent. * @returns **/ setAttachments(...files: AttachedFile[]): this; /** * Fetch this message's files and data as a FormData object. * @param data Data to be included as the `payload_json` property. * @returns */ private toFormData; /** * Fetch this message's data as an HTTP interaction response. * @param responseType The interaction response type, depending on whether this is a response to a message or a reaction. * @returns */ toInteractionJSON(responseType: T): ResponseMap[T]; /** * Fetch this message and its files as an HTTP interaction response. * @param responseType The interaction response type, depending on whether this is a response to a message or a reaction. * @returns */ toInteractionResponse(responseType: T): ResponseMap[T] | FormData; /** * Fetch this message's data as an object. */ toJSON(): APIInteractionResponseCallbackData; toWebhook(username?: string, avatar_url?: string): RESTPostAPIWebhookWithTokenJSONBody | FormData; } export declare type ResponseMap = { [InteractionResponseType.ChannelMessageWithSource]: APIInteractionResponseChannelMessageWithSource; [InteractionResponseType.UpdateMessage]: APIInteractionResponseUpdateMessage; };