cleanup features and move all misc commands into a base feature

This commit is contained in:
Lee
2024-06-30 08:00:03 +01:00
parent 5b1ddb145f
commit ea546f02ca
41 changed files with 122 additions and 47 deletions

View File

@ -4,7 +4,7 @@ import cc.fascinated.bat.Consts;
import cc.fascinated.bat.command.*;
import cc.fascinated.bat.common.EmbedUtils;
import cc.fascinated.bat.config.Config;
import cc.fascinated.bat.features.FeatureProfile;
import cc.fascinated.bat.features.base.profile.FeatureProfile;
import cc.fascinated.bat.model.BatGuild;
import cc.fascinated.bat.model.BatUser;
import lombok.Getter;

View File

@ -2,7 +2,7 @@ package cc.fascinated.bat.service;
import cc.fascinated.bat.command.BatCommand;
import cc.fascinated.bat.features.Feature;
import cc.fascinated.bat.features.command.FeatureCommand;
import cc.fascinated.bat.features.base.commands.server.feature.FeatureCommand;
import jakarta.annotation.PostConstruct;
import lombok.Getter;
import lombok.NonNull;
@ -50,7 +50,9 @@ public class FeatureService {
context.getBeansOfType(BatCommand.class)
.values()
.forEach((command) -> {
commandService.registerCommand(context.getBean(command.getClass()));
if (command.getFeature() == null) {
log.error("Command \"{}\" does not belong to a feature, not registering it...", command.getCommandInfo().name());
}
});
commandService.registerCommand(context.getBean(FeatureCommand.class));