aboutsummaryrefslogtreecommitdiff
path: root/src/inhibitors
diff options
context:
space:
mode:
Diffstat (limited to 'src/inhibitors')
-rw-r--r--src/inhibitors/blacklist/channelGlobalBlacklist.ts10
-rw-r--r--src/inhibitors/blacklist/channelGuildBlacklist.ts8
-rw-r--r--src/inhibitors/blacklist/guildBlacklist.ts8
-rw-r--r--src/inhibitors/blacklist/userGlobalBlacklist.ts10
-rw-r--r--src/inhibitors/blacklist/userGuildBlacklist.ts8
-rw-r--r--src/inhibitors/commands/globalDisabledCommand.ts4
-rw-r--r--src/inhibitors/commands/guildDisabledCommand.ts2
-rw-r--r--src/inhibitors/noCache.ts8
8 files changed, 20 insertions, 38 deletions
diff --git a/src/inhibitors/blacklist/channelGlobalBlacklist.ts b/src/inhibitors/blacklist/channelGlobalBlacklist.ts
index 9dc5df9..0ddb2bb 100644
--- a/src/inhibitors/blacklist/channelGlobalBlacklist.ts
+++ b/src/inhibitors/blacklist/channelGlobalBlacklist.ts
@@ -11,14 +11,10 @@ export default class UserGlobalBlacklistInhibitor extends BushInhibitor {
public exec(message: BushMessage | BushSlashMessage): boolean {
if (!message.author) return false;
- if (
- this.client.isOwner(message.author) ||
- this.client.isSuperUser(message.author) ||
- this.client.user.id === message.author.id
- )
+ if (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user.id === message.author.id)
return false;
- if (this.client.cache.global.blacklistedChannels.includes(message.channel.id)) {
- this.client.console.debug(`channelGlobalBlacklist blocked message.`);
+ if (client.cache.global.blacklistedChannels.includes(message.channel.id)) {
+ client.console.debug(`channelGlobalBlacklist blocked message.`);
return true;
}
}
diff --git a/src/inhibitors/blacklist/channelGuildBlacklist.ts b/src/inhibitors/blacklist/channelGuildBlacklist.ts
index cc72182..13f3644 100644
--- a/src/inhibitors/blacklist/channelGuildBlacklist.ts
+++ b/src/inhibitors/blacklist/channelGuildBlacklist.ts
@@ -11,14 +11,10 @@ export default class ChannelGuildBlacklistInhibitor extends BushInhibitor {
public async exec(message: BushMessage | BushSlashMessage): Promise<boolean> {
if (!message.author || !message.guild) return false;
- if (
- this.client.isOwner(message.author) ||
- this.client.isSuperUser(message.author) ||
- this.client.user.id === message.author.id
- )
+ if (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user.id === message.author.id)
return false;
if ((await message.guild.getSetting('blacklistedChannels'))?.includes(message.channel.id)) {
- this.client.console.debug(`channelGuildBlacklist blocked message.`);
+ client.console.debug(`channelGuildBlacklist blocked message.`);
return true;
}
}
diff --git a/src/inhibitors/blacklist/guildBlacklist.ts b/src/inhibitors/blacklist/guildBlacklist.ts
index 7d08157..0d99c38 100644
--- a/src/inhibitors/blacklist/guildBlacklist.ts
+++ b/src/inhibitors/blacklist/guildBlacklist.ts
@@ -13,13 +13,11 @@ export default class GuildBlacklistInhibitor extends BushInhibitor {
if (!message.guild) return false;
if (
message.author &&
- (this.client.isOwner(message.author) ||
- this.client.isSuperUser(message.author) ||
- this.client.user.id === message.author.id)
+ (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user.id === message.author.id)
)
return false;
- if (this.client.cache.global.blacklistedGuilds.includes(message.guild.id)) {
- this.client.console.debug(`GuildBlacklistInhibitor blocked message.`);
+ if (client.cache.global.blacklistedGuilds.includes(message.guild.id)) {
+ client.console.debug(`GuildBlacklistInhibitor blocked message.`);
return true;
}
}
diff --git a/src/inhibitors/blacklist/userGlobalBlacklist.ts b/src/inhibitors/blacklist/userGlobalBlacklist.ts
index 061bae9..4ad1982 100644
--- a/src/inhibitors/blacklist/userGlobalBlacklist.ts
+++ b/src/inhibitors/blacklist/userGlobalBlacklist.ts
@@ -11,14 +11,10 @@ export default class UserGlobalBlacklistInhibitor extends BushInhibitor {
public exec(message: BushMessage | BushSlashMessage): boolean {
if (!message.author) return false;
- if (
- this.client.isOwner(message.author) ||
- this.client.isSuperUser(message.author) ||
- this.client.user.id === message.author.id
- )
+ if (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user.id === message.author.id)
return false;
- if (this.client.cache.global.blacklistedUsers.includes(message.author.id)) {
- this.client.console.debug(`userGlobalBlacklist blocked message.`);
+ if (client.cache.global.blacklistedUsers.includes(message.author.id)) {
+ client.console.debug(`userGlobalBlacklist blocked message.`);
return true;
}
}
diff --git a/src/inhibitors/blacklist/userGuildBlacklist.ts b/src/inhibitors/blacklist/userGuildBlacklist.ts
index 02a3762..473c0fb 100644
--- a/src/inhibitors/blacklist/userGuildBlacklist.ts
+++ b/src/inhibitors/blacklist/userGuildBlacklist.ts
@@ -11,14 +11,10 @@ export default class UserGuildBlacklistInhibitor extends BushInhibitor {
public async exec(message: BushMessage | BushSlashMessage): Promise<boolean> {
if (!message.author || !message.guild) return false;
- if (
- this.client.isOwner(message.author) ||
- this.client.isSuperUser(message.author) ||
- this.client.user.id === message.author.id
- )
+ if (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user.id === message.author.id)
return false;
if ((await message.guild.getSetting('blacklistedUsers'))?.includes(message.author.id)) {
- this.client.console.debug(`userGuildBlacklist blocked message.`);
+ client.console.debug(`userGuildBlacklist blocked message.`);
return true;
}
}
diff --git a/src/inhibitors/commands/globalDisabledCommand.ts b/src/inhibitors/commands/globalDisabledCommand.ts
index 3ce39c2..2954393 100644
--- a/src/inhibitors/commands/globalDisabledCommand.ts
+++ b/src/inhibitors/commands/globalDisabledCommand.ts
@@ -11,8 +11,8 @@ export default class DisabledGuildCommandInhibitor extends BushInhibitor {
public async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
if (message.author.isOwner()) return false;
- if (this.client.cache.global.disabledCommands?.includes(command?.id)) {
- this.client.console.debug(`disabledGlobalCommand blocked message.`);
+ if (client.cache.global.disabledCommands?.includes(command?.id)) {
+ client.console.debug(`disabledGlobalCommand blocked message.`);
return true;
}
}
diff --git a/src/inhibitors/commands/guildDisabledCommand.ts b/src/inhibitors/commands/guildDisabledCommand.ts
index a036ec5..d16bff7 100644
--- a/src/inhibitors/commands/guildDisabledCommand.ts
+++ b/src/inhibitors/commands/guildDisabledCommand.ts
@@ -14,7 +14,7 @@ export default class DisabledGuildCommandInhibitor extends BushInhibitor {
if (message.author.isOwner() || message.author.isSuperUser()) return false; // super users bypass guild disabled commands
if ((await message.guild.getSetting('disabledCommands'))?.includes(command?.id)) {
- this.client.console.debug(`disabledGuildCommand blocked message.`);
+ client.console.debug(`disabledGuildCommand blocked message.`);
return true;
}
}
diff --git a/src/inhibitors/noCache.ts b/src/inhibitors/noCache.ts
index 9bddedd..d461076 100644
--- a/src/inhibitors/noCache.ts
+++ b/src/inhibitors/noCache.ts
@@ -10,10 +10,10 @@ export default class NoCacheInhibitor extends BushInhibitor {
}
public async exec(message: BushMessage | BushSlashMessage): Promise<boolean> {
- if (this.client.isOwner(message.author)) return false;
- for (const property in this.client.cache.global) {
- if (!this.client.cache.global[property]) {
- this.client.console.debug(`NoCacheInhibitor blocked message.`);
+ if (client.isOwner(message.author)) return false;
+ for (const property in client.cache.global) {
+ if (!client.cache.global[property]) {
+ client.console.debug(`NoCacheInhibitor blocked message.`);
return true;
}
}