mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(MessageEmbed): re-introduce MessageEmbed#addField (#3850)
* feat(MessageEmbed): re-introduce MessageEmbed#addField * suggestion: sorting alphabetically * suggestion: document inline to default false for #addField
This commit is contained in:
@@ -215,6 +215,17 @@ class MessageEmbed {
|
||||
(this.footer ? this.footer.text.length : 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a field to the embed (max 25).
|
||||
* @param {StringResolvable} name The name of this field
|
||||
* @param {StringResolvable} value The value of this field
|
||||
* @param {boolean} [inline=false] If this field will be displayed inline
|
||||
* @returns {MessageEmbed}
|
||||
*/
|
||||
addField(name, value, inline) {
|
||||
return this.addFields({ name, value, inline });
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds fields to the embed (max 25).
|
||||
* @param {...EmbedFieldData|EmbedFieldData[]} fields The fields to add
|
||||
@@ -391,7 +402,7 @@ class MessageEmbed {
|
||||
* @typedef {Object} EmbedFieldData
|
||||
* @property {StringResolvable} name The name of this field
|
||||
* @property {StringResolvable} value The value of this field
|
||||
* @property {boolean} [inline] If this field will be displayed inline
|
||||
* @property {boolean} [inline=false] If this field will be displayed inline
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user