Skip to content

Commit

Permalink
added support for multiple params
Browse files Browse the repository at this point in the history
  • Loading branch information
Spiral-Memory committed Feb 29, 2024
1 parent 3104535 commit b79fd6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react/src/components/ChatInput/ChatInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ const ChatInput = ({ scrollToBottom }) => {
if (!editMessage.msg) {
if (message.startsWith('/')) {
// its a slash command
const [command, params] = message.split(/\s+/);
const [command, ...paramsArray] = message.split(' ');
const params = paramsArray.join(' ');

if (commands.find((c) => c.command === command.replace('/', ''))) {
messageRef.current.value = '';
setDisableButton(true);
Expand Down

0 comments on commit b79fd6b

Please sign in to comment.