Files
xiao/structures/commands/AutoReply.js
T
2020-06-11 22:29:36 -04:00

20 lines
542 B
JavaScript

const Command = require('../Command');
module.exports = class AutoReplyCommand extends Command {
constructor(client, info) {
super(client, info);
this.reply = info.reply || false;
this.throttling = null;
}
run(msg, args, fromPattern) {
if (msg.guild && !msg.channel.permissionsFor(this.client.user).has('SEND_MESSAGES')) return null;
return this.reply ? msg.reply(this.generateText(fromPattern)) : msg.say(this.generateText(fromPattern));
}
generateText() {
throw new Error('The generateText method is required.');
}
};