Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Jun 8, 2022
1 parent 7ea6491 commit 06f6cb3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/meteor/app/slashcommands-join/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ slashCommands.add(
params: '#channel',
permission: 'view-c-room',
},
function (err: Meteor.Error, _result: unknown, params: Record<string, any>) {
if (err.error === 'error-user-already-in-room') {
function (err, _result: unknown, params: Record<string, any>) {
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, '');
Expand Down
2 changes: 1 addition & 1 deletion packages/core-typings/src/SlashCommands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export type SlashCommand<T extends string = string> = {
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;
Expand Down
4 changes: 2 additions & 2 deletions packages/rest-typings/src/v1/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { PaginatedResult } from '../helpers/PaginatedResult';
export type CommandsEndpoints = {
'commands.get': {
GET: (params: { command: string }) => {
command: SlashCommand;
command: Pick<SlashCommand, 'clientOnly' | 'command' | 'description' | 'params' | 'providesPreview'>;
};
};
'commands.list': {
Expand All @@ -14,7 +14,7 @@ export type CommandsEndpoints = {
fields?: string;
}>,
) => PaginatedResult<{
commands: SlashCommand[];
commands: Pick<SlashCommand, 'clientOnly' | 'command' | 'description' | 'params' | 'providesPreview'>[];
}>;
};
'commands.run': {
Expand Down

0 comments on commit 06f6cb3

Please sign in to comment.