diff options
Diffstat (limited to 'src/inhibitors/blacklist')
-rw-r--r-- | src/inhibitors/blacklist/channelGlobalBlacklist.ts | 5 | ||||
-rw-r--r-- | src/inhibitors/blacklist/channelGuildBlacklist.ts | 5 | ||||
-rw-r--r-- | src/inhibitors/blacklist/guildBlacklist.ts | 8 | ||||
-rw-r--r-- | src/inhibitors/blacklist/userGlobalBlacklist.ts | 2 | ||||
-rw-r--r-- | src/inhibitors/blacklist/userGuildBlacklist.ts | 5 |
5 files changed, 9 insertions, 16 deletions
diff --git a/src/inhibitors/blacklist/channelGlobalBlacklist.ts b/src/inhibitors/blacklist/channelGlobalBlacklist.ts index b9d7240..9023dc2 100644 --- a/src/inhibitors/blacklist/channelGlobalBlacklist.ts +++ b/src/inhibitors/blacklist/channelGlobalBlacklist.ts @@ -11,9 +11,8 @@ export default class UserGlobalBlacklistInhibitor extends BushInhibitor { } 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 (!message.inGuild()) return false; + if (message.author.isOwner() || client.user!.id === message.author.id) return false; if (client.cache.global.blacklistedChannels.includes(message.channel!.id) && !command.bypassChannelBlacklist) { void client.console.verbose( 'channelGlobalBlacklist', diff --git a/src/inhibitors/blacklist/channelGuildBlacklist.ts b/src/inhibitors/blacklist/channelGuildBlacklist.ts index e881ebb..aa5b2d9 100644 --- a/src/inhibitors/blacklist/channelGuildBlacklist.ts +++ b/src/inhibitors/blacklist/channelGuildBlacklist.ts @@ -11,9 +11,8 @@ export default class ChannelGuildBlacklistInhibitor extends BushInhibitor { } 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 (!message.inGuild()) return false; + if (message.author.isOwner() || client.user!.id === message.author.id) return false; if ( (await message.guild.getSetting('bypassChannelBlacklist'))?.includes(message.author.id) && !command.bypassChannelBlacklist diff --git a/src/inhibitors/blacklist/guildBlacklist.ts b/src/inhibitors/blacklist/guildBlacklist.ts index b319475..9949c22 100644 --- a/src/inhibitors/blacklist/guildBlacklist.ts +++ b/src/inhibitors/blacklist/guildBlacklist.ts @@ -11,12 +11,8 @@ export default class GuildBlacklistInhibitor extends BushInhibitor { } public override exec(message: BushMessage | BushSlashMessage): boolean { - if (!message.guild) return false; - if ( - message.author && - (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user!.id === message.author.id) - ) - return false; + if (!message.inGuild()) return false; + if (message.author.isOwner() || message.author.isSuperUser() || client.user!.id === message.author.id) return false; if (client.cache.global.blacklistedGuilds.includes(message.guild.id)) { void client.console.verbose( 'guildBlacklist', diff --git a/src/inhibitors/blacklist/userGlobalBlacklist.ts b/src/inhibitors/blacklist/userGlobalBlacklist.ts index ad906f8..d0f9a9f 100644 --- a/src/inhibitors/blacklist/userGlobalBlacklist.ts +++ b/src/inhibitors/blacklist/userGlobalBlacklist.ts @@ -12,7 +12,7 @@ export default class UserGlobalBlacklistInhibitor extends BushInhibitor { public override exec(message: BushMessage | BushSlashMessage): boolean { if (!message.author) return false; - if (client.isOwner(message.author) || client.user!.id === message.author.id) return false; + if (message.author.isOwner() || client.user!.id === message.author.id) return false; if (client.cache.global.blacklistedUsers.includes(message.author.id)) { void client.console.verbose( 'userGlobalBlacklist', diff --git a/src/inhibitors/blacklist/userGuildBlacklist.ts b/src/inhibitors/blacklist/userGuildBlacklist.ts index a87e47c..61f670e 100644 --- a/src/inhibitors/blacklist/userGuildBlacklist.ts +++ b/src/inhibitors/blacklist/userGuildBlacklist.ts @@ -11,9 +11,8 @@ 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) - return false; + if (!message.inGuild()) return false; + if (message.author.isOwner() || message.author.isSuperUser() || client.user!.id === message.author.id) return false; if ((await message.guild.getSetting('blacklistedUsers'))?.includes(message.author.id)) { void client.console.verbose( 'userGuildBlacklist', |