From 86c147f359b4a5286169bb3448b7bddf5e2cd945 Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 2 Jul 2024 19:09:01 +0100 Subject: [PATCH] merge role add/remove into 1 update type and rename nickname logtype --- .../java/cc/fascinated/bat/features/logging/LogType.java | 5 ++--- .../bat/features/logging/listeners/MemberListener.java | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/cc/fascinated/bat/features/logging/LogType.java b/src/main/java/cc/fascinated/bat/features/logging/LogType.java index f1fbd0b..1d546b4 100644 --- a/src/main/java/cc/fascinated/bat/features/logging/LogType.java +++ b/src/main/java/cc/fascinated/bat/features/logging/LogType.java @@ -22,9 +22,8 @@ public enum LogType { */ MEMBER_JOIN(LogCategory.MEMBER, "Member Join"), MEMBER_LEAVE(LogCategory.MEMBER, "Member Leave"), - MEMBER_NICKNAME_CHANGE(LogCategory.MEMBER, "Member Nickname Change"), - MEMBER_ROLE_ADD(LogCategory.MEMBER, "Member Role Add"), - MEMBER_ROLE_REMOVE(LogCategory.MEMBER, "Member Role Remove"); + MEMBER_NICKNAME_UPDATE(LogCategory.MEMBER, "Member Nickname Update"), + MEMBER_ROLE_UPDATE(LogCategory.MEMBER, "Member Role Update"); /** * The category of the log type diff --git a/src/main/java/cc/fascinated/bat/features/logging/listeners/MemberListener.java b/src/main/java/cc/fascinated/bat/features/logging/listeners/MemberListener.java index 2f9f1f3..feb5d4a 100644 --- a/src/main/java/cc/fascinated/bat/features/logging/listeners/MemberListener.java +++ b/src/main/java/cc/fascinated/bat/features/logging/listeners/MemberListener.java @@ -62,7 +62,7 @@ public class MemberListener implements EventListener { public void onGuildMemberUpdateNickname(@NonNull BatGuild guild, @NonNull BatUser user, String oldName, String newName, @NonNull GuildMemberUpdateNicknameEvent event) { if (user.getDiscordUser().isBot()) return; - logFeature.sendLog(guild, LogType.MEMBER_NICKNAME_CHANGE, EmbedUtils.genericEmbed() + logFeature.sendLog(guild, LogType.MEMBER_NICKNAME_UPDATE, EmbedUtils.genericEmbed() .setDescription(new EmbedDescriptionBuilder("Member Nickname Changed") .appendLine("Member: %s".formatted(user.getDiscordUser().getAsMention()), true) .appendLine("Old Nickname: `%s`".formatted(oldName == null ? user.getName() : oldName), true) @@ -81,7 +81,7 @@ public class MemberListener implements EventListener { } String s = rolesAdded.size() > 1 ? "s" : ""; - logFeature.sendLog(guild, LogType.MEMBER_ROLE_ADD, EmbedUtils.successEmbed() + logFeature.sendLog(guild, LogType.MEMBER_ROLE_UPDATE, EmbedUtils.successEmbed() .setDescription(new EmbedDescriptionBuilder("Member Role%s Added".formatted(s)) .appendLine("Member: %s".formatted(user.getDiscordUser().getAsMention()), true) .appendLine("Role%s Added: %s".formatted(s, roles.substring(0, roles.length() - 2)), true) @@ -99,7 +99,7 @@ public class MemberListener implements EventListener { } String s = rolesAdded.size() > 1 ? "s" : ""; - logFeature.sendLog(guild, LogType.MEMBER_ROLE_REMOVE, EmbedUtils.errorEmbed() + logFeature.sendLog(guild, LogType.MEMBER_ROLE_UPDATE, EmbedUtils.errorEmbed() .setDescription(new EmbedDescriptionBuilder("Member Role%s Removed".formatted(s)) .appendLine("Member: %s".formatted(user.getDiscordUser().getAsMention()), true) .appendLine("Role%s Removed: %s".formatted(s, roles.substring(0, roles.length() - 2)), true)