use of com.github.vaerys.objects.SubCommandObject in project DiscordSailv2 by Vaerys-Dawn.
the class Command method isName.
public boolean isName(String args, CommandObject command) {
String prefix = command.guild.config.getPrefixCommand();
List<String> allNames = new ArrayList<>(Arrays.asList(names));
for (SubCommandObject s : subCommands) {
if (GuildHandler.testForPerms(command, s.getPermissions())) {
allNames.addAll(Arrays.asList(s.getNames()));
}
}
allNames = allNames.stream().distinct().collect(Collectors.toList());
for (String s : allNames) {
if (s.equalsIgnoreCase(args) || args.equalsIgnoreCase(prefix + s)) {
return true;
}
}
return false;
}
Aggregations