Use a regular expression to split parameters
This avoids the problem described in issue #304
This commit is contained in:
parent
e2862beb2d
commit
2c716133aa
@ -11,7 +11,7 @@ import org.telegram.telegrambots.bots.AbsSender;
|
|||||||
*/
|
*/
|
||||||
public abstract class BotCommand {
|
public abstract class BotCommand {
|
||||||
public final static String COMMAND_INIT_CHARACTER = "/";
|
public final static String COMMAND_INIT_CHARACTER = "/";
|
||||||
public static final String COMMAND_PARAMETER_SEPARATOR = " ";
|
public static final String COMMAND_PARAMETER_SEPARATOR_REGEXP = "\\s+";
|
||||||
private final static int COMMAND_MAX_LENGTH = 32;
|
private final static int COMMAND_MAX_LENGTH = 32;
|
||||||
|
|
||||||
private final String commandIdentifier;
|
private final String commandIdentifier;
|
||||||
@ -75,4 +75,4 @@ public abstract class BotCommand {
|
|||||||
* @param arguments passed arguments
|
* @param arguments passed arguments
|
||||||
*/
|
*/
|
||||||
public abstract void execute(AbsSender absSender, User user, Chat chat, String[] arguments);
|
public abstract void execute(AbsSender absSender, User user, Chat chat, String[] arguments);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user