From cf2632b6ccdff0650b7d3d2a310a498c5ca51f22 Mon Sep 17 00:00:00 2001 From: Diego Schulz Date: Mon, 18 Sep 2017 15:36:02 -0400 Subject: [PATCH] Use a regular expression to split parameters --- .../bots/commandbot/commands/CommandRegistry.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/commands/CommandRegistry.java b/telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/commands/CommandRegistry.java index 17da10d3..99858e3f 100644 --- a/telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/commands/CommandRegistry.java +++ b/telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/commands/CommandRegistry.java @@ -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; } -} \ No newline at end of file +}