Unverified Commit 9650c98b authored by Alex Junior's avatar Alex Junior Committed by GitHub
Browse files

Chore: Migrate REST API - runSlashCommand to Typescript (#3893)

parent b9967fda
......@@ -888,7 +888,7 @@ class MessageBox extends Component<IMessageBoxProps, IMessageBoxState> {
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);
......
......@@ -17,4 +17,7 @@ export type CommandsEndpoints = {
tmid?: string;
}) => {};
};
'commands.run': {
POST: (params: { command: string; roomId: string; params: string; triggerId?: string; tmid?: string }) => {};
};
};
......@@ -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,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment