Use a regular expression to split parameters
This commit is contained in:
parent
c63117cdc1
commit
cf2632b6cc
@ -97,7 +97,7 @@ public final class CommandRegistry implements ICommandRegistry {
|
|||||||
String text = message.getText();
|
String text = message.getText();
|
||||||
if (text.startsWith(BotCommand.COMMAND_INIT_CHARACTER)) {
|
if (text.startsWith(BotCommand.COMMAND_INIT_CHARACTER)) {
|
||||||
String commandMessage = text.substring(1);
|
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]);
|
String command = removeUsernameFromCommandIfNeeded(commandSplit[0]);
|
||||||
|
|
||||||
@ -126,4 +126,4 @@ public final class CommandRegistry implements ICommandRegistry {
|
|||||||
}
|
}
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user