From d40527d0a2d9f209905750258f71bedff1cdf089 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Tue, 17 Aug 2021 12:31:09 -0400 Subject: turned on ts strict option --- src/inhibitors/blacklist/channelGlobalBlacklist.ts | 7 ++++--- src/inhibitors/blacklist/channelGuildBlacklist.ts | 5 +++-- src/inhibitors/blacklist/guildBlacklist.ts | 3 ++- src/inhibitors/blacklist/userGlobalBlacklist.ts | 3 ++- src/inhibitors/blacklist/userGuildBlacklist.ts | 3 ++- 5 files changed, 13 insertions(+), 8 deletions(-) (limited to 'src/inhibitors/blacklist') 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 { 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 { 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; } } -- cgit