Fixed a bug where custom emojis wouldn't be displayed properly
All checks were successful
Deploy API / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m9s
All checks were successful
Deploy API / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m9s
This commit is contained in:
parent
01923bb039
commit
41491890f5
@ -105,7 +105,6 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- Error Reporting & Metrics -->
|
<!-- Error Reporting & Metrics -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.sentry</groupId>
|
<groupId>io.sentry</groupId>
|
||||||
|
@ -5,6 +5,7 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import net.dv8tion.jda.api.entities.Activity;
|
import net.dv8tion.jda.api.entities.Activity;
|
||||||
|
import net.dv8tion.jda.api.entities.emoji.CustomEmoji;
|
||||||
import net.dv8tion.jda.api.entities.emoji.EmojiUnion;
|
import net.dv8tion.jda.api.entities.emoji.EmojiUnion;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -38,7 +39,13 @@ public class CustomStatus {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
EmojiUnion emoji = activity.getEmoji();
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user