auto log names

This commit is contained in:
Lee 2024-07-04 04:34:20 +01:00
parent f940bd526c
commit 8cdc2a853b

@ -1,5 +1,6 @@
package cc.fascinated.bat.features.logging; package cc.fascinated.bat.features.logging;
import cc.fascinated.bat.common.EnumUtils;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@ -14,37 +15,37 @@ public enum LogType {
/** /**
* Message Events * Message Events
*/ */
MESSAGE_DELETE(LogCategory.MESSAGE, "Message Delete"), MESSAGE_DELETE(LogCategory.MESSAGE),
MESSAGE_EDIT(LogCategory.MESSAGE,"Message Edit"), MESSAGE_EDIT(LogCategory.MESSAGE),
/** /**
* Member Events * Member Events
*/ */
MEMBER_JOIN(LogCategory.MEMBER, "Member Join"), MEMBER_JOIN(LogCategory.MEMBER),
MEMBER_LEAVE(LogCategory.MEMBER, "Member Leave"), MEMBER_LEAVE(LogCategory.MEMBER),
MEMBER_NICKNAME_UPDATE(LogCategory.MEMBER, "Member Nickname Update"), MEMBER_NICKNAME_UPDATE(LogCategory.MEMBER),
MEMBER_GLOBAL_NAME_UPDATE(LogCategory.MEMBER, "Member Global Name Update"), MEMBER_GLOBAL_NAME_UPDATE(LogCategory.MEMBER),
MEMBER_USERNAME_UPDATE(LogCategory.MEMBER, "Member Username Update"), MEMBER_USERNAME_UPDATE(LogCategory.MEMBER),
MEMBER_AVATAR_UPDATE(LogCategory.MEMBER, "Member Avatar Update"), MEMBER_AVATAR_UPDATE(LogCategory.MEMBER),
MEMBER_ROLE_UPDATE(LogCategory.MEMBER, "Member Role Update"), MEMBER_ROLE_UPDATE(LogCategory.MEMBER),
MEMBER_BAN(LogCategory.MEMBER, "Member Ban"), MEMBER_BAN(LogCategory.MEMBER),
MEMBER_UNBAN(LogCategory.MEMBER, "Member Unban"), MEMBER_UNBAN(LogCategory.MEMBER),
MEMBER_TIMEOUT(LogCategory.MEMBER, "Member Timeout"), MEMBER_TIMEOUT(LogCategory.MEMBER),
MEMBER_BOOSTED(LogCategory.MEMBER, "Member Boost Add"), MEMBER_BOOSTED(LogCategory.MEMBER),
MEMBER_BOOST_EXPIRE(LogCategory.MEMBER, "Member Boost Remove"), MEMBER_BOOST_EXPIRE(LogCategory.MEMBER),
/** /**
* Channel Events * Channel Events
*/ */
CHANNEL_CREATE(LogCategory.CHANNEL, "Channel Create"), CHANNEL_CREATE(LogCategory.CHANNEL),
CHANNEL_DELETE(LogCategory.CHANNEL, "Channel Delete"), CHANNEL_DELETE(LogCategory.CHANNEL),
VOICE_CHANNEL_JOIN(LogCategory.CHANNEL, "Voice Channel Join"), VOICE_CHANNEL_JOIN(LogCategory.CHANNEL),
VOICE_CHANNEL_LEAVE(LogCategory.CHANNEL, "Voice Channel Leave"), VOICE_CHANNEL_LEAVE(LogCategory.CHANNEL),
/** /**
* Guild Events * Guild Events
*/ */
INVITE_CREATE(LogCategory.GUILD, "Invite Create"); INVITE_CREATE(LogCategory.GUILD);
/** /**
* The category of the log type * The category of the log type
@ -54,7 +55,9 @@ public enum LogType {
/** /**
* The name of the log type * The name of the log type
*/ */
private final String name; public String getName() {
return EnumUtils.getEnumName(this);
}
/** /**
* Gets the log type by the name * Gets the log type by the name