Files
xiao/structures/commands/AutoReply.js
T
2024-04-07 19:06:19 -04:00

23 lines
618 B
JavaScript

const Command = require('../../framework/Command');
const { PermissionFlagsBits } = require('discord.js');
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(PermissionFlagsBits.SendMessages)) 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.');
}
};