blob: 51e1fe34d3fb58b27474133633defabe1c8cd614 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import { Inhibitor } from 'discord-akairo';
import { Message, TextChannel } from 'discord.js';
export default class SendMessagesInhibtor extends Inhibitor {
public constructor() {
super('sendMessages', {
reason: 'sendMessages',
});
}
// @ts-ignore
public exec(msg: Message): boolean {
if (!msg.guild) return false;
if (msg.channel instanceof TextChannel) {
return !msg.channel.permissionsFor(this.client.user!)!.has('SEND_MESSAGES');
}
}
}
|