From d1724227abfb8f0fcd9e573f7e9772cf0be8257a Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sat, 17 Jul 2021 10:25:46 -0400 Subject: honestly no idea what I did at this point --- src/inhibitors/blacklist/userGuildBlacklist.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/inhibitors/blacklist/userGuildBlacklist.ts (limited to 'src/inhibitors/blacklist/userGuildBlacklist.ts') diff --git a/src/inhibitors/blacklist/userGuildBlacklist.ts b/src/inhibitors/blacklist/userGuildBlacklist.ts new file mode 100644 index 0000000..02a3762 --- /dev/null +++ b/src/inhibitors/blacklist/userGuildBlacklist.ts @@ -0,0 +1,25 @@ +import { BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; + +export default class UserGuildBlacklistInhibitor extends BushInhibitor { + public constructor() { + super('userGuildBlacklist', { + reason: 'userGuildBlacklist', + category: 'blacklist', + type: 'all' + }); + } + + public async exec(message: BushMessage | BushSlashMessage): Promise { + if (!message.author || !message.guild) return false; + if ( + this.client.isOwner(message.author) || + this.client.isSuperUser(message.author) || + this.client.user.id === message.author.id + ) + return false; + if ((await message.guild.getSetting('blacklistedUsers'))?.includes(message.author.id)) { + this.client.console.debug(`userGuildBlacklist blocked message.`); + return true; + } + } +} -- cgit