aboutsummaryrefslogtreecommitdiff
path: root/src/inhibitors/commands/disabledCommand.ts
blob: caf7bf716348c11b12efe8e03ac0d145f1e0ea64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { BushCommand } from '../../lib/extensions/BushCommand';
import { BushInhibitor } from '../../lib/extensions/BushInhibitor';
import { BushMessage } from '../../lib/extensions/BushMessage';
import { BushSlashMessage } from '../../lib/extensions/BushSlashMessage';

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);
	}
}