diff --git a/packages/discord.js/src/structures/EmbedBuilder.js b/packages/discord.js/src/structures/EmbedBuilder.js index bdace0b23..cc56d9697 100644 --- a/packages/discord.js/src/structures/EmbedBuilder.js +++ b/packages/discord.js/src/structures/EmbedBuilder.js @@ -2,6 +2,7 @@ const { EmbedBuilder: BuildersEmbed, isJSONEncodable } = require('@discordjs/builders'); const Transformers = require('../util/Transformers'); +const Util = require('../util/Util'); class EmbedBuilder extends BuildersEmbed { constructor(data) { @@ -19,6 +20,18 @@ class EmbedBuilder extends BuildersEmbed { } return new this(other); } + + /** + * Sets the color of this embed + * @param {?ColorResolvable} color The color of the embed + * @returns {Embed} + */ + setColor(color) { + if (color === null) { + return super.setColor(null); + } + return super.setColor(Util.resolveColor(color)); + } } module.exports = EmbedBuilder;