Skip to content

Commit

Permalink
fix: display same embed color for all networks
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-737 committed Sep 16, 2023
1 parent 69aaacc commit c4d317a
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/Events/messageCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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 });
Expand Down

0 comments on commit c4d317a

Please sign in to comment.