From bb774bbe0cfedd77be852f73448df061252b7c0a Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sat, 4 Sep 2021 12:39:08 -0400 Subject: I sure do love when one line causes 400 errors --- src/lib/extensions/discord-akairo/BushClient.ts | 4 +++- src/lib/extensions/discord-akairo/BushCommandHandler.ts | 14 -------------- src/lib/extensions/discord-akairo/BushCommandUtil.ts | 9 ++++----- src/lib/extensions/discord-akairo/BushListener.ts | 7 ++++++- src/lib/extensions/discord-akairo/BushSlashMessage.ts | 2 +- 5 files changed, 14 insertions(+), 22 deletions(-) (limited to 'src/lib/extensions') diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts index ab66f60..4cc8712 100644 --- a/src/lib/extensions/discord-akairo/BushClient.ts +++ b/src/lib/extensions/discord-akairo/BushClient.ts @@ -338,7 +338,9 @@ export class BushClient extends AkairoClient { super.destroy(); if (relogin) { diff --git a/src/lib/extensions/discord-akairo/BushCommandHandler.ts b/src/lib/extensions/discord-akairo/BushCommandHandler.ts index 44a0966..c533832 100644 --- a/src/lib/extensions/discord-akairo/BushCommandHandler.ts +++ b/src/lib/extensions/discord-akairo/BushCommandHandler.ts @@ -32,18 +32,4 @@ export class BushCommandHandler extends CommandHandler { public constructor(client: BushClient, options: CommandHandlerOptions) { super(client, options); } - - public override async runPostTypeInhibitors(message: BushMessage, command: BushCommand, slash = false): Promise { - const reason = this.inhibitorHandler ? await this.inhibitorHandler.test('post', message, command) : null; - if (reason != null) { - this.emit(slash ? commandHandlerEvents.SLASH_BLOCKED : commandHandlerEvents.COMMAND_BLOCKED, message, command, reason); - return true; - } - - if (await this.runPermissionChecks(message, command)) { - return true; - } - - return !!this.runCooldowns(message, command); - } } diff --git a/src/lib/extensions/discord-akairo/BushCommandUtil.ts b/src/lib/extensions/discord-akairo/BushCommandUtil.ts index 1e86401..bda0e74 100644 --- a/src/lib/extensions/discord-akairo/BushCommandUtil.ts +++ b/src/lib/extensions/discord-akairo/BushCommandUtil.ts @@ -1,5 +1,6 @@ import { CommandUtil, ParsedComponentData } from 'discord-akairo'; -import { Collection, Snowflake } from 'discord.js'; +import { Snowflake } from 'discord-api-types'; +import { Collection } from 'discord.js'; import { BushMessage } from '../discord.js/BushMessage'; import { BushCommand } from './BushCommand'; import { BushCommandHandler } from './BushCommandHandler'; @@ -9,14 +10,12 @@ export interface BushParsedComponentData extends ParsedComponentData { } export class BushCommandUtil extends CommandUtil { - public declare parsed?: BushParsedComponentData; + public declare parsed: BushParsedComponentData | null; public declare handler: BushCommandHandler; public declare message: BushMessage; - public declare messages?: Collection; - // public test: string; + public declare messages: Collection | null; public constructor(handler: BushCommandHandler, message: BushMessage) { super(handler, message); - // this.test = 'abc'; } } diff --git a/src/lib/extensions/discord-akairo/BushListener.ts b/src/lib/extensions/discord-akairo/BushListener.ts index b98bb02..82e874f 100644 --- a/src/lib/extensions/discord-akairo/BushListener.ts +++ b/src/lib/extensions/discord-akairo/BushListener.ts @@ -5,7 +5,12 @@ export class BushListener extends Listener { public declare client: BushClient; public constructor( id: string, - options: { emitter: string | EventEmitter; event: string; type?: 'on' | 'once'; category?: string } + options: { + emitter: string | EventEmitter; + event: string; + type?: 'on' | 'once' | 'prependListener' | 'prependOnceListener'; + category?: string; + } ) { super(id, options); } diff --git a/src/lib/extensions/discord-akairo/BushSlashMessage.ts b/src/lib/extensions/discord-akairo/BushSlashMessage.ts index d10a024..442b0d4 100644 --- a/src/lib/extensions/discord-akairo/BushSlashMessage.ts +++ b/src/lib/extensions/discord-akairo/BushSlashMessage.ts @@ -11,7 +11,7 @@ export class BushSlashMessage extends AkairoMessage { public declare client: BushClient; public declare util: BushCommandUtil; public declare author: BushUser; - public declare member: BushGuildMember; + public declare member: BushGuildMember | null; public constructor(client: BushClient, interaction: CommandInteraction, command: BushCommand) { super(client, interaction, command); } -- cgit