From fdb5cf37291ed542e00f2c594751479b82b57cb0 Mon Sep 17 00:00:00 2001 From: kaname-png Date: Fri, 2 Sep 2022 14:52:07 -0600 Subject: [PATCH] fix(listeners): check preoconditions --- src/listeners/commands/pre-accepted.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/listeners/commands/pre-accepted.ts b/src/listeners/commands/pre-accepted.ts index 4b856f4..9293c67 100644 --- a/src/listeners/commands/pre-accepted.ts +++ b/src/listeners/commands/pre-accepted.ts @@ -13,13 +13,13 @@ export class CoreListener extends Listener { const { message, command, prefix } = payload; const globalResult = await this.container.stores.get('preconditions').run(message, command, payload as any); - if (!globalResult.isErr()) { + if (globalResult.isErr()) { this.container.client.emit(CommandEvents.CommandDenied, { ...payload, error: globalResult.err().unwrap() }); return; } const localResult = await command.preconditions.run(message, command, payload as any); - if (!localResult.isErr()) { + if (localResult.isErr()) { this.container.client.emit(CommandEvents.CommandDenied, { ...payload, error: localResult.err().unwrap() }); return; }