mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
22 lines
533 B
JavaScript
22 lines
533 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) {
|
|
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.');
|
|
}
|
|
};
|