aboutsummaryrefslogtreecommitdiff
path: root/src/inhibitors/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/inhibitors/commands')
-rw-r--r--src/inhibitors/commands/disabledCommand.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/inhibitors/commands/disabledCommand.ts b/src/inhibitors/commands/disabledCommand.ts
new file mode 100644
index 0000000..8538858
--- /dev/null
+++ b/src/inhibitors/commands/disabledCommand.ts
@@ -0,0 +1,19 @@
+import { BushCommand } from '../../lib/extensions/BushCommand';
+import { BushInhibitor } from '../../lib/extensions/BushInhibitor';
+import { BushSlashMessage } from '../../lib/extensions/BushInteractionMessage';
+import { BushMessage } from '../../lib/extensions/BushMessage';
+
+export default class DisabledCommandInhibitor extends BushInhibitor {
+ constructor() {
+ super('disabledCommand', {
+ reason: 'disabled',
+ type: 'pre',
+ priority: 3
+ });
+ }
+
+ public async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
+ if (this.client.isOwner(message.author)) return false;
+ return this.client.cache.global.disabledCommands.includes(command?.id);
+ }
+}