Skip to content

Commit

Permalink
fix(update): only send webhook messages if any changes were made
Browse files Browse the repository at this point in the history
  • Loading branch information
nexpid committed Sep 28, 2024
1 parent 7ce2490 commit d952af8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/update/tasks/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ const triggerWebhook = async (
};

export async function webhook(version: string, diffs: OutDiffs) {
if (diffs.raw || diffs.semantic)
if (diffs.raw?.size || diffs.semantic?.size)
await triggerWebhook(process.env.color_webhook!, {
role: "1227327297795657850",
version,
embeds: [
...(diffs.raw
...(diffs.raw?.size
? [
{
title: "Raw colors",
Expand All @@ -137,7 +137,7 @@ export async function webhook(version: string, diffs: OutDiffs) {
},
]
: []),
...(diffs.semantic
...(diffs.semantic?.size
? [
{
title: "Semantic colors",
Expand All @@ -149,7 +149,7 @@ export async function webhook(version: string, diffs: OutDiffs) {
],
});

if (diffs.icons)
if (diffs.icons?.size)
await triggerWebhook(process.env.icons_webhook!, {
role: "1227327765079003217",
version,
Expand Down

0 comments on commit d952af8

Please sign in to comment.