JaBa/base/BaseCommand.js

23 lines
645 B
JavaScript
Raw Normal View History

/* eslint-disable no-unused-vars */
2024-12-05 19:16:01 +05:00
import { sep } from "path";
class BaseCommand {
constructor(options, client) {
/**
* @type {import("discord.js").SlashCommandBuilder | import("discord.js").ContextMenuCommandBuilder | import("discord.js").ApplicationCommandData}
*/
this.command = options.command;
/**
* @type {Boolean}
*/
this.ownerOnly = (options.ownerOnly === true ? true : false) || false;
this.dirname = options.dirname || false;
/**
* @type {String}
*/
2024-12-05 19:16:01 +05:00
this.category = this.dirname ? this.dirname.split(sep)[parseInt(this.dirname.split(sep).length - 1, 10)] : "Other";
}
}
2024-12-05 19:16:01 +05:00
export default BaseCommand;