diff --git a/app/containers/MessageBox/index.tsx b/app/containers/MessageBox/index.tsx index 1b94e80d..058cf0d4 100644 --- a/app/containers/MessageBox/index.tsx +++ b/app/containers/MessageBox/index.tsx @@ -888,7 +888,7 @@ class MessageBox extends Component { const messageWithoutCommand = message.replace(/([^\s]+)/, '').trim(); const [{ appId }] = slashCommand; const triggerId = generateTriggerId(appId); - RocketChat.runSlashCommand(command, roomId, messageWithoutCommand, triggerId, tmid || messageTmid); + await RocketChat.runSlashCommand(command, roomId, messageWithoutCommand, triggerId, tmid || messageTmid); replyCancel(); } catch (e) { logEvent(events.COMMAND_RUN_F); diff --git a/app/definitions/rest/v1/commands.ts b/app/definitions/rest/v1/commands.ts index 3dd81b68..b1e9195e 100644 --- a/app/definitions/rest/v1/commands.ts +++ b/app/definitions/rest/v1/commands.ts @@ -17,4 +17,7 @@ export type CommandsEndpoints = { tmid?: string; }) => {}; }; + 'commands.run': { + POST: (params: { command: string; roomId: string; params: string; triggerId?: string; tmid?: string }) => {}; + }; }; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index c487d3a8..e8fb6eae 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -677,10 +677,8 @@ export const getSyncThreadsList = ({ rid, updatedSince }: { rid: string; updated updatedSince }); -export const runSlashCommand = (command: string, roomId: string, params: any, triggerId?: string, tmid?: string): any => +export const runSlashCommand = (command: string, roomId: string, params: string, triggerId?: string, tmid?: string) => // RC 0.60.2 - // TODO: missing definitions from server - // @ts-ignore sdk.post('commands.run', { command, roomId,