From 5f3a7dfbedee3dd4ec7a91bf7beb593687fdc021 Mon Sep 17 00:00:00 2001 From: Owen Duckham <64110067+IRONM00N@users.noreply.github.com> Date: Mon, 28 Feb 2022 07:48:59 -0500 Subject: fix: revert to client.isOwner --- src/inhibitors/blacklist/channelGlobalBlacklist.ts | 5 +++-- src/inhibitors/blacklist/channelGuildBlacklist.ts | 5 +++-- src/inhibitors/blacklist/guildBlacklist.ts | 6 ++++-- src/inhibitors/blacklist/userGlobalBlacklist.ts | 3 ++- src/inhibitors/blacklist/userGuildBlacklist.ts | 6 ++++-- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/inhibitors/blacklist/channelGlobalBlacklist.ts b/src/inhibitors/blacklist/channelGlobalBlacklist.ts index 9023dc2..34c23af 100644 --- a/src/inhibitors/blacklist/channelGlobalBlacklist.ts +++ b/src/inhibitors/blacklist/channelGlobalBlacklist.ts @@ -11,8 +11,9 @@ export default class UserGlobalBlacklistInhibitor extends BushInhibitor { } public override exec(message: BushMessage | BushSlashMessage, command: BushCommand): boolean { - if (!message.inGuild()) return false; - if (message.author.isOwner() || client.user!.id === message.author.id) return false; + if (!message.author || !message.inGuild()) return false; + // do not change to message.author.isOwner() + if (client.isOwner(message.author) || 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 aa5b2d9..09f58d0 100644 --- a/src/inhibitors/blacklist/channelGuildBlacklist.ts +++ b/src/inhibitors/blacklist/channelGuildBlacklist.ts @@ -11,8 +11,9 @@ export default class ChannelGuildBlacklistInhibitor extends BushInhibitor { } public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise { - if (!message.inGuild()) return false; - if (message.author.isOwner() || client.user!.id === message.author.id) return false; + if (!message.author || !message.inGuild()) return false; + // do not change to message.author.isOwner() + if (client.isOwner(message.author) || 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 9949c22..d540af7 100644 --- a/src/inhibitors/blacklist/guildBlacklist.ts +++ b/src/inhibitors/blacklist/guildBlacklist.ts @@ -11,8 +11,10 @@ export default class GuildBlacklistInhibitor extends BushInhibitor { } public override exec(message: BushMessage | BushSlashMessage): boolean { - if (!message.inGuild()) return false; - if (message.author.isOwner() || message.author.isSuperUser() || client.user!.id === message.author.id) return false; + if (!message.author || !message.inGuild()) return false; + // do not change to message.author.isOwner() + if (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)) { void client.console.verbose( 'guildBlacklist', diff --git a/src/inhibitors/blacklist/userGlobalBlacklist.ts b/src/inhibitors/blacklist/userGlobalBlacklist.ts index d0f9a9f..a3b0cdc 100644 --- a/src/inhibitors/blacklist/userGlobalBlacklist.ts +++ b/src/inhibitors/blacklist/userGlobalBlacklist.ts @@ -12,7 +12,8 @@ export default class UserGlobalBlacklistInhibitor extends BushInhibitor { public override exec(message: BushMessage | BushSlashMessage): boolean { if (!message.author) return false; - if (message.author.isOwner() || client.user!.id === message.author.id) return false; + // do not change to message.author.isOwner() + if (client.isOwner(message.author) || 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 61f670e..b6c707a 100644 --- a/src/inhibitors/blacklist/userGuildBlacklist.ts +++ b/src/inhibitors/blacklist/userGuildBlacklist.ts @@ -11,8 +11,10 @@ export default class UserGuildBlacklistInhibitor extends BushInhibitor { } public override async exec(message: BushMessage | BushSlashMessage): Promise { - if (!message.inGuild()) return false; - if (message.author.isOwner() || message.author.isSuperUser() || client.user!.id === message.author.id) return false; + if (!message.author || !message.inGuild()) return false; + // do not change to message.author.isOwner() + 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)) { void client.console.verbose( 'userGuildBlacklist', -- cgit