mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-06 00:15:32 +00:00
[AB-205] making exception message for command not found configurable
making feature config classes more unified in the naming
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
package dev.sheldan.abstracto.core.command.config.features;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureConfig;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class CoreFeature implements FeatureConfig {
|
||||
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
return CoreFeatureDefinition.CORE_FEATURE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getRequiredEmotes() {
|
||||
return Arrays.asList("warnReaction", "successReaction");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package dev.sheldan.abstracto.core.command.config.features;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureConfig;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class CoreFeatureConfig implements FeatureConfig {
|
||||
|
||||
public static final String NO_COMMAND_REPORTING_CONFIG_KEY = "noCommandFoundReporting";
|
||||
public static final String SUCCESS_REACTION_KEY = "successReaction";
|
||||
public static final String WARN_REACTION_KEY = "warnReaction";
|
||||
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
return CoreFeatureDefinition.CORE_FEATURE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getRequiredEmotes() {
|
||||
return Arrays.asList(WARN_REACTION_KEY, SUCCESS_REACTION_KEY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getRequiredSystemConfigKeys() {
|
||||
return Arrays.asList(NO_COMMAND_REPORTING_CONFIG_KEY);
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,9 @@ public interface ConfigService {
|
||||
Long getLongValue(String name, Long serverId);
|
||||
Long getLongValueOrConfigDefault(String name, Long serverId);
|
||||
Double getDoubleValue(String name, Long serverId, Double defaultValue);
|
||||
Double getDoubleValueOrConfigDefault(String name, Long serverId, Double defaultValue);
|
||||
Double getDoubleValueOrConfigDefault(String name, Long serverId);
|
||||
String getStringValue(String name, Long serverId, String defaultValue);
|
||||
String getStringValueOrConfigDefault(String name, Long serverId, String defaultValue);
|
||||
String getStringValueOrConfigDefault(String name, Long serverId);
|
||||
Long getLongValue(String name, Long serverId, Long defaultValue);
|
||||
AConfig setOrCreateConfigValue(Long serverId, String name, AConfig value);
|
||||
void setDoubleValue(String name, Long serverId, Double value);
|
||||
|
||||
Reference in New Issue
Block a user