diff --git a/packages/api/src/EmbeddedChatApi.ts b/packages/api/src/EmbeddedChatApi.ts index 809b6f4b5..1f9aa3d85 100644 --- a/packages/api/src/EmbeddedChatApi.ts +++ b/packages/api/src/EmbeddedChatApi.ts @@ -1191,7 +1191,7 @@ export default class EmbeddedChatApi { return data; } - async execCommand({ command, params }: { command: string; params: string }) { + async execCommand({ command, params, tmid }: { command: string; params: string, tmid?: string }) { const { userId, authToken } = (await this.auth.getCurrentUser()) || {}; const response = await fetch(`${this.host}/api/v1/commands.run`, { headers: { @@ -1203,6 +1203,7 @@ export default class EmbeddedChatApi { body: JSON.stringify({ command, params, + tmid, roomId: this.rid, triggerId: Math.random().toString(32).slice(2, 20), }), diff --git a/packages/react/src/views/ChatInput/ChatInput.js b/packages/react/src/views/ChatInput/ChatInput.js index 998e9007c..e9515a3e6 100644 --- a/packages/react/src/views/ChatInput/ChatInput.js +++ b/packages/react/src/views/ChatInput/ChatInput.js @@ -354,7 +354,7 @@ const ChatInput = ({ scrollToBottom }) => { const handleCommandExecution = async (message) => { const execCommand = async (command, params) => { - await RCInstance.execCommand({ command, params }); + await RCInstance.execCommand({ command, params, tmid: threadId }); setFilteredCommands([]); };