[FIX] Regex on run slash command (#1223)

This commit is contained in:
Djorkaeff Alexandre 2019-09-25 19:14:20 -03:00 committed by Diego Mello
parent 0ff47f477a
commit 58389dfdca
1 changed files with 1 additions and 1 deletions

View File

@ -620,7 +620,7 @@ class MessageBox extends Component {
).fetch(); ).fetch();
if (slashCommand.length > 0) { if (slashCommand.length > 0) {
try { try {
const messageWithoutCommand = message.substr(message.indexOf(' ') + 1); const messageWithoutCommand = message.replace(/([^\s]+)/, '').trim();
RocketChat.runSlashCommand(command, roomId, messageWithoutCommand); RocketChat.runSlashCommand(command, roomId, messageWithoutCommand);
} catch (e) { } catch (e) {
log(e); log(e);