chore: 🎉 initial commit

This commit is contained in:
UltraLionFr
2025-08-26 01:01:34 +02:00
parent bf6d61e5a3
commit 30cfbd73fc
27 changed files with 1341 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
const fs = require("fs");
const path = require("path");
function loadEvents(client) {
const eventsPath = path.join(__dirname, "../events");
function walk(dir) {
const files = fs.readdirSync(dir, { withFileTypes: true });
for (const file of files) {
const filePath = path.join(dir, file.name);
if (file.isDirectory()) {
walk(filePath);
} else if (file.name.endsWith(".js")) {
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));
}
}
}
}
walk(eventsPath);
}
module.exports = { loadEvents };