additional warnings for misconfiguration

This commit is contained in:
2022-02-22 19:59:02 +01:00
parent 1a309ffcd3
commit 2fafc31a10
@@ -136,7 +136,11 @@ public class ConfigCache {
} }
List<String> subCommands = new ArrayList<>(); List<String> subCommands = new ArrayList<>();
for (String subCmd : section.getStringList(id + ".subcommands")) { for (String subCmd : section.getStringList(id + ".subcommands")) {
subCommands.add(String.valueOf(subCmd)); if (!subCmd.contains(" ")) {
warn("CommandWhitelist - \"" + subCmd + "\" is not a subcommand. Skipping it.");
continue;
}
subCommands.add(subCmd);
} }
String customCommandDeniedMessage = section.getString(id + ".custom_command_denied_message"); String customCommandDeniedMessage = section.getString(id + ".custom_command_denied_message");
return new CWGroup(id, commands, subCommands, customCommandDeniedMessage); return new CWGroup(id, commands, subCommands, customCommandDeniedMessage);