From 3f93df131dc1c99adc251fc31df7206a2935dce6 Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 2 Jul 2024 18:47:28 +0100 Subject: [PATCH] looks too messy with this --- .../features/logging/listeners/MessageListener.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/cc/fascinated/bat/features/logging/listeners/MessageListener.java b/src/main/java/cc/fascinated/bat/features/logging/listeners/MessageListener.java index 6debfa9..b8ec729 100644 --- a/src/main/java/cc/fascinated/bat/features/logging/listeners/MessageListener.java +++ b/src/main/java/cc/fascinated/bat/features/logging/listeners/MessageListener.java @@ -32,11 +32,10 @@ public class MessageListener implements EventListener { public void onGuildMessageDelete(@NonNull BatGuild guild, BatUser user, DiscordMessage message, @NonNull MessageDeleteEvent event) { if (user.getDiscordUser().isBot() || message.getAuthor().isBot()) return; - TextChannel channel = message.getChannel(); logFeature.sendLog(guild, LogType.MESSAGE_DELETE, EmbedUtils.errorEmbed() .setDescription(new EmbedDescriptionBuilder("Message Deleted") - .appendLine("Author: %s (%s)".formatted(message.getAuthor().getAsMention(), message.getAuthor().getId()), true) - .appendLine("Channel: %s (%s)".formatted(channel.getAsMention(), channel.getName()), true) + .appendLine("Author: %s".formatted(message.getAuthor().getAsMention()), true) + .appendLine("Channel: %s".formatted(message.getChannel().getAsMention()), true) .appendLine("Content: %s".formatted(logFeature.formatContent(message.getContent())), true) .build()) .build()); @@ -47,11 +46,10 @@ public class MessageListener implements EventListener { @NonNull DiscordMessage newMessage, @NonNull MessageUpdateEvent event) { if (user.getDiscordUser().isBot() || newMessage.getAuthor().isBot() || oldMessage == null) return; - TextChannel channel = newMessage.getChannel(); logFeature.sendLog(guild, LogType.MESSAGE_EDIT, EmbedUtils.genericEmbed() .setDescription(new EmbedDescriptionBuilder("Message Edited") - .appendLine("Author: %s (%s)".formatted(newMessage.getAuthor().getAsMention(), newMessage.getAuthor().getId()), true) - .appendLine("Channel: %s (%s)".formatted(channel.getAsMention(), channel.getName()), true) + .appendLine("Author: %s".formatted(newMessage.getAuthor().getAsMention()), true) + .appendLine("Channel: %s".formatted(newMessage.getChannel().getAsMention()), true) .appendLine("Old Content: %s".formatted(logFeature.formatContent(oldMessage.getContent())), true) .appendLine("New Content: %s".formatted(logFeature.formatContent(newMessage.getContent())), true) .build())