aboutsummaryrefslogtreecommitdiff
path: root/src/inhibitors/blacklist
diff options
context:
space:
mode:
Diffstat (limited to 'src/inhibitors/blacklist')
-rw-r--r--src/inhibitors/blacklist/channelGlobalBlacklist.ts6
-rw-r--r--src/inhibitors/blacklist/channelGuildBlacklist.ts4
-rw-r--r--src/inhibitors/blacklist/guildBlacklist.ts10
-rw-r--r--src/inhibitors/blacklist/userGlobalBlacklist.ts6
-rw-r--r--src/inhibitors/blacklist/userGuildBlacklist.ts8
5 files changed, 21 insertions, 13 deletions
diff --git a/src/inhibitors/blacklist/channelGlobalBlacklist.ts b/src/inhibitors/blacklist/channelGlobalBlacklist.ts
index 86ab21f..7f23604 100644
--- a/src/inhibitors/blacklist/channelGlobalBlacklist.ts
+++ b/src/inhibitors/blacklist/channelGlobalBlacklist.ts
@@ -13,9 +13,9 @@ export default class UserGlobalBlacklistInhibitor extends BushInhibitor {
public exec(message: CommandMessage | SlashMessage, command: BushCommand): boolean {
if (!message.author || !message.inGuild()) return false;
// do not change to message.author.isOwner()
- if (client.isOwner(message.author) || client.user!.id === message.author.id) return false;
- if (client.cache.global.blacklistedChannels.includes(message.channel!.id) && !command.bypassChannelBlacklist) {
- void client.console.verbose(
+ if (this.client.isOwner(message.author) || this.client.user!.id === message.author.id) return false;
+ if (this.client.cache.global.blacklistedChannels.includes(message.channel!.id) && !command.bypassChannelBlacklist) {
+ void this.client.console.verbose(
'channelGlobalBlacklist',
`Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`
);
diff --git a/src/inhibitors/blacklist/channelGuildBlacklist.ts b/src/inhibitors/blacklist/channelGuildBlacklist.ts
index 8cf35ec..ae087bd 100644
--- a/src/inhibitors/blacklist/channelGuildBlacklist.ts
+++ b/src/inhibitors/blacklist/channelGuildBlacklist.ts
@@ -13,7 +13,7 @@ export default class ChannelGuildBlacklistInhibitor extends BushInhibitor {
public async exec(message: CommandMessage | SlashMessage, command: BushCommand): Promise<boolean> {
if (!message.author || !message.inGuild()) return false;
// do not change to message.author.isOwner()
- if (client.isOwner(message.author) || client.user!.id === message.author.id) return false;
+ if (this.client.isOwner(message.author) || this.client.user!.id === message.author.id) return false;
if (
(await message.guild.getSetting('bypassChannelBlacklist'))?.includes(message.author.id) &&
!command.bypassChannelBlacklist
@@ -24,7 +24,7 @@ export default class ChannelGuildBlacklistInhibitor extends BushInhibitor {
(await message.guild.getSetting('blacklistedChannels'))?.includes(message.channel!.id) &&
!command.bypassChannelBlacklist
) {
- void client.console.verbose(
+ void this.client.console.verbose(
'channelGuildBlacklist',
`Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`
);
diff --git a/src/inhibitors/blacklist/guildBlacklist.ts b/src/inhibitors/blacklist/guildBlacklist.ts
index 60c5755..b7df41a 100644
--- a/src/inhibitors/blacklist/guildBlacklist.ts
+++ b/src/inhibitors/blacklist/guildBlacklist.ts
@@ -13,10 +13,14 @@ export default class GuildBlacklistInhibitor extends BushInhibitor {
public exec(message: CommandMessage | SlashMessage): boolean {
if (!message.author || !message.inGuild()) return false;
// do not change to message.author.isOwner()
- if (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user!.id === message.author.id)
+ if (
+ this.client.isOwner(message.author) ||
+ this.client.isSuperUser(message.author) ||
+ this.client.user!.id === message.author.id
+ )
return false;
- if (client.cache.global.blacklistedGuilds.includes(message.guild.id)) {
- void client.console.verbose(
+ if (this.client.cache.global.blacklistedGuilds.includes(message.guild.id)) {
+ void this.client.console.verbose(
'guildBlacklist',
`Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`
);
diff --git a/src/inhibitors/blacklist/userGlobalBlacklist.ts b/src/inhibitors/blacklist/userGlobalBlacklist.ts
index bf0d4bd..e8a1306 100644
--- a/src/inhibitors/blacklist/userGlobalBlacklist.ts
+++ b/src/inhibitors/blacklist/userGlobalBlacklist.ts
@@ -13,9 +13,9 @@ export default class UserGlobalBlacklistInhibitor extends BushInhibitor {
public exec(message: CommandMessage | SlashMessage): boolean {
if (!message.author) return false;
// do not change to message.author.isOwner()
- if (client.isOwner(message.author) || client.user!.id === message.author.id) return false;
- if (client.cache.global.blacklistedUsers.includes(message.author.id)) {
- void client.console.verbose(
+ if (this.client.isOwner(message.author) || this.client.user!.id === message.author.id) return false;
+ if (this.client.cache.global.blacklistedUsers.includes(message.author.id)) {
+ void this.client.console.verbose(
'userGlobalBlacklist',
`Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${
message.inGuild() ? message.guild?.name : message.author.tag
diff --git a/src/inhibitors/blacklist/userGuildBlacklist.ts b/src/inhibitors/blacklist/userGuildBlacklist.ts
index a2ac1aa..a661606 100644
--- a/src/inhibitors/blacklist/userGuildBlacklist.ts
+++ b/src/inhibitors/blacklist/userGuildBlacklist.ts
@@ -13,10 +13,14 @@ export default class UserGuildBlacklistInhibitor extends BushInhibitor {
public async exec(message: CommandMessage | SlashMessage): Promise<boolean> {
if (!message.author || !message.inGuild()) return false;
// do not change to message.author.isOwner()
- if (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user!.id === message.author.id)
+ if (
+ this.client.isOwner(message.author) ||
+ this.client.isSuperUser(message.author) ||
+ this.client.user!.id === message.author.id
+ )
return false;
if ((await message.guild.getSetting('blacklistedUsers'))?.includes(message.author.id)) {
- void client.console.verbose(
+ void this.client.console.verbose(
'userGuildBlacklist',
`Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`
);