aboutsummaryrefslogtreecommitdiff
path: root/src/inhibitors/blacklist/channelGlobalBlacklist.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-17 12:31:09 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-17 12:31:09 -0400
commitd40527d0a2d9f209905750258f71bedff1cdf089 (patch)
treee017fd844c2135bfc85228d00ef2617d24ce0a3f /src/inhibitors/blacklist/channelGlobalBlacklist.ts
parentd431ad00754f3f250103deedea495b9bcee73fc0 (diff)
downloadtanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.tar.gz
tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.tar.bz2
tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.zip
turned on ts strict option
Diffstat (limited to 'src/inhibitors/blacklist/channelGlobalBlacklist.ts')
-rw-r--r--src/inhibitors/blacklist/channelGlobalBlacklist.ts7
1 files changed, 4 insertions, 3 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;
}
}