[AB-55] fixing custom command not considering feature flag

ignoring case for custom command
This commit is contained in:
Sheldan
2022-08-28 23:24:08 +02:00
parent 30655dbfef
commit 82383449c0
5 changed files with 16 additions and 6 deletions

View File

@@ -152,7 +152,7 @@ public class CommandReceivedHandler extends ListenerAdapter {
if(commandAlternatives != null) {
Optional<CommandAlternative> foundAlternativeOptional = commandAlternatives
.stream()
.filter(commandAlternative -> commandAlternative.matches(result.getParameter()))
.filter(commandAlternative -> commandAlternative.shouldExecute(result.getParameter(), event.getGuild()))
.findFirst();
if(foundAlternativeOptional.isPresent()) {
CommandAlternative foundAlternative = foundAlternativeOptional.get();

View File

@@ -2,9 +2,10 @@ package dev.sheldan.abstracto.core.command;
import dev.sheldan.abstracto.core.Prioritized;
import dev.sheldan.abstracto.core.command.execution.UnParsedCommandParameter;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Message;
public interface CommandAlternative extends Prioritized {
boolean matches(UnParsedCommandParameter parameter);
boolean shouldExecute(UnParsedCommandParameter parameterm, Guild guild);
void execute(UnParsedCommandParameter parameter, Message message);
}