Skip to content

Commit

Permalink
Fix embeds when value is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmayer-dev committed Apr 11, 2024
1 parent 0babf59 commit 4656e82
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/MacroBot.Core/Services/DiscordService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,10 @@ public async Task BroadcastWebhookAsync(WebhookItem webhook, WebhookRequest webh
var embedFieldBuilders = new List<EmbedFieldBuilder>();
foreach (var field in webhookRequestEmbed.Fields)
{
if (string.IsNullOrWhiteSpace(field.Name) || string.IsNullOrWhiteSpace(field.Value))
{
continue;
}
var embedFieldBuilder = new EmbedFieldBuilder();
embedFieldBuilder.WithName(field.Name);
embedFieldBuilder.WithValue(field.Value);
Expand Down

0 comments on commit 4656e82

Please sign in to comment.