Program Commit

This commit is contained in:
2025-10-02 17:31:49 -04:00
parent fd73be0efd
commit 1341b325ee
39 changed files with 21396 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
const fs = require('fs');
const path = require('path');
module.exports = (client) => {
const commandsPath = path.join(__dirname, '../commands');
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const filePath = path.join(commandsPath, file);
const command = require(filePath);
if (command.name) {
client.commands.set(command.name, command);
}
}
};

View File

@@ -0,0 +1,17 @@
const fs = require('fs');
const path = require('path');
module.exports = (client) => {
const eventsPath = path.join(__dirname, '../events');
const eventFiles = fs.readdirSync(eventsPath).filter(file => file.endsWith('.js'));
for (const file of eventFiles) {
const filePath = path.join(eventsPath, file);
const event = require(filePath);
if (event.once) {
client.once(event.name, (...args) => event.execute(...args, client));
} else {
client.on(event.name, (...args) => event.execute(...args, client));
}
}
};