diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-06-17 20:03:05 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-06-17 20:03:05 -0400 |
commit | e1c613829950a534d9f45c00a033b83575be3b3c (patch) | |
tree | 2de1e5231217211ae4087c46cc74dc46c584507a /src/listeners/contextCommands | |
parent | 0e87bbd3940d89defcb04926587b35c8f4d1947f (diff) | |
download | tanzanite-e1c613829950a534d9f45c00a033b83575be3b3c.tar.gz tanzanite-e1c613829950a534d9f45c00a033b83575be3b3c.tar.bz2 tanzanite-e1c613829950a534d9f45c00a033b83575be3b3c.zip |
remove global client variable
Diffstat (limited to 'src/listeners/contextCommands')
4 files changed, 10 insertions, 10 deletions
diff --git a/src/listeners/contextCommands/contextCommandBlocked.ts b/src/listeners/contextCommands/contextCommandBlocked.ts index a9397b6..bb237a0 100644 --- a/src/listeners/contextCommands/contextCommandBlocked.ts +++ b/src/listeners/contextCommands/contextCommandBlocked.ts @@ -11,7 +11,7 @@ export default class ContextCommandBlockedListener extends BushListener { } public async exec(...[interaction, command, reason]: ContextMenuCommandHandlerEvents['blocked']) { - void client.console.info( + void this.client.console.info( `ContextCommandBlocked`, `<<${interaction.user.tag}>> tried to run <<${command}>> but was blocked because <<${reason}>>.`, true diff --git a/src/listeners/contextCommands/contextCommandError.ts b/src/listeners/contextCommands/contextCommandError.ts index e69ed4e..4b1ea52 100644 --- a/src/listeners/contextCommands/contextCommandError.ts +++ b/src/listeners/contextCommands/contextCommandError.ts @@ -1,6 +1,6 @@ import { BushListener, colors, format, formatError } from '#lib'; import { type ContextMenuCommand, type ContextMenuCommandHandlerEvents } from 'discord-akairo'; -import { ChannelType, ContextMenuCommandInteraction, EmbedBuilder, GuildTextBasedChannel } from 'discord.js'; +import { ChannelType, Client, ContextMenuCommandInteraction, EmbedBuilder, GuildTextBasedChannel } from 'discord.js'; import CommandErrorListener, { IFuckedUpError } from '../commands/commandError.js'; export default class ContextCommandErrorListener extends BushListener { @@ -13,10 +13,10 @@ export default class ContextCommandErrorListener extends BushListener { } public exec(...[error, interaction, command]: ContextMenuCommandHandlerEvents['error']) { - return ContextCommandErrorListener.handleError(error, interaction, command); + return ContextCommandErrorListener.handleError(this.client, error, interaction, command); } - public static async handleError(...[error, interaction, command]: ContextMenuCommandHandlerEvents['error']) { + public static async handleError(client: Client, ...[error, interaction, command]: ContextMenuCommandHandlerEvents['error']) { try { const errorNum = Math.floor(Math.random() * 6969696969) + 69; // hehe funny number const channel = @@ -49,8 +49,8 @@ export default class ContextCommandErrorListener extends BushListener { false ); - const _haste = CommandErrorListener.getErrorHaste(error); - const _stack = CommandErrorListener.getErrorStack(error); + const _haste = CommandErrorListener.getErrorHaste(client, error); + const _stack = CommandErrorListener.getErrorStack(client, error); const [haste, stack] = await Promise.all([_haste, _stack]); const options = { interaction, error, errorNum, command, channel, haste, stack }; diff --git a/src/listeners/contextCommands/contextCommandNotFound.ts b/src/listeners/contextCommands/contextCommandNotFound.ts index 65954a2..f5097f3 100644 --- a/src/listeners/contextCommands/contextCommandNotFound.ts +++ b/src/listeners/contextCommands/contextCommandNotFound.ts @@ -11,6 +11,6 @@ export default class ContextCommandNotFoundListener extends BushListener { } public async exec(...[interaction]: ContextMenuCommandHandlerEvents['notFound']) { - void client.console.info('contextCommandNotFound', `<<${interaction?.commandName}>> could not be found.`); + void this.client.console.info('contextCommandNotFound', `<<${interaction?.commandName}>> could not be found.`); } } diff --git a/src/listeners/contextCommands/contextCommandStarted.ts b/src/listeners/contextCommands/contextCommandStarted.ts index 3aab07a..2d1e9ef 100644 --- a/src/listeners/contextCommands/contextCommandStarted.ts +++ b/src/listeners/contextCommands/contextCommandStarted.ts @@ -12,7 +12,7 @@ export default class ContextCommandStartedListener extends BushListener { } public async exec(...[interaction, command]: ContextMenuCommandHandlerEvents['started']) { - client.sentry.addBreadcrumb({ + this.client.sentry.addBreadcrumb({ message: `[contextCommandStarted] The ${command.id} was started by ${interaction.user.tag}.`, level: 'info', timestamp: Date.now(), @@ -28,11 +28,11 @@ export default class ContextCommandStartedListener extends BushListener { '¯\\_(ツ)_/¯', 'guild.id': interaction.guild?.id ?? '¯\\_(ツ)_/¯', 'guild.name': interaction.guild?.name ?? '¯\\_(ツ)_/¯', - 'environment': client.config.environment + 'environment': this.client.config.environment } }); - return void client.logger.info( + return void this.client.logger.info( 'contextCommandStarted', `The <<${command.id}>> command was used by <<${interaction.user.tag}>> in ${ interaction.channel |