From c4d317affdfdb0a6603eed4c01f44710ca3f0d41 Mon Sep 17 00:00:00 2001 From: dev-737 <73829355+dev-737@users.noreply.github.com> Date: Sat, 16 Sep 2023 13:22:27 +0530 Subject: [PATCH] fix: display same embed color for all networks --- src/Events/messageCreate.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Events/messageCreate.ts b/src/Events/messageCreate.ts index 8ccc5075..4d19177b 100644 --- a/src/Events/messageCreate.ts +++ b/src/Events/messageCreate.ts @@ -126,6 +126,11 @@ export default { }; } else { + if (connection.embedColor) { + censoredEmbed.setColor(connection.embedColor as HexColorString); + embed.setColor(connection.embedColor as HexColorString); + } + webhookMessage = { components: replyButton ? [replyButton] : undefined, embeds: [connection.profFilter ? censoredEmbed : embed], @@ -135,15 +140,6 @@ export default { threadId: connection.parentId ? connection.channelId : undefined, allowedMentions: { parse: [] }, }; - - if (connection.embedColor && webhookMessage.embeds - && /^#[0-9A-F]{6}$/i.test(connection.embedColor) - ) { - webhookMessage.embeds.push(EmbedBuilder.from(webhookMessage.embeds[0]) - .setColor(connection.embedColor as HexColorString), - ); - webhookMessage.embeds.splice(0, 1); - } } const webhook = new WebhookClient({ url: connection.webhookURL });