Files
xiao/structures/Command.js
T
Daniel Odendahl Jr 5932e647b0 Command Leaderboard
2017-09-25 11:06:44 +00:00

26 lines
602 B
JavaScript

const { Command } = require('discord.js-commando');
class XiaoCommand extends Command {
constructor(client, info) {
super(client, info);
this.ownerOnly = info.ownerOnly;
this.throttling = info.throttling || {
usages: 1,
duration: 2
};
this.uses = 0;
}
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.`;
}
return true;
}
}
module.exports = XiaoCommand;