From 41491890f5bce007703a29694783da5ed5deaba5 Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Thu, 19 Dec 2024 02:15:08 -0500 Subject: [PATCH] Fixed a bug where custom emojis wouldn't be displayed properly --- API/pom.xml | 1 - .../java/me/braydon/tether/model/user/CustomStatus.java | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/API/pom.xml b/API/pom.xml index 1c32460..1d9bac2 100644 --- a/API/pom.xml +++ b/API/pom.xml @@ -105,7 +105,6 @@ compile - io.sentry diff --git a/API/src/main/java/me/braydon/tether/model/user/CustomStatus.java b/API/src/main/java/me/braydon/tether/model/user/CustomStatus.java index 2838a56..98d66ae 100644 --- a/API/src/main/java/me/braydon/tether/model/user/CustomStatus.java +++ b/API/src/main/java/me/braydon/tether/model/user/CustomStatus.java @@ -5,6 +5,7 @@ import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NonNull; import net.dv8tion.jda.api.entities.Activity; +import net.dv8tion.jda.api.entities.emoji.CustomEmoji; import net.dv8tion.jda.api.entities.emoji.EmojiUnion; import java.util.List; @@ -38,7 +39,13 @@ public class CustomStatus { continue; } EmojiUnion emoji = activity.getEmoji(); - return new CustomStatus(activity.getName(), emoji == null ? null : emoji.asUnicode().getFormatted()); + String emojiString = null; + if (emoji instanceof CustomEmoji customEmoji) { + emojiString = customEmoji.getImageUrl(); + } else if (emoji != null) { + emojiString = emoji.asUnicode().getFormatted(); + } + return new CustomStatus(activity.getName(), emojiString); } return null; }