From 942e85da789e233871feec4e1960d213a275cb81 Mon Sep 17 00:00:00 2001
From: Benedikt Magnus <magnus@magnuscraft.de>
Date: Tue, 16 Nov 2021 14:20:42 +0100
Subject: [PATCH] Fixed that sending only normal visualisations to Discord
 would fail.

Because it tried to create an empty shared compact embed.
---
 .../endpoint/implementations/discord/discordUtils.ts         | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/wichtelbot/endpoint/implementations/discord/discordUtils.ts b/scripts/wichtelbot/endpoint/implementations/discord/discordUtils.ts
index 847a742..ac288cf 100644
--- a/scripts/wichtelbot/endpoint/implementations/discord/discordUtils.ts
+++ b/scripts/wichtelbot/endpoint/implementations/discord/discordUtils.ts
@@ -59,7 +59,10 @@ export abstract class DiscordUtils
                         }
                     }
 
-                    messageOptions.embeds = [sharedCompactEmbed];
+                    if (sharedCompactEmbed.fields.length > 0)
+                    {
+                        messageOptions.embeds = [sharedCompactEmbed];
+                    }
                 }
             }
 
-- 
GitLab