aboutsummaryrefslogtreecommitdiff
path: root/src/inhibitors/checks
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-17 20:03:05 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-17 20:03:05 -0400
commite1c613829950a534d9f45c00a033b83575be3b3c (patch)
tree2de1e5231217211ae4087c46cc74dc46c584507a /src/inhibitors/checks
parent0e87bbd3940d89defcb04926587b35c8f4d1947f (diff)
downloadtanzanite-e1c613829950a534d9f45c00a033b83575be3b3c.tar.gz
tanzanite-e1c613829950a534d9f45c00a033b83575be3b3c.tar.bz2
tanzanite-e1c613829950a534d9f45c00a033b83575be3b3c.zip
remove global client variable
Diffstat (limited to 'src/inhibitors/checks')
-rw-r--r--src/inhibitors/checks/fatal.ts9
-rw-r--r--src/inhibitors/checks/guildUnavailable.ts2
2 files changed, 6 insertions, 5 deletions
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<boolean> {
- 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}>>.`
);
diff --git a/src/inhibitors/checks/guildUnavailable.ts b/src/inhibitors/checks/guildUnavailable.ts
index 6c741a1..f5b62f4 100644
--- a/src/inhibitors/checks/guildUnavailable.ts
+++ b/src/inhibitors/checks/guildUnavailable.ts
@@ -13,7 +13,7 @@ export default class GuildUnavailableInhibitor extends BushInhibitor {
public async exec(message: Message | SlashMessage): Promise<boolean> {
if (message.inGuild() && !message.guild.available) {
- void client.console.verbose(
+ void this.client.console.verbose(
'guildUnavailable',
`Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`
);