mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-13 19:41:38 +00:00
[AB-66] adding mines game
fixing suggestion evaluation job not getting the correct parameters adding feature dependent parameters
This commit is contained in:
@@ -50,7 +50,4 @@ public class CommandConfiguration {
|
||||
.enabled(false)
|
||||
.build();
|
||||
|
||||
public int getNecessaryParameterCount(){
|
||||
return (int) parameters.stream().filter(parameter -> !parameter.isOptional()).count();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ public class Parameter implements Serializable {
|
||||
private List<ParameterValidator> validators = new ArrayList<>();
|
||||
@Builder.Default
|
||||
private Map<String, Object> additionalInfo = new HashMap<>();
|
||||
// these are the features which potentially require this parameter
|
||||
@Builder.Default
|
||||
private List<String> dependentFeatures = new ArrayList<>();
|
||||
|
||||
public String getSlashCompatibleName() {
|
||||
return name.toLowerCase(Locale.ROOT);
|
||||
|
||||
@@ -38,6 +38,13 @@ public class MaxIntegerValueValidator implements ParameterValidator {
|
||||
return Arrays.asList(param);
|
||||
}
|
||||
|
||||
public static MaxIntegerValueValidator max(Long number) {
|
||||
return MaxIntegerValueValidator
|
||||
.builder()
|
||||
.maxValue(number)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getExceptionTemplateName() {
|
||||
return "command_parameter_validation_value_too_large";
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.command.service;
|
||||
|
||||
|
||||
import dev.sheldan.abstracto.core.command.Command;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.ModuleDefinition;
|
||||
import dev.sheldan.abstracto.core.command.execution.UnParsedCommandParameter;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
@@ -19,4 +20,5 @@ public interface CommandRegistry {
|
||||
Command getCommandByName(String name, boolean searchAliases, Long serverId);
|
||||
Optional<Command> getCommandByNameOptional(String name, boolean searchAliases, Long serverId);
|
||||
String getCommandName(String input, Long serverId);
|
||||
long getParameterCountForCommandConfig(CommandConfiguration commandConfiguration, Long serverId);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.util.Optional;
|
||||
|
||||
public interface ComponentPayloadManagementService {
|
||||
ComponentPayload createPayload(String id, String payload, Class payloadType, String buttonOrigin, AServer server, ComponentType type);
|
||||
void updatePayload(String id, String payload);
|
||||
ComponentPayload createButtonPayload(ButtonConfigModel buttonConfigModel, AServer server);
|
||||
ComponentPayload createButtonPayload(ButtonConfigModel buttonConfigModel, Long serverId);
|
||||
ComponentPayload createModalPayload(ModalConfigPayload payloadConfig, Long serverId);
|
||||
|
||||
@@ -6,5 +6,6 @@ import dev.sheldan.abstracto.core.interaction.button.ButtonPayload;
|
||||
|
||||
public interface ComponentPayloadService {
|
||||
ComponentPayload createButtonPayload(String componentId, ButtonPayload payload, String origin, AServer server);
|
||||
void updateButtonPayload(String componentId, ButtonPayload payload);
|
||||
ComponentPayload createSelectionPayload(String componentId, ButtonPayload payload, String origin, AServer server);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public interface SlashCommandService {
|
||||
void convertCommandConfigToCommandData(CommandConfiguration commandConfiguration, List<Pair<List<CommandConfiguration>, SlashCommandData>> existingCommands, Long serverId);
|
||||
void convertCommandConfigToCommandData(CommandConfiguration commandConfiguration, List<Pair<List<CommandConfiguration>, SlashCommandData>> existingCommands);
|
||||
CompletableFuture<List<Command>> updateGuildSlashCommand(Guild guild, List<Pair<List<CommandConfiguration>, SlashCommandData>> commandData);
|
||||
CompletableFuture<Void> deleteGuildSlashCommands(Guild guild, List<Long> slashCommandId, List<Long> commandInServerIdsToUnset);
|
||||
|
||||
Reference in New Issue
Block a user