mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-27 22:31:45 +00:00
[AB-246] changing parameter handling to only actually evaluate the necessary parameter handlers, this helps avoiding providing the wrong parameter to the actual command
This commit is contained in:
@@ -9,7 +9,7 @@ import net.dv8tion.jda.api.entities.Message;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public interface CommandParameterHandler {
|
||||
boolean handles(Class clazz);
|
||||
boolean handles(Class clazz, UnparsedCommandParameterPiece value);
|
||||
default boolean async() { return false; }
|
||||
default Object handle(UnparsedCommandParameterPiece input, CommandParameterIterators iterators, Parameter param, Message context, Command command) { return new Object();}
|
||||
default CompletableFuture<Object> handleAsync(UnparsedCommandParameterPiece input, CommandParameterIterators iterators, Parameter param, Message context, Command command) { return CompletableFuture.completedFuture(null); }
|
||||
|
||||
Reference in New Issue
Block a user