diff --git a/apps/meteor/app/slashcommands-join/client/client.ts b/apps/meteor/app/slashcommands-join/client/client.ts index 3fb1ac1c949d..fcf56d6e55a6 100644 --- a/apps/meteor/app/slashcommands-join/client/client.ts +++ b/apps/meteor/app/slashcommands-join/client/client.ts @@ -10,8 +10,8 @@ slashCommands.add( params: '#channel', permission: 'view-c-room', }, - function (err: Meteor.Error, _result: unknown, params: Record) { - if (err.error === 'error-user-already-in-room') { + function (err, _result: unknown, params: Record) { + if ((err as Meteor.Error).error === 'error-user-already-in-room') { params.cmd = 'open'; params.msg.msg = params.msg.msg.replace('join', 'open'); return slashCommands.run('open', params.params, params.msg, ''); diff --git a/packages/core-typings/src/SlashCommands/index.ts b/packages/core-typings/src/SlashCommands/index.ts index b8e0d5d9a7f9..928d34008c5e 100644 --- a/packages/core-typings/src/SlashCommands/index.ts +++ b/packages/core-typings/src/SlashCommands/index.ts @@ -43,7 +43,7 @@ export type SlashCommand = { description: SlashCommandOptions['description']; permission: SlashCommandOptions['permission']; clientOnly?: SlashCommandOptions['clientOnly']; - result?: (err: Meteor.Error, result: never, data: { cmd: string; params: string; msg: IMessage }) => void; + result?: (err: unknown, result: never, data: { cmd: string; params: string; msg: IMessage }) => void; providesPreview: boolean; previewer?: SlashCommandPreviewer; previewCallback?: SlashCommandPreviewCallback; diff --git a/packages/rest-typings/src/v1/commands.ts b/packages/rest-typings/src/v1/commands.ts index 32e14b1c0393..aec14e57c669 100644 --- a/packages/rest-typings/src/v1/commands.ts +++ b/packages/rest-typings/src/v1/commands.ts @@ -5,7 +5,7 @@ import type { PaginatedResult } from '../helpers/PaginatedResult'; export type CommandsEndpoints = { 'commands.get': { GET: (params: { command: string }) => { - command: SlashCommand; + command: Pick; }; }; 'commands.list': { @@ -14,7 +14,7 @@ export type CommandsEndpoints = { fields?: string; }>, ) => PaginatedResult<{ - commands: SlashCommand[]; + commands: Pick[]; }>; }; 'commands.run': {