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 | |
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')
-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 | ||||
-rw-r--r-- | src/inhibitors/commands/globalDisabledCommand.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/commands/guildDisabledCommand.ts | 3 | ||||
-rw-r--r-- | src/inhibitors/noCache.ts | 2 |
8 files changed, 17 insertions, 10 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; } } diff --git a/src/inhibitors/commands/globalDisabledCommand.ts b/src/inhibitors/commands/globalDisabledCommand.ts index 4c85c3b..9a750cc 100644 --- a/src/inhibitors/commands/globalDisabledCommand.ts +++ b/src/inhibitors/commands/globalDisabledCommand.ts @@ -15,5 +15,6 @@ export default class DisabledGuildCommandInhibitor extends BushInhibitor { client.console.debug(`disabledGlobalCommand blocked message.`); return true; } + return false; } } diff --git a/src/inhibitors/commands/guildDisabledCommand.ts b/src/inhibitors/commands/guildDisabledCommand.ts index b21e1ef..ee798e5 100644 --- a/src/inhibitors/commands/guildDisabledCommand.ts +++ b/src/inhibitors/commands/guildDisabledCommand.ts @@ -10,12 +10,13 @@ export default class DisabledGuildCommandInhibitor extends BushInhibitor { } public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> { - if (!message.guild || !message.guild) return; + if (!message.guild || !message.guild) return false; if (message.author.isOwner() || message.author.isSuperUser()) return false; // super users bypass guild disabled commands if ((await message.guild.getSetting('disabledCommands'))?.includes(command?.id)) { client.console.debug(`disabledGuildCommand blocked message.`); return true; } + return false; } } diff --git a/src/inhibitors/noCache.ts b/src/inhibitors/noCache.ts index 6bb2001..673f3ac 100644 --- a/src/inhibitors/noCache.ts +++ b/src/inhibitors/noCache.ts @@ -12,7 +12,7 @@ export default class NoCacheInhibitor extends BushInhibitor { public override async exec(message: BushMessage | BushSlashMessage): Promise<boolean> { if (client.isOwner(message.author)) return false; for (const property in client.cache.global) { - if (!client.cache.global[property]) { + if (!client.cache.global[property as keyof typeof client.cache.global]) { client.console.debug(`NoCacheInhibitor blocked message.`); return true; } |