This commit is contained in:
Emily 2020-03-31 22:43:58 +11:00
parent 4a36da8d27
commit 0f2f8b0318

View file

@ -61,11 +61,14 @@ client.aliases = new Discord.Collection()
// Initialization function // Initialization function
const init = async () => { const init = async () => {
// Load modules
// Load events // Load events
fs.readdir('./events', (err, files) => { fs.readdir('./events', (err, files) => {
if (err) {} if (err) {
client.logger.error('Failed to get files in events directory! ' + err);
return;
};
client.logger.info(`Loading ${files.length} events.`) client.logger.info(`Loading ${files.length} events.`)
files.forEach(file => { files.forEach(file => {
if (!file.endsWith('.js')) { if (!file.endsWith('.js')) {
@ -78,7 +81,12 @@ const init = async () => {
// Load commands // Load commands
fs.readdir('./commands', (err, files) => { fs.readdir('./commands', (err, files) => {
if (err) {} if (err) {
client.logger.error('Failed to get files in commands directory! ' + err);
return;
};
client.logger.info(`Loading ${files.length} commands.`) client.logger.info(`Loading ${files.length} commands.`)
files.forEach(file => { files.forEach(file => {
if (!file.endsWith('.js')) { if (!file.endsWith('.js')) {