diff --git a/src/structures/MessageEmbed.js b/src/structures/MessageEmbed.js index d40c3d8bf8ca..d335248fbd24 100644 --- a/src/structures/MessageEmbed.js +++ b/src/structures/MessageEmbed.js @@ -298,6 +298,16 @@ class MessageEmbed { return this; } + /** + * Sets the embed's fields (max 25). + * @param {...EmbedFieldData|EmbedFieldData[]} fields The fields to set + * @returns {MessageEmbed} + */ + setFields(...fields) { + this.spliceFields(0, this.fields.length, fields); + return this; + } + /** * Sets the author of this embed. * @param {string} name The name of the author diff --git a/typings/index.d.ts b/typings/index.d.ts index 5b85087b1f4f..dddd453bada4 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1156,6 +1156,7 @@ export class MessageEmbed { public readonly video: MessageEmbedVideo | null; public addField(name: string, value: string, inline?: boolean): this; public addFields(...fields: EmbedFieldData[] | EmbedFieldData[][]): this; + public setFields(...fields: EmbedFieldData[] | EmbedFieldData[][]): this; public setAuthor(name: string, iconURL?: string, url?: string): this; public setColor(color: ColorResolvable): this; public setDescription(description: string): this;