Skip to content

Commit

Permalink
logger hata
Browse files Browse the repository at this point in the history
  • Loading branch information
Laxuzer committed Nov 24, 2021
1 parent 30fec6f commit 33e1cf4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/handlers/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ module.exports = class MainHandler {
async init() {
require('./manual/functionHandler')(this.client);
const handlers = await readdirSync('./src/handlers/auto');
this.client.logger.templates.Log('Handler', `Loading a total of ${handlers.length} handlers.`, { TitleColor: 'cyan' });
this.client.logger.log('Handler', `Loading a total of ${handlers.length} handlers.`, { TitleColor: 'cyan' });
for (const handler of handlers) {
const checkCommandLoaded = require.cache[require.resolve(`./auto/${handler}`)];
if (checkCommandLoaded?.loaded) delete require.cache[require.resolve(`./auto/${handler}`)];
const Event = require(`./auto/${handler}`);
const Handler = new Event(this.client);
if (!Handler.enabled) return;
Handler.run(this.client);
this.client.logger.templates.Log('Handler', `Loading Handler: ${Handler.name}. 👌`, { TitleColor: 'cyan' });
this.client.logger.log('Handler', `Loading Handler: ${Handler.name}. 👌`, { TitleColor: 'cyan' });
delete require.cache[require.resolve(`./auto/${handler}`)];
}
}
};
};

0 comments on commit 33e1cf4

Please sign in to comment.