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/commands/globalDisabledCommand.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/inhibitors/commands/globalDisabledCommand.ts (limited to 'src/inhibitors/commands/globalDisabledCommand.ts') diff --git a/src/inhibitors/commands/globalDisabledCommand.ts b/src/inhibitors/commands/globalDisabledCommand.ts new file mode 100644 index 0000000..3ce39c2 --- /dev/null +++ b/src/inhibitors/commands/globalDisabledCommand.ts @@ -0,0 +1,19 @@ +import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; + +export default class DisabledGuildCommandInhibitor extends BushInhibitor { + public constructor() { + super('disabledGlobalCommand', { + reason: 'disabledGlobal', + type: 'pre', + priority: 4 + }); + } + + public async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise { + if (message.author.isOwner()) return false; + if (this.client.cache.global.disabledCommands?.includes(command?.id)) { + this.client.console.debug(`disabledGlobalCommand blocked message.`); + return true; + } + } +} -- cgit