From 651fe36c3544aa14f13e71c71832d630f3539fb9 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 4 May 2018 00:28:20 +0300 Subject: CommandsManager: strip whitespace from command start --- juick-common/src/main/java/com/juick/server/CommandsManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'juick-common/src') diff --git a/juick-common/src/main/java/com/juick/server/CommandsManager.java b/juick-common/src/main/java/com/juick/server/CommandsManager.java index 1907bde7..5927ed3a 100644 --- a/juick-common/src/main/java/com/juick/server/CommandsManager.java +++ b/juick-common/src/main/java/com/juick/server/CommandsManager.java @@ -77,7 +77,8 @@ public class CommandsManager { @Inject private ImagesService imagesService; - public CommandResult processCommand(User user, String input, @Nonnull URI attachment) throws Exception { + public CommandResult processCommand(User user, String data, @Nonnull URI attachment) throws Exception { + String input = StringUtils.stripStart(data, null); Optional cmd = MethodUtils.getMethodsListWithAnnotation(getClass(), UserCommand.class).stream() .filter(m -> Pattern.compile(m.getAnnotation(UserCommand.class).pattern(), m.getAnnotation(UserCommand.class).patternFlags()).matcher(input).matches()) -- cgit v1.2.3