From 58389dfdcade04dcc92dbd11819b2a0229f91c12 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Wed, 25 Sep 2019 19:14:20 -0300 Subject: [PATCH] [FIX] Regex on run slash command (#1223) --- app/containers/MessageBox/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/containers/MessageBox/index.js b/app/containers/MessageBox/index.js index b4d35aed..c07ff6df 100644 --- a/app/containers/MessageBox/index.js +++ b/app/containers/MessageBox/index.js @@ -620,7 +620,7 @@ class MessageBox extends Component { ).fetch(); if (slashCommand.length > 0) { try { - const messageWithoutCommand = message.substr(message.indexOf(' ') + 1); + const messageWithoutCommand = message.replace(/([^\s]+)/, '').trim(); RocketChat.runSlashCommand(command, roomId, messageWithoutCommand); } catch (e) { log(e);