From 655662c6f8846141406293f0c18fb4b3c34a28dd Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 3 Jul 2024 22:18:35 +0100 Subject: [PATCH] fix embed color --- .../bat/features/welcomer/command/EmbedSubCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/cc/fascinated/bat/features/welcomer/command/EmbedSubCommand.java b/src/main/java/cc/fascinated/bat/features/welcomer/command/EmbedSubCommand.java index 3395cc8..4c6c283 100644 --- a/src/main/java/cc/fascinated/bat/features/welcomer/command/EmbedSubCommand.java +++ b/src/main/java/cc/fascinated/bat/features/welcomer/command/EmbedSubCommand.java @@ -46,6 +46,9 @@ public class EmbedSubCommand extends BatSubCommand { String color = colorOption.getAsString(); boolean pingBeforeSend = pingBeforeSendOption.getAsBoolean(); + // Remove # if the user added it + color = color.replace("#", ""); + // Validate the input if (color.length() != 6 || Color.decode("#" + color).getRGB() == -1){ event.replyEmbeds(EmbedUtils.errorEmbed() @@ -67,7 +70,6 @@ public class EmbedSubCommand extends BatSubCommand { return; } - color = color.replace("#", ""); // Remove # if the user added it boolean isMessageEnabled = profile.isMessage(); profile.setEmbed(title, description, color, pingBeforeSend); EmbedDescriptionBuilder successDescription = new EmbedDescriptionBuilder("Welcomer Embed")