add emojis to feature states

This commit is contained in:
Lee 2024-06-30 08:34:59 +01:00
parent 6403c57db5
commit f566c3bcb5
2 changed files with 11 additions and 3 deletions

View File

@ -26,7 +26,7 @@ public class ListSubCommand extends BatSubCommand {
for (Feature feature : FeatureService.INSTANCE.getFeaturesSorted()) {
FeatureProfile featureProfile = guild.getFeatureProfile();
featureStates.append("%s `%s`\n".formatted(
featureProfile.getFeatureState(feature) == FeatureProfile.FeatureState.ENABLED ? "" : "",
featureProfile.getFeatureState(feature).getEmoji(),
feature.getName()
));
}

View File

@ -2,6 +2,8 @@ package cc.fascinated.bat.features.base.profile;
import cc.fascinated.bat.common.Profile;
import cc.fascinated.bat.features.Feature;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
@ -94,8 +96,14 @@ public class FeatureProfile extends Profile {
this.featureStates = null;
}
@AllArgsConstructor @Getter
public enum FeatureState {
ENABLED,
DISABLED
ENABLED(":white_check_mark:"),
DISABLED(":x:");
/**
* The emoji for the feature state
*/
private String emoji;
}
}