Files
xiao/structures/commands/AutoReply.js
T
Dragon Fire b202e2ea6c Fix
2021-06-05 12:55:12 -04:00

22 lines
546 B
JavaScript

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