aboutsummaryrefslogtreecommitdiff
path: root/src/inhibitors/blacklist/guildBlacklist.ts
blob: 4c541e84d6f4f6503a18e1e203c3cffb0f4aad48 (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 GuildBlacklistInhibitor extends BushInhibitor {
	constructor() {
		super('guildBlacklist', {
			reason: 'guildBlacklist',
			category: 'blacklist',
			type: 'all'
		});
	}

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