Some of the handlers will be considered loaded when ignored.

This commit is contained in:
Kwafuri
2024-02-04 07:29:24 +00:00
parent 9273023d3a
commit 690d6ed86a
3 changed files with 3 additions and 0 deletions
+1
View File
@@ -6,6 +6,7 @@ table.setHeading('Buttons', 'Status').setBorder('|', '-', '+', '+');
module.exports.name = 'buttons'; module.exports.name = 'buttons';
module.exports = (client) => { module.exports = (client) => {
if (!fs.existsSync('./buttons/')) return;
fs.readdirSync('./buttons/').filter((file) => file.endsWith('.js')).forEach((file) => { fs.readdirSync('./buttons/').filter((file) => file.endsWith('.js')).forEach((file) => {
const button = require(`../buttons/${file}`); const button = require(`../buttons/${file}`);
client.buttons.set(button.id, button); client.buttons.set(button.id, button);
+1
View File
@@ -6,6 +6,7 @@ table.setHeading('Commands', 'Status').setBorder('|', '-', '+', '+');
module.exports.name = 'commands'; module.exports.name = 'commands';
module.exports = (client) => { module.exports = (client) => {
if (!fs.existsSync(`./commands`)) return;
fs.readdirSync('./commands/').forEach((dir) => { fs.readdirSync('./commands/').forEach((dir) => {
const files = fs.readdirSync(`./commands/${dir}`).filter((file) => file.endsWith('.js')); const files = fs.readdirSync(`./commands/${dir}`).filter((file) => file.endsWith('.js'));
if (files.length <= 0) return; if (files.length <= 0) return;
+1
View File
@@ -14,6 +14,7 @@ const clientId = process.env.CLIENTID;
const rest = new REST({ version: '9' }).setToken(token); const rest = new REST({ version: '9' }).setToken(token);
module.exports.name = 'slashCommands'; module.exports.name = 'slashCommands';
module.exports = async (client) => { module.exports = async (client) => {
if (!fs.existsSync(`./slashCommands`)) return;
const slashCommands = []; const slashCommands = [];
fs.readdirSync('./slashCommands/').forEach(async dir => { fs.readdirSync('./slashCommands/').forEach(async dir => {