You are reading the documentation for the next version of discord.js. Documentation for v13/v14+ has been moved to old.discordjs.dev

withFiles

export declare function withFiles(files: DescriptiveRawFile[], options: APIInteractionResponseCallbackData): {
body: {
attachments: {
id: string;
description: string | undefined;
}[];
content?: string | undefined;
tts?: boolean | undefined;
embeds?: APIEmbed[] | undefined;
allowed_mentions?: APIAllowedMentions | undefined;
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
flags?: MessageFlags;
thread_name?: string | undefined;
};
files: {
name: string;
data: string | number | boolean | Uint8Array | Buffer;
}[];
};
export declare function withFiles(files: DescriptiveRawFile[], options: APIInteractionResponseCallbackData): {
body: {
attachments: {
id: string;
description: string | undefined;
}[];
content?: string | undefined;
tts?: boolean | undefined;
embeds?: APIEmbed[] | undefined;
allowed_mentions?: APIAllowedMentions | undefined;
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
flags?: MessageFlags;
thread_name?: string | undefined;
};
files: {
name: string;
data: string | number | boolean | Uint8Array | Buffer;
}[];
};
A utility function to create a form data payload given an array of file buffers
NameTypeOptionalDescription
filesDescriptiveRawFile[]NoThe files to create a form data payload for
optionsAPIInteractionResponseCallbackDataNoThe additional options for the form data payload