auto log names
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 38s

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

View File

@ -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