From 788d58e5a32956bbcf4768f69ff320b0d7873a6a Mon Sep 17 00:00:00 2001 From: Rodry <38259440+ImRodry@users.noreply.github.com> Date: Wed, 30 Jun 2021 14:32:14 +0100 Subject: [PATCH] types(*): make hex color types compatible with ColorResolvable (#5973) * types(*): make hex color types compatible with ColorResolvable * types(*): create HexColorString type * types(HexColorString): move to a less awkward place --- typings/index.d.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/typings/index.d.ts b/typings/index.d.ts index 1d756d828..8766ac996 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1076,7 +1076,7 @@ declare module 'discord.js' { public readonly bannable: boolean; public deleted: boolean; public readonly displayColor: number; - public readonly displayHexColor: string; + public readonly displayHexColor: HexColorString; public readonly displayName: string; public guild: Guild; public readonly id: Snowflake; @@ -1502,7 +1502,7 @@ declare module 'discord.js' { public description: string | null; public fields: EmbedField[]; public footer: MessageEmbedFooter | null; - public readonly hexColor: string | null; + public readonly hexColor: HexColorString | null; public image: MessageEmbedImage | null; public readonly length: number; public provider: MessageEmbedProvider | null; @@ -1739,7 +1739,7 @@ declare module 'discord.js' { public deleted: boolean; public readonly editable: boolean; public guild: Guild; - public readonly hexColor: string; + public readonly hexColor: HexColorString; public hoist: boolean; public id: Snowflake; public managed: boolean; @@ -3220,7 +3220,7 @@ declare module 'discord.js' { | 'RANDOM' | [number, number, number] | number - | `#${string}`; + | HexColorString; interface CommandInteractionOption { name: string; @@ -3607,6 +3607,8 @@ declare module 'discord.js' { type GuildTemplateResolvable = string; + type HexColorString = `#${string}`; + interface HTTPAttachmentData { attachment: string | Buffer | Stream; name: string; @@ -4112,7 +4114,7 @@ declare module 'discord.js' { > { readonly bannable: boolean; readonly displayColor: number; - readonly displayHexColor: string; + readonly displayHexColor: HexColorString; readonly displayName: string; guild: Guild; readonly manageable: boolean;