From 8cdc2a853baa8df61aaab5d51e56a9a698a80649 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 4 Jul 2024 04:34:20 +0100 Subject: [PATCH] auto log names --- .../bat/features/logging/LogType.java | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 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 bede8bd..251633a 100644 --- a/src/main/java/cc/fascinated/bat/features/logging/LogType.java +++ b/src/main/java/cc/fascinated/bat/features/logging/LogType.java @@ -1,5 +1,6 @@ package cc.fascinated.bat.features.logging; +import cc.fascinated.bat.common.EnumUtils; import lombok.AllArgsConstructor; import lombok.Getter; @@ -14,37 +15,37 @@ public enum LogType { /** * Message Events */ - MESSAGE_DELETE(LogCategory.MESSAGE, "Message Delete"), - MESSAGE_EDIT(LogCategory.MESSAGE,"Message Edit"), + MESSAGE_DELETE(LogCategory.MESSAGE), + MESSAGE_EDIT(LogCategory.MESSAGE), /** * Member Events */ - MEMBER_JOIN(LogCategory.MEMBER, "Member Join"), - MEMBER_LEAVE(LogCategory.MEMBER, "Member Leave"), - MEMBER_NICKNAME_UPDATE(LogCategory.MEMBER, "Member Nickname Update"), - MEMBER_GLOBAL_NAME_UPDATE(LogCategory.MEMBER, "Member Global Name Update"), - MEMBER_USERNAME_UPDATE(LogCategory.MEMBER, "Member Username Update"), - MEMBER_AVATAR_UPDATE(LogCategory.MEMBER, "Member Avatar Update"), - MEMBER_ROLE_UPDATE(LogCategory.MEMBER, "Member Role Update"), - MEMBER_BAN(LogCategory.MEMBER, "Member Ban"), - MEMBER_UNBAN(LogCategory.MEMBER, "Member Unban"), - MEMBER_TIMEOUT(LogCategory.MEMBER, "Member Timeout"), - MEMBER_BOOSTED(LogCategory.MEMBER, "Member Boost Add"), - MEMBER_BOOST_EXPIRE(LogCategory.MEMBER, "Member Boost Remove"), + MEMBER_JOIN(LogCategory.MEMBER), + MEMBER_LEAVE(LogCategory.MEMBER), + MEMBER_NICKNAME_UPDATE(LogCategory.MEMBER), + MEMBER_GLOBAL_NAME_UPDATE(LogCategory.MEMBER), + MEMBER_USERNAME_UPDATE(LogCategory.MEMBER), + MEMBER_AVATAR_UPDATE(LogCategory.MEMBER), + MEMBER_ROLE_UPDATE(LogCategory.MEMBER), + MEMBER_BAN(LogCategory.MEMBER), + MEMBER_UNBAN(LogCategory.MEMBER), + MEMBER_TIMEOUT(LogCategory.MEMBER), + MEMBER_BOOSTED(LogCategory.MEMBER), + MEMBER_BOOST_EXPIRE(LogCategory.MEMBER), /** * Channel Events */ - CHANNEL_CREATE(LogCategory.CHANNEL, "Channel Create"), - CHANNEL_DELETE(LogCategory.CHANNEL, "Channel Delete"), - VOICE_CHANNEL_JOIN(LogCategory.CHANNEL, "Voice Channel Join"), - VOICE_CHANNEL_LEAVE(LogCategory.CHANNEL, "Voice Channel Leave"), + CHANNEL_CREATE(LogCategory.CHANNEL), + CHANNEL_DELETE(LogCategory.CHANNEL), + VOICE_CHANNEL_JOIN(LogCategory.CHANNEL), + VOICE_CHANNEL_LEAVE(LogCategory.CHANNEL), /** * Guild Events */ - INVITE_CREATE(LogCategory.GUILD, "Invite Create"); + INVITE_CREATE(LogCategory.GUILD); /** * The category of the log type @@ -54,7 +55,9 @@ public enum LogType { /** * The name of the log type */ - private final String name; + public String getName() { + return EnumUtils.getEnumName(this); + } /** * Gets the log type by the name