Remove extended Command class

This commit is contained in:
Daniel Odendahl Jr
2017-09-29 00:49:17 +00:00
parent 9fb95df18a
commit 38a1e11b02
201 changed files with 208 additions and 228 deletions
-26
View File
@@ -1,26 +0,0 @@
const { Command } = require('discord.js-commando');
class XiaoCommand extends Command {
constructor(client, info) {
super(client, info);
this.ownerOnly = !!info.ownerOnly;
this.nsfw = !!info.nsfw;
this.throttling = info.throttling || {
usages: 1,
duration: 2
};
}
hasPermission(msg) {
const baseCheck = super.hasPermission(msg);
if (!baseCheck || typeof baseCheck === 'string') return baseCheck;
if (this.ownerOnly && !this.client.isOwner(msg.author)) {
return `The \`${this.name}\` command can only be used by the bot owner.`;
}
if (this.nsfw && !msg.channel.nsfw) return `The \`${this.name}\` command can only be used in NSFW channels.`;
return true;
}
}
module.exports = XiaoCommand;