From 8d742fb801ef965dc41956ea266c994593961725 Mon Sep 17 00:00:00 2001 From: Evorp <3vorpgaming@gmail.com> Date: Sun, 8 Oct 2023 13:07:00 -0700 Subject: [PATCH] fix colors --- src/commands/bot/embed.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commands/bot/embed.ts b/src/commands/bot/embed.ts index 9011dc860..e7b8dbb1d 100644 --- a/src/commands/bot/embed.ts +++ b/src/commands/bot/embed.ts @@ -58,14 +58,18 @@ export const command: SlashCommand = { // a lot of copy/paste but this is the best djs can do lol const title = interaction.options.getString("title", false); const description = interaction.options.getString("description", false); - const color = interaction.options.getString("color", false); + const baseColor = interaction.options.getString("color", false); const footer = interaction.options.getString("footer", false); const image = interaction.options.getAttachment("image", false)?.url; const thumbnail = interaction.options.getAttachment("thumbnail", false)?.url; if (title) embed.setTitle(title); if (description) embed.setDescription(description); - if (color) embed.setColor(color as ColorResolvable); + if (baseColor) { + let color = baseColor; + if (!baseColor.startsWith("#")) embed.setColor(`#${color}`); + embed.setColor(color as ColorResolvable); + } if (footer) embed.setFooter({ text: footer }); if (image) embed.setImage(image); if (thumbnail) embed.setThumbnail(thumbnail);