Chore: Migrate REST API - runSlashCommand to Typescript (#3893)
This commit is contained in:
parent
b9967fda9f
commit
9650c98b4f
|
@ -888,7 +888,7 @@ class MessageBox extends Component<IMessageBoxProps, IMessageBoxState> {
|
||||||
const messageWithoutCommand = message.replace(/([^\s]+)/, '').trim();
|
const messageWithoutCommand = message.replace(/([^\s]+)/, '').trim();
|
||||||
const [{ appId }] = slashCommand;
|
const [{ appId }] = slashCommand;
|
||||||
const triggerId = generateTriggerId(appId);
|
const triggerId = generateTriggerId(appId);
|
||||||
RocketChat.runSlashCommand(command, roomId, messageWithoutCommand, triggerId, tmid || messageTmid);
|
await RocketChat.runSlashCommand(command, roomId, messageWithoutCommand, triggerId, tmid || messageTmid);
|
||||||
replyCancel();
|
replyCancel();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logEvent(events.COMMAND_RUN_F);
|
logEvent(events.COMMAND_RUN_F);
|
||||||
|
|
|
@ -17,4 +17,7 @@ export type CommandsEndpoints = {
|
||||||
tmid?: string;
|
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
|
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
|
// RC 0.60.2
|
||||||
// TODO: missing definitions from server
|
|
||||||
// @ts-ignore
|
|
||||||
sdk.post('commands.run', {
|
sdk.post('commands.run', {
|
||||||
command,
|
command,
|
||||||
roomId,
|
roomId,
|
||||||
|
|
Loading…
Reference in New Issue