fix embed color

This commit is contained in:
Lee 2024-07-03 22:18:35 +01:00
parent 642185f8c5
commit 655662c6f8

@ -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")