diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-26 20:07:19 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-26 20:07:19 -0400 |
commit | ed59b7f1827ab93573b079144c3eeaa01ce40492 (patch) | |
tree | 7ceac6d61a8a25586ab9bbaf7acfbade91c97132 /src/listeners/commands | |
parent | c0a81b014a56e4d44c826f78391a930361aab122 (diff) | |
download | tanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.tar.gz tanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.tar.bz2 tanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.zip |
clean up, bug fixes
Diffstat (limited to 'src/listeners/commands')
-rw-r--r-- | src/listeners/commands/commandBlocked.ts | 4 | ||||
-rw-r--r-- | src/listeners/commands/commandCooldown.ts | 2 | ||||
-rw-r--r-- | src/listeners/commands/commandError.ts | 4 | ||||
-rw-r--r-- | src/listeners/commands/commandMissingPermissions.ts | 6 | ||||
-rw-r--r-- | src/listeners/commands/messageBlocked.ts | 2 | ||||
-rw-r--r-- | src/listeners/commands/slashBlocked.ts | 2 | ||||
-rw-r--r-- | src/listeners/commands/slashCommandError.ts | 2 | ||||
-rw-r--r-- | src/listeners/commands/slashMissingPermissions.ts | 4 | ||||
-rw-r--r-- | src/listeners/commands/slashNotFound.ts | 2 | ||||
-rw-r--r-- | src/listeners/commands/slashStarted.ts | 2 |
10 files changed, 13 insertions, 17 deletions
diff --git a/src/listeners/commands/commandBlocked.ts b/src/listeners/commands/commandBlocked.ts index 8329c83..074b6d6 100644 --- a/src/listeners/commands/commandBlocked.ts +++ b/src/listeners/commands/commandBlocked.ts @@ -9,7 +9,7 @@ export default class CommandBlockedListener extends BushListener { }); } - public override async exec(...[message, command, reason]: BushCommandHandlerEvents['commandBlocked']): Promise<unknown> { + public override async exec(...[message, command, reason]: BushCommandHandlerEvents['commandBlocked']) { return await CommandBlockedListener.handleBlocked(message, command, reason); } @@ -17,7 +17,7 @@ export default class CommandBlockedListener extends BushListener { message: Message | BushMessage | BushSlashMessage, command: BushCommand | null, reason?: string - ): Promise<unknown> { + ) { const isSlash = !!command && !!message.util?.isSlash; void client.console.info( diff --git a/src/listeners/commands/commandCooldown.ts b/src/listeners/commands/commandCooldown.ts index 9a57ac0..118b676 100644 --- a/src/listeners/commands/commandCooldown.ts +++ b/src/listeners/commands/commandCooldown.ts @@ -9,7 +9,7 @@ export default class CommandCooldownListener extends BushListener { }); } - public override async exec(...[message, command, remaining]: BushCommandHandlerEvents['cooldown']): Promise<void> { + public override async exec(...[message, command, remaining]: BushCommandHandlerEvents['cooldown']) { void client.console.info( 'commandCooldown', `<<${message.author.tag}>> tried to run <<${ diff --git a/src/listeners/commands/commandError.ts b/src/listeners/commands/commandError.ts index fb1bebe..0ef4ebd 100644 --- a/src/listeners/commands/commandError.ts +++ b/src/listeners/commands/commandError.ts @@ -11,13 +11,13 @@ export default class CommandErrorListener extends BushListener { }); } - public override exec(...[error, message, command]: BushCommandHandlerEvents['error']): Promise<unknown> { + public override exec(...[error, message, command]: BushCommandHandlerEvents['error']) { return CommandErrorListener.handleError(error, message, command); } public static async handleError( ...[error, message, _command]: BushCommandHandlerEvents['error'] | BushCommandHandlerEvents['slashError'] - ): Promise<void> { + ) { const isSlash = message.util!.isSlash; const errorNum = Math.floor(Math.random() * 6969696969) + 69; // hehe funny number const channel = diff --git a/src/listeners/commands/commandMissingPermissions.ts b/src/listeners/commands/commandMissingPermissions.ts index 1917ce0..0bbf916 100644 --- a/src/listeners/commands/commandMissingPermissions.ts +++ b/src/listeners/commands/commandMissingPermissions.ts @@ -9,9 +9,7 @@ export default class CommandMissingPermissionsListener extends BushListener { }); } - public override async exec( - ...[message, command, type, missing]: BushCommandHandlerEvents['missingPermissions'] - ): Promise<unknown> { + public override async exec(...[message, command, type, missing]: BushCommandHandlerEvents['missingPermissions']) { return await CommandMissingPermissionsListener.handleMissing(message, command, type, missing); } @@ -19,7 +17,7 @@ export default class CommandMissingPermissionsListener extends BushListener { ...[message, command, type, missing]: | BushCommandHandlerEvents['missingPermissions'] | BushCommandHandlerEvents['slashMissingPermissions'] - ): Promise<unknown> { + ) { const niceMissing = (missing.includes('ADMINISTRATOR') ? (['ADMINISTRATOR'] as 'ADMINISTRATOR'[]) : missing).map( (perm) => client.consts.mappings.permissions[perm]?.name ?? missing ); diff --git a/src/listeners/commands/messageBlocked.ts b/src/listeners/commands/messageBlocked.ts index fc64802..0b1001c 100644 --- a/src/listeners/commands/messageBlocked.ts +++ b/src/listeners/commands/messageBlocked.ts @@ -8,7 +8,7 @@ export default class MessageBlockedListener extends BushListener { }); } - public override async exec(...[message, reason]: BushCommandHandlerEvents['messageBlocked']): Promise<unknown> { + public override async exec(...[message, reason]: BushCommandHandlerEvents['messageBlocked']) { const reasons = client.consts.BlockedReasons; if ([reasons.CLIENT, reasons.BOT].includes(reason)) return; // return await CommandBlockedListener.handleBlocked(message as Message, null, reason); diff --git a/src/listeners/commands/slashBlocked.ts b/src/listeners/commands/slashBlocked.ts index 851cb5e..6c94187 100644 --- a/src/listeners/commands/slashBlocked.ts +++ b/src/listeners/commands/slashBlocked.ts @@ -10,7 +10,7 @@ export default class SlashBlockedListener extends BushListener { }); } - public override async exec(...[message, command, reason]: BushCommandHandlerEvents['slashBlocked']): Promise<unknown> { + public override async exec(...[message, command, reason]: BushCommandHandlerEvents['slashBlocked']) { return await CommandBlockedListener.handleBlocked(message, command, reason); } } diff --git a/src/listeners/commands/slashCommandError.ts b/src/listeners/commands/slashCommandError.ts index 5ab195f..9b194e5 100644 --- a/src/listeners/commands/slashCommandError.ts +++ b/src/listeners/commands/slashCommandError.ts @@ -9,7 +9,7 @@ export default class SlashCommandErrorListener extends BushListener { category: 'commands' }); } - public override async exec(...[error, message, command]: BushCommandHandlerEvents['slashError']): Promise<void> { + public override async exec(...[error, message, command]: BushCommandHandlerEvents['slashError']) { return await CommandErrorListener.handleError(error, message, command); } } diff --git a/src/listeners/commands/slashMissingPermissions.ts b/src/listeners/commands/slashMissingPermissions.ts index a01b1fa..33a9363 100644 --- a/src/listeners/commands/slashMissingPermissions.ts +++ b/src/listeners/commands/slashMissingPermissions.ts @@ -10,9 +10,7 @@ export default class SlashMissingPermissionsListener extends BushListener { }); } - public override async exec( - ...[message, command, type, missing]: BushCommandHandlerEvents['slashMissingPermissions'] - ): Promise<unknown> { + public override async exec(...[message, command, type, missing]: BushCommandHandlerEvents['slashMissingPermissions']) { return await CommandMissingPermissionsListener.handleMissing(message, command, type, missing); } } diff --git a/src/listeners/commands/slashNotFound.ts b/src/listeners/commands/slashNotFound.ts index 2179c9b..c5d92bd 100644 --- a/src/listeners/commands/slashNotFound.ts +++ b/src/listeners/commands/slashNotFound.ts @@ -9,7 +9,7 @@ export default class SlashNotFoundListener extends BushListener { }); } - public override async exec(...[interaction]: BushCommandHandlerEvents['slashNotFound']): Promise<void> { + public override async exec(...[interaction]: BushCommandHandlerEvents['slashNotFound']) { void client.console.info('slashNotFound', `<<${interaction?.commandName}>> could not be found.`); } } diff --git a/src/listeners/commands/slashStarted.ts b/src/listeners/commands/slashStarted.ts index aaeecbc..e9e4028 100644 --- a/src/listeners/commands/slashStarted.ts +++ b/src/listeners/commands/slashStarted.ts @@ -8,7 +8,7 @@ export default class SlashStartedListener extends BushListener { category: 'commands' }); } - public override async exec(...[message, command]: BushCommandHandlerEvents['slashStarted']): Promise<unknown> { + public override async exec(...[message, command]: BushCommandHandlerEvents['slashStarted']) { return void client.logger.info( 'slashStarted', `The <<${command.id}>> command was used by <<${message.author.tag}>> in ${ |