diff --git a/src/structures/MessageEmbed.js b/src/structures/MessageEmbed.js index 9dd0a9a0f..1249c422b 100644 --- a/src/structures/MessageEmbed.js +++ b/src/structures/MessageEmbed.js @@ -21,18 +21,18 @@ class MessageEmbed { } setup(data) { - /** - * The title of this embed, if there is one - * @type {?string} - */ - this.title = data.title; - /** * The type of this embed * @type {string} */ this.type = data.type; + /** + * The title of this embed, if there is one + * @type {?string} + */ + this.title = data.title; + /** * The description of this embed, if there is one * @type {?string} @@ -45,6 +45,12 @@ class MessageEmbed { */ this.url = data.url; + /** + * The color of the embed + * @type {number} + */ + this.color = data.color; + /** * The fields of this embed * @type {MessageEmbedField[]} @@ -90,6 +96,17 @@ class MessageEmbed { get createdAt() { return new Date(this.createdTimestamp); } + + /** + * The hexadecimal version of the embed color, with a leading hash. + * @type {string} + * @readonly + */ + get hexColor() { + let col = this.color.toString(16); + while (col.length < 6) col = `0${col}`; + return `#${col}`; + } } /** @@ -188,6 +205,12 @@ class MessageEmbedAuthor { * @type {string} */ this.url = data.url; + + /** + * The icon URL of this author + * @type {string} + */ + this.iconURL = data.icon_url; } } @@ -251,7 +274,7 @@ class MessageEmbedFooter { * The icon URL of this footer * @type {string} */ - this.iconUrl = data.icon_url; + this.iconURL = data.icon_url; /** * The proxy icon URL of this footer