Use a regular expression to split parameters

This commit is contained in:
Diego Schulz 2017-09-18 15:36:02 -04:00 committed by GitHub
parent c63117cdc1
commit cf2632b6cc

View File

@ -97,7 +97,7 @@ public final class CommandRegistry implements ICommandRegistry {
String text = message.getText();
if (text.startsWith(BotCommand.COMMAND_INIT_CHARACTER)) {
String commandMessage = text.substring(1);
String[] commandSplit = commandMessage.split(BotCommand.COMMAND_PARAMETER_SEPARATOR);
String[] commandSplit = commandMessage.split(BotCommand.COMMAND_PARAMETER_SEPARATOR_REGEXP);
String command = removeUsernameFromCommandIfNeeded(commandSplit[0]);
@ -126,4 +126,4 @@ public final class CommandRegistry implements ICommandRegistry {
}
return command;
}
}
}