forked from ChomeNS/chomens-bot-java
better patch
This commit is contained in:
parent
5bc73f2e52
commit
1ac93c170e
1 changed files with 2 additions and 7 deletions
|
@ -77,14 +77,9 @@ public class CommandHandlerPlugin {
|
|||
boolean console,
|
||||
MessageReceivedEvent event
|
||||
) {
|
||||
final String[] splitInput = input.split("\\s+");
|
||||
final String[] splitInput = input.trim().split("\\s+");
|
||||
|
||||
String commandName;
|
||||
try {
|
||||
commandName = splitInput[0];
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
return Component.text("Empty command").color(NamedTextColor.RED);
|
||||
}
|
||||
final String commandName = splitInput[0];
|
||||
|
||||
final Command command = findCommand(commands, commandName);
|
||||
|
||||
|
|
Loading…
Reference in a new issue