mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 03:23:29 +01:00
feat(MessageEmbed): add setFields method (#6186)
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
@@ -298,6 +298,16 @@ class MessageEmbed {
|
|||||||
return this;
|
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.
|
* Sets the author of this embed.
|
||||||
* @param {string} name The name of the author
|
* @param {string} name The name of the author
|
||||||
|
|||||||
1
typings/index.d.ts
vendored
1
typings/index.d.ts
vendored
@@ -1151,6 +1151,7 @@ export class MessageEmbed {
|
|||||||
public readonly video: MessageEmbedVideo | null;
|
public readonly video: MessageEmbedVideo | null;
|
||||||
public addField(name: string, value: string, inline?: boolean): this;
|
public addField(name: string, value: string, inline?: boolean): this;
|
||||||
public addFields(...fields: EmbedFieldData[] | EmbedFieldData[][]): this;
|
public addFields(...fields: EmbedFieldData[] | EmbedFieldData[][]): this;
|
||||||
|
public setFields(...fields: EmbedFieldData[] | EmbedFieldData[][]): this;
|
||||||
public setAuthor(name: string, iconURL?: string, url?: string): this;
|
public setAuthor(name: string, iconURL?: string, url?: string): this;
|
||||||
public setColor(color: ColorResolvable): this;
|
public setColor(color: ColorResolvable): this;
|
||||||
public setDescription(description: string): this;
|
public setDescription(description: string): this;
|
||||||
|
|||||||
Reference in New Issue
Block a user