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

export default class UserBlacklistInhibitor extends BushInhibitor {
	constructor() {
		super('userBlacklist', {
			reason: 'userBlacklist',
			category: 'blacklist',
			type: 'all'
		});
	}

	public exec(message: BushMessage | BushSlashMessage): boolean {
		if (!message.author) return false;
		if (this.client.isOwner(message.author) || this.client.isSuperUser(message.author)) return false;
		return this.client.cache.global.blacklistedUsers.includes(message.author.id);
	}
}