diff --git a/app/containers/MessageBox/index.js b/app/containers/MessageBox/index.js index b4d35aedf..c07ff6dfc 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);