From 52bc5b0170e290291d9760c13a1969874f936e6d Mon Sep 17 00:00:00 2001 From: MoreThanTom Date: Mon, 15 Apr 2019 19:46:59 +0100 Subject: [PATCH] feat(MessageEmbed): resolve color in embed constructor (#2912) * Resolve color in embed constructor * Use ColorResolvable type for color parameter * docs(MessageEmbed): color property is still a number --- src/structures/MessageEmbed.js | 2 +- typings/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/MessageEmbed.js b/src/structures/MessageEmbed.js index 8276cad77..706b20e91 100644 --- a/src/structures/MessageEmbed.js +++ b/src/structures/MessageEmbed.js @@ -45,7 +45,7 @@ class MessageEmbed { * The color of this embed * @type {?number} */ - this.color = data.color; + this.color = Util.resolveColor(data.color); /** * The timestamp of this embed diff --git a/typings/index.d.ts b/typings/index.d.ts index fd680f05a..fe15fa897 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1965,7 +1965,7 @@ declare module 'discord.js' { description?: string; url?: string; timestamp?: Date | number; - color?: number | string; + color?: ColorResolvable; fields?: { name: string; value: string; inline?: boolean; }[]; files?: (MessageAttachment | string | FileOptions)[]; author?: { name?: string; url?: string; icon_url?: string; iconURL?: string; };