You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Haha-Yes/event/inhibitors/commandBlock.js

21 lines
809 B
JavaScript

const { Inhibitor } = require('discord-akairo');
const commandblock = require('../../models').commandBlock;
const commandblockuser = require('../../models').commandblockuser;
class commandblockInhibitor extends Inhibitor {
constructor() {
super('commandblock', {
reason: 'commandblock'
});
}
async exec(message, command) {
if (message.channel.type == 'dm' || message.author.id == this.client.ownerID || message.member.hasPermission('ADMINISTRATOR')) return false;
const blacklist = await commandblock.findOne({where: {serverID:message.guild.id, command: command.id}});
const blocked = await commandblockuser.findOne({where: {serverID: message.guild.id, userID: message.author.id, command: command.id}});
if (blacklist || blocked) return true;
}
}
module.exports = commandblockInhibitor;