From da998c050ae24feb19a573f40f849c3d96b8a83b Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Fri, 3 Jan 2025 18:40:23 +0700 Subject: [PATCH] emergency fix: discord message with attachment having no space when it should --- build-number.txt | 2 +- .../java/me/chayapak1/chomens_bot/plugins/DiscordPlugin.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build-number.txt b/build-number.txt index c650dc11..c6a69471 100644 --- a/build-number.txt +++ b/build-number.txt @@ -1 +1 @@ -1421 \ No newline at end of file +1422 \ No newline at end of file diff --git a/src/main/java/me/chayapak1/chomens_bot/plugins/DiscordPlugin.java b/src/main/java/me/chayapak1/chomens_bot/plugins/DiscordPlugin.java index ace090a2..128af969 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/DiscordPlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/DiscordPlugin.java @@ -224,7 +224,7 @@ public class DiscordPlugin { Component attachmentsComponent = Component.empty(); if (!message.getAttachments().isEmpty()) { - if (message.getContentDisplay().isEmpty()) attachmentsComponent = attachmentsComponent.append(Component.space()); + if (!message.getContentDisplay().isEmpty()) attachmentsComponent = attachmentsComponent.append(Component.space()); for (Message.Attachment attachment : message.getAttachments()) { attachmentsComponent = attachmentsComponent @@ -240,7 +240,7 @@ public class DiscordPlugin { Component embedsComponent = Component.empty(); if (!message.getEmbeds().isEmpty()) { - if (message.getAttachments().isEmpty()) embedsComponent = embedsComponent.append(Component.space()); + if (message.getAttachments().isEmpty() || !message.getContentDisplay().isEmpty()) embedsComponent = embedsComponent.append(Component.space()); for (MessageEmbed embed : message.getEmbeds()) { final Component hoverEvent = Component.translatable(