2022-07-25 22:09:02 +05:00
|
|
|
/* eslint-disable no-unused-vars */
|
2022-07-26 17:20:10 +05:00
|
|
|
const path = require("path");
|
|
|
|
|
2022-07-23 17:14:42 +05:00
|
|
|
class BaseCommand {
|
2022-07-25 22:09:02 +05:00
|
|
|
constructor(options, client) {
|
2022-07-23 17:14:42 +05:00
|
|
|
/**
|
2022-07-31 18:52:16 +05:00
|
|
|
* @type {import("discord.js").SlashCommandBuilder | import("discord.js").ContextMenuCommandBuilder | import("discord.js").ApplicationCommandData}
|
2022-07-23 17:14:42 +05:00
|
|
|
*/
|
|
|
|
this.command = options.command;
|
|
|
|
/**
|
|
|
|
* @type {Array<String>}
|
|
|
|
*/
|
2022-07-25 22:09:02 +05:00
|
|
|
this.aliases = options.aliases || [];
|
|
|
|
/**
|
|
|
|
* @type {Boolean}
|
|
|
|
*/
|
2022-10-09 18:16:10 +05:00
|
|
|
this.ownerOnly = (options.ownerOnly === true ? true : false) || false;
|
2022-07-26 17:20:10 +05:00
|
|
|
this.dirname = options.dirname || false;
|
|
|
|
/**
|
|
|
|
* @type {String}
|
|
|
|
*/
|
2023-07-05 00:58:06 +05:00
|
|
|
this.category = this.dirname ? this.dirname.split(path.sep)[parseInt(this.dirname.split(path.sep).length - 1, 10)] : "Other";
|
2022-07-23 17:14:42 +05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 00:58:06 +05:00
|
|
|
module.exports = BaseCommand;
|