Compare commits

..

No commits in common. "ea193cedddc0345deb0c001e71fa649addac397a" and "1ac5c20aea19222632f747b3b47711479faacde3" have entirely different histories.

3 changed files with 4 additions and 22 deletions

View file

@ -9,7 +9,7 @@
},
"rules": {
"arrow-spacing": ["warn", { "before": true, "after": true }],
"brace-style": ["error", { "allowSingleLine": true }],
"brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": "error",
"comma-style": "error",

View file

@ -1,7 +0,0 @@
module.exports = {
name: 'ready',
once: true,
execute() {
console.log('Prêt !');
},
};

View file

@ -1,21 +1,10 @@
const fs = require('node:fs');
const path = require('node:path');
const { Client, Intents } = require('discord.js');
const { token } = require('../config/config.json');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
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));
} else {
client.on(event.name, (...args) => event.execute(...args));
}
}
client.once('ready', () => {
console.log('Prêt !');
});
client.login(token);