From 5959b814a77cd419a0b818f9bd9126293249dd34 Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 3 Jul 2024 23:01:56 +0100 Subject: [PATCH] use proper embed color for voice channel logs --- .../logging/listeners/ChannelListener.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/cc/fascinated/bat/features/logging/listeners/ChannelListener.java b/src/main/java/cc/fascinated/bat/features/logging/listeners/ChannelListener.java index 077626d..768dfaf 100644 --- a/src/main/java/cc/fascinated/bat/features/logging/listeners/ChannelListener.java +++ b/src/main/java/cc/fascinated/bat/features/logging/listeners/ChannelListener.java @@ -78,10 +78,19 @@ public class ChannelListener implements EventListener { lastVoiceChannel.remove(user); } log.info("User \"{}\" {} voice channel \"{}\" in guild \"{}\"", user.getId(), joined ? "joined" : "left", voiceChannel.getName(), guild.getName()); - logFeature.sendLog(guild, joined ? LogType.VOICE_CHANNEL_JOIN : LogType.VOICE_CHANNEL_LEAVE, EmbedUtils.successEmbed() - .setDescription(new EmbedDescriptionBuilder("User %s Voice Channel".formatted(joined ? "Joined" : "Left")) + if (joined) { + logFeature.sendLog(guild, LogType.VOICE_CHANNEL_JOIN, EmbedUtils.successEmbed() + .setDescription(new EmbedDescriptionBuilder("User Joined Voice Channel") + .appendLine("User: %s".formatted(user.getDiscordUser().getAsMention()), true) + .appendLine("Channel: %s".formatted(voiceChannel.getName()), true) + .build()) + .build()); + return; + } + logFeature.sendLog(guild, LogType.VOICE_CHANNEL_LEAVE, EmbedUtils.errorEmbed() + .setDescription(new EmbedDescriptionBuilder("User Left Voice Channel") .appendLine("User: %s".formatted(user.getDiscordUser().getAsMention()), true) - .appendLine("Channel: %s".formatted(voiceChannel.getAsMention()), true) + .appendLine("Channel: %s".formatted(voiceChannel.getName()), true) .build()) .build()); }