From e1c613829950a534d9f45c00a033b83575be3b3c Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 17 Jun 2022 20:03:05 -0400 Subject: remove global client variable --- src/inhibitors/checks/fatal.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/inhibitors/checks/fatal.ts') diff --git a/src/inhibitors/checks/fatal.ts b/src/inhibitors/checks/fatal.ts index a3601b5..9fda504 100644 --- a/src/inhibitors/checks/fatal.ts +++ b/src/inhibitors/checks/fatal.ts @@ -12,10 +12,11 @@ export default class FatalInhibitor extends BushInhibitor { } public async exec(message: Message | SlashMessage): Promise { - if (client.isOwner(message.author)) return false; - for (const property in client.cache.global) { - if (!client.cache.global[property as keyof typeof client.cache.global]) { - void client.console.verbose( + if (this.client.isOwner(message.author)) return false; + const globalCache = this.client.cache.global; + for (const property in globalCache) { + if (!globalCache[property as keyof typeof globalCache]) { + void this.client.console.verbose( 'fatal', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild?.name}>>.` ); -- cgit