diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-17 12:31:09 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-17 12:31:09 -0400 |
commit | d40527d0a2d9f209905750258f71bedff1cdf089 (patch) | |
tree | e017fd844c2135bfc85228d00ef2617d24ce0a3f /src/inhibitors/blacklist | |
parent | d431ad00754f3f250103deedea495b9bcee73fc0 (diff) | |
download | tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.tar.gz tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.tar.bz2 tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.zip |
turned on ts strict option
Diffstat (limited to 'src/inhibitors/blacklist')
-rw-r--r-- | src/inhibitors/blacklist/channelGlobalBlacklist.ts | 7 | ||||
-rw-r--r-- | src/inhibitors/blacklist/channelGuildBlacklist.ts | 5 | ||||
-rw-r--r-- | src/inhibitors/blacklist/guildBlacklist.ts | 3 | ||||
-rw-r--r-- | src/inhibitors/blacklist/userGlobalBlacklist.ts | 3 | ||||
-rw-r--r-- | src/inhibitors/blacklist/userGuildBlacklist.ts | 3 |
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; } } |