feature/implement-bot-into-client-core #2
@@ -125,8 +125,9 @@ discordClient.on('ready', () => {
|
|||||||
|
|
||||||
// Setup any additional event handlers
|
// Setup any additional event handlers
|
||||||
const eventsPath = path.join(__dirname, 'events');
|
const eventsPath = path.join(__dirname, 'events');
|
||||||
|
if (fs.existsSync(eventsPath)) {
|
||||||
const eventFiles = fs.readdirSync(eventsPath).filter(file => file.endsWith('.js'));
|
const eventFiles = fs.readdirSync(eventsPath).filter(file => file.endsWith('.js'));
|
||||||
|
if (eventFiles.length > 0) {
|
||||||
for (const file of eventFiles) {
|
for (const file of eventFiles) {
|
||||||
const filePath = path.join(eventsPath, file);
|
const filePath = path.join(eventsPath, file);
|
||||||
const event = require(filePath);
|
const event = require(filePath);
|
||||||
@@ -136,5 +137,7 @@ for (const file of eventFiles) {
|
|||||||
discordClient.on(event.name, (...args) => event.execute(...args));
|
discordClient.on(event.name, (...args) => event.execute(...args));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
discordClient.login(discordToken); //Load Client Discord Token
|
discordClient.login(discordToken); //Load Client Discord Token
|
||||||
Reference in New Issue
Block a user