aboutsummaryrefslogtreecommitdiff
path: root/src/inhibitors/blacklist
diff options
context:
space:
mode:
Diffstat (limited to 'src/inhibitors/blacklist')
-rw-r--r--src/inhibitors/blacklist/channelGlobalBlacklist.ts7
-rw-r--r--src/inhibitors/blacklist/channelGuildBlacklist.ts5
-rw-r--r--src/inhibitors/blacklist/guildBlacklist.ts3
-rw-r--r--src/inhibitors/blacklist/userGlobalBlacklist.ts3
-rw-r--r--src/inhibitors/blacklist/userGuildBlacklist.ts3
5 files changed, 13 insertions, 8 deletions
diff --git a/src/inhibitors/blacklist/channelGlobalBlacklist.ts b/src/inhibitors/blacklist/channelGlobalBlacklist.ts
index 7a1d27d..9bbf30f 100644
--- a/src/inhibitors/blacklist/channelGlobalBlacklist.ts
+++ b/src/inhibitors/blacklist/channelGlobalBlacklist.ts
@@ -10,12 +10,13 @@ export default class UserGlobalBlacklistInhibitor extends BushInhibitor {
}
public override exec(message: BushMessage | BushSlashMessage): boolean {
- if (!message.author) return false;
- if (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user.id === message.author.id)
+ if (!message.author || !message.guild) return false;
+ if (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user!.id === message.author.id)
return false;
- if (client.cache.global.blacklistedChannels.includes(message.channel.id)) {
+ if (client.cache.global.blacklistedChannels.includes(message.channel!.id)) {
// client.console.debug(`channelGlobalBlacklist blocked message.`);
return true;
}
+ return false;
}
}
diff --git a/src/inhibitors/blacklist/channelGuildBlacklist.ts b/src/inhibitors/blacklist/channelGuildBlacklist.ts
index be338fe..b4c6f3f 100644
--- a/src/inhibitors/blacklist/channelGuildBlacklist.ts
+++ b/src/inhibitors/blacklist/channelGuildBlacklist.ts
@@ -11,11 +11,12 @@ export default class ChannelGuildBlacklistInhibitor extends BushInhibitor {
public override async exec(message: BushMessage | BushSlashMessage): Promise<boolean> {
if (!message.author || !message.guild) return false;
- if (client.isOwner(message.author) || client.isSuperUser(message.author) || 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)) {
+ if ((await message.guild.getSetting('blacklistedChannels'))?.includes(message.channel!.id)) {
// client.console.debug(`channelGuildBlacklist blocked message.`);
return true;
}
+ return false;
}
}
diff --git a/src/inhibitors/blacklist/guildBlacklist.ts b/src/inhibitors/blacklist/guildBlacklist.ts
index afaae9d..de15d76 100644
--- a/src/inhibitors/blacklist/guildBlacklist.ts
+++ b/src/inhibitors/blacklist/guildBlacklist.ts
@@ -13,12 +13,13 @@ export default class GuildBlacklistInhibitor extends BushInhibitor {
if (!message.guild) return false;
if (
message.author &&
- (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user.id === message.author.id)
+ (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user!.id === message.author.id)
)
return false;
if (client.cache.global.blacklistedGuilds.includes(message.guild.id)) {
// client.console.debug(`GuildBlacklistInhibitor blocked message.`);
return true;
}
+ return false;
}
}
diff --git a/src/inhibitors/blacklist/userGlobalBlacklist.ts b/src/inhibitors/blacklist/userGlobalBlacklist.ts
index 1173d87..967943d 100644
--- a/src/inhibitors/blacklist/userGlobalBlacklist.ts
+++ b/src/inhibitors/blacklist/userGlobalBlacklist.ts
@@ -11,11 +11,12 @@ export default class UserGlobalBlacklistInhibitor extends BushInhibitor {
public override exec(message: BushMessage | BushSlashMessage): boolean {
if (!message.author) return false;
- if (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user.id === message.author.id)
+ if (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user!.id === message.author.id)
return false;
if (client.cache.global.blacklistedUsers.includes(message.author.id)) {
// client.console.debug(`userGlobalBlacklist blocked message.`);
return true;
}
+ return false;
}
}
diff --git a/src/inhibitors/blacklist/userGuildBlacklist.ts b/src/inhibitors/blacklist/userGuildBlacklist.ts
index 95ba17a..0e28ba4 100644
--- a/src/inhibitors/blacklist/userGuildBlacklist.ts
+++ b/src/inhibitors/blacklist/userGuildBlacklist.ts
@@ -11,11 +11,12 @@ export default class UserGuildBlacklistInhibitor extends BushInhibitor {
public override async exec(message: BushMessage | BushSlashMessage): Promise<boolean> {
if (!message.author || !message.guild) return false;
- if (client.isOwner(message.author) || client.isSuperUser(message.author) || 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)) {
// client.console.debug(`userGuildBlacklist blocked message.`);
return true;
}
+ return false;
}
}