Skip to content

Commit

Permalink
fix: some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sawa-ko committed Sep 2, 2022
1 parent fdb5cf3 commit 42e6ee2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/listeners/commands/accepted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Result } from '@sapphire/result';

import { Listener } from '../../lib/structures/listener';
import { CommandEvents } from '../../utils/enums/command';
import type { CommandAcceptedPayload } from '../../utils/interfaces/command';
import type { CommandAcceptedPayload, CommandRunContext } from '../../utils/interfaces/command';

export class CoreListener extends Listener {
public constructor(context: PieceContext) {
Expand All @@ -12,8 +12,8 @@ export class CoreListener extends Listener {
});
}

public async run(payload: CommandAcceptedPayload) {
const { command, message, parameters, context } = payload;
public async run(payload: CommandAcceptedPayload, context: CommandRunContext) {
const { command, message, parameters } = payload;
const args = await command.preParse(message, parameters, context);
const result = await Result.fromAsync(async () => {
this.container.client.emit(CommandEvents.CommandRun, { command, message });
Expand Down
3 changes: 2 additions & 1 deletion src/utils/interfaces/command.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { AliasPieceJSON, AliasPieceOptions } from '@sapphire/pieces';
import type { ResultError } from '@sapphire/result';
import type { NonNullObject } from '@sapphire/utilities';
import type { Message, API } from 'revolt.js';

Expand Down Expand Up @@ -142,7 +143,7 @@ export interface CommandAcceptedPayload extends CommandPreAcceptedPayload {
export interface CommandErrorPayload {
command: Command;
message: Message;
error: unknown;
error: ResultError<unknown>;
}

export interface CommandNameNotFoundPayload {
Expand Down

0 comments on commit 42e6ee2

Please # to comment.