Skip to content

Commit

Permalink
fix: Embed colours being overwritten. (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
vxern authored Jul 24, 2024
2 parents d00abc8 + d58c020 commit 8f641af
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/library/stores/interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,17 @@ function getInteractionCallbackData(embedOrData: EmbedOrCallbackData): Discord.I

function setCallbackColour(embedOrData: EmbedOrCallbackData, { colour }: { colour: number }): EmbedOrCallbackData {
if (isEmbed(embedOrData)) {
if (embedOrData.color !== undefined) {
return embedOrData;
}

embedOrData.color = colour;
} else if (embedOrData.embeds !== undefined) {
for (const embed of embedOrData.embeds) {
if (embed.color !== undefined) {
continue;
}

embed.color = colour;
}
}
Expand Down

0 comments on commit 8f641af

Please sign in to comment.