Remove unused code, clean up folder tree

This commit is contained in:
spiral 2021-07-16 21:10:49 -04:00
parent a4892d854b
commit 1e8c1261f5
No known key found for this signature in database
GPG key ID: A6059F0CA0E1BD31
14 changed files with 38 additions and 80 deletions

8
bot.js
View file

@ -74,20 +74,20 @@ const botProcess = () => {
Command.init();
const help = require("./model/command/help");
const help = require("./command/help");
bot.ws.on('INTERACTION_CREATE', help.interactionHandler);
bot.on('ready', () => {
fs.readdirSync('./event/bot/')
fs.readdirSync('./event/')
.filter(filename => filename.endsWith('.js'))
.map(filename => filename.substr(0, filename.length - 3))
.forEach(filename => {
const event = filename.replace(/([_-][a-z])/gu, character => `${character.substr(1).toUpperCase()}`);
if (filename !== 'ready') {
bot.on(event, require(`./event/bot/${filename}`));
bot.on(event, require(`./event/${filename}`));
} else {
require(`./event/bot/${filename}`)();
require(`./event/${filename}`)();
}
});
});