From d757b05bd76c44cbfcf9353de55df434a3f7a814 Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Fri, 21 Jun 2024 01:32:28 -0400 Subject: [PATCH] Fix Discord webhook embed formatting --- .../braydon/profanity/notification/impl/DiscordSource.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/API/src/main/java/me/braydon/profanity/notification/impl/DiscordSource.java b/API/src/main/java/me/braydon/profanity/notification/impl/DiscordSource.java index 0ec3057..de0c051 100644 --- a/API/src/main/java/me/braydon/profanity/notification/impl/DiscordSource.java +++ b/API/src/main/java/me/braydon/profanity/notification/impl/DiscordSource.java @@ -3,7 +3,6 @@ package me.braydon.profanity.notification.impl; import jakarta.annotation.PostConstruct; import lombok.NonNull; import lombok.SneakyThrows; -import me.braydon.profanity.common.ContentTag; import me.braydon.profanity.common.DiscordWebhook; import me.braydon.profanity.model.response.ContentProcessResponse; import me.braydon.profanity.notification.INotificationSource; @@ -68,10 +67,10 @@ public final class DiscordSource implements INotificationSource { embed.addField("Content", "`" + response.getContent() + "`", false); } if (content.isDisplayMatched()) { - embed.addField("Matched", String.join("`, `", response.getMatched()), false); + embed.addField("Matched", response.getMatched().stream().map(matched -> "`" + matched + "`").collect(Collectors.joining(", ")), false); } if (content.isDisplayTags()) { - embed.addField("Tags", response.getTags().stream().map(ContentTag::name).collect(Collectors.joining("`, `")), false); + embed.addField("Tags", response.getTags().stream().map(tag -> "`" + tag.name() + "`").collect(Collectors.joining(", ")), false); } if (content.isDisplayTags()) { embed.addField("Score", "`" + response.getScore() + "`", false);