diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-30 16:48:07 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-30 16:48:07 -0400 |
commit | 42d2e2bf01b5debd4ecf605297f925ad5da7deb3 (patch) | |
tree | daf6678542cd8735f9930086f7a1e76ae6884e4e /src/inhibitors/blacklist | |
parent | 4ad90b19851a0853287c45d326a28be535b1607f (diff) | |
download | tanzanite-42d2e2bf01b5debd4ecf605297f925ad5da7deb3.tar.gz tanzanite-42d2e2bf01b5debd4ecf605297f925ad5da7deb3.tar.bz2 tanzanite-42d2e2bf01b5debd4ecf605297f925ad5da7deb3.zip |
I did this 2 weeks ago idk what I did
Diffstat (limited to 'src/inhibitors/blacklist')
-rw-r--r-- | src/inhibitors/blacklist/channelGlobalBlacklist.ts | 6 | ||||
-rw-r--r-- | src/inhibitors/blacklist/channelGuildBlacklist.ts | 16 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/inhibitors/blacklist/channelGlobalBlacklist.ts b/src/inhibitors/blacklist/channelGlobalBlacklist.ts index d870307..2725431 100644 --- a/src/inhibitors/blacklist/channelGlobalBlacklist.ts +++ b/src/inhibitors/blacklist/channelGlobalBlacklist.ts @@ -1,4 +1,4 @@ -import { BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; export default class UserGlobalBlacklistInhibitor extends BushInhibitor { public constructor() { @@ -10,11 +10,11 @@ export default class UserGlobalBlacklistInhibitor extends BushInhibitor { }); } - public override exec(message: BushMessage | BushSlashMessage): boolean { + public override exec(message: BushMessage | BushSlashMessage, command: BushCommand): boolean { 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) && !command.bypassChannelBlacklist) { return true; } return false; diff --git a/src/inhibitors/blacklist/channelGuildBlacklist.ts b/src/inhibitors/blacklist/channelGuildBlacklist.ts index d02408c..63334c4 100644 --- a/src/inhibitors/blacklist/channelGuildBlacklist.ts +++ b/src/inhibitors/blacklist/channelGuildBlacklist.ts @@ -1,4 +1,4 @@ -import { BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; +import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; export default class ChannelGuildBlacklistInhibitor extends BushInhibitor { public constructor() { @@ -10,12 +10,20 @@ export default class ChannelGuildBlacklistInhibitor extends BushInhibitor { }); } - public override async exec(message: BushMessage | BushSlashMessage): Promise<boolean> { + public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> { 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 ((await message.guild.getSetting('bypassChannelBlacklist'))?.includes(message.author.id)) return false; - if ((await message.guild.getSetting('blacklistedChannels'))?.includes(message.channel!.id)) { + if ( + (await message.guild.getSetting('bypassChannelBlacklist'))?.includes(message.author.id) && + !command.bypassChannelBlacklist + ) { + return false; + } + if ( + (await message.guild.getSetting('blacklistedChannels'))?.includes(message.channel!.id) && + !command.bypassChannelBlacklist + ) { return true; } return false; |