Files
xiao/structures/Command.js
T
Dragon Fire 2677101c0d Fix
2021-05-18 21:47:22 -04:00

33 lines
1022 B
JavaScript

const { Command } = require('discord.js-commando');
const { stripIndents } = require('common-tags');
module.exports = class XiaoCommand extends Command {
constructor(client, info) {
if (!info.argsPromptLimit) info.argsPromptLimit = 2;
super(client, info);
this.patronOnly = info.patronOnly || false;
this.argsSingleQuotes = info.argsSingleQuotes || false;
this.throttling = info.unknown ? null : info.throttling || { usages: 2, duration: 5 };
this.uses = 0;
this.lastRun = null;
this.credit = info.credit || [];
this.credit.push({
name: 'Dragon Fire',
url: 'https://github.com/dragonfire535',
reason: 'Code'
});
}
hasPermission(msg, ownerOverride) {
if (this.client.isOwner(msg.author)) return true;
if (this.patronOnly && !this.client.patreon.isPatron(msg.author.id)) {
return stripIndents`
The \`${this.name}\` command can only be used by Patrons.
Visit <https://www.patreon.com/xiaodiscord> to sign-up!
`;
}
return super.hasPermission(msg, ownerOverride);
}
};