mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-05 09:00:24 +00:00
[AB-55] fixing custom command not considering feature flag
ignoring case for custom command
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user