cleanup voice logs

This commit is contained in:
Lee 2024-07-03 23:07:50 +01:00
parent 938005f6d9
commit 831bc934b4

@ -81,20 +81,14 @@ public class ChannelListener implements EventListener {
lastVoiceChannel.remove(user); lastVoiceChannel.remove(user);
} }
log.info("User \"{}\" {} voice channel \"{}\" in guild \"{}\"", user.getId(), joined ? "joined" : "left", voiceChannel.getName(), guild.getName()); log.info("User \"{}\" {} voice channel \"{}\" in guild \"{}\"", user.getId(), joined ? "joined" : "left", voiceChannel.getName(), guild.getName());
String description = new EmbedDescriptionBuilder("User %s Voice Channel".formatted(joined ? "Joined" : "Left"))
.appendLine("User: %s".formatted(user.getDiscordUser().getAsMention()), true)
.appendLine("Channel: %s".formatted(voiceChannel.getName()), true)
.build();
if (joined) { if (joined) {
logFeature.sendLog(guild, LogType.VOICE_CHANNEL_JOIN, EmbedUtils.successEmbed() logFeature.sendLog(guild, LogType.VOICE_CHANNEL_JOIN, EmbedUtils.successEmbed().setDescription(description).build());
.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; return;
} }
logFeature.sendLog(guild, LogType.VOICE_CHANNEL_LEAVE, EmbedUtils.errorEmbed() logFeature.sendLog(guild, LogType.VOICE_CHANNEL_LEAVE, EmbedUtils.errorEmbed().setDescription(description).build());
.setDescription(new EmbedDescriptionBuilder("User Left Voice Channel")
.appendLine("User: %s".formatted(user.getDiscordUser().getAsMention()), true)
.appendLine("Channel: %s".formatted(voiceChannel.getName()), true)
.build())
.build());
} }
} }