mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-12 19:18:42 +00:00
enabling auto complete for youtube command
This commit is contained in:
@@ -4,8 +4,11 @@ import dev.sheldan.abstracto.core.FeatureAware;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent;
|
||||
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public interface Command extends FeatureAware {
|
||||
@@ -13,5 +16,6 @@ public interface Command extends FeatureAware {
|
||||
default CommandResult execute(CommandContext commandContext) {return CommandResult.fromSuccess();}
|
||||
default CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {return CompletableFuture.completedFuture(CommandResult.fromSuccess());}
|
||||
default CompletableFuture<CommandResult> executeSlash(SlashCommandInteractionEvent event) { return CompletableFuture.completedFuture(CommandResult.fromSuccess());}
|
||||
default List<String> performAutoComplete(CommandAutoCompleteInteractionEvent event) { return new ArrayList<>(); }
|
||||
CommandConfiguration getConfiguration();
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ public class Parameter implements Serializable {
|
||||
@Builder.Default
|
||||
private Integer listSize = 0;
|
||||
@Builder.Default
|
||||
private Boolean supportsAutoComplete = false;
|
||||
@Builder.Default
|
||||
private List<ParameterValidator> validators = new ArrayList<>();
|
||||
@Builder.Default
|
||||
private Map<String, Object> additionalInfo = new HashMap<>();
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package dev.sheldan.abstracto.core.interaction.slash.parameter;
|
||||
|
||||
import net.dv8tion.jda.api.interactions.AutoCompleteQuery;
|
||||
|
||||
public interface SlashCommandAutoCompleteService {
|
||||
boolean matchesParameter(AutoCompleteQuery query, String parameterName);
|
||||
}
|
||||
Reference in New Issue
Block a user