mirror of
https://github.com/DarthKilroy/Spot.git
synced 2025-12-23 12:16:48 +00:00
Remove unused code, clean up folder tree
This commit is contained in:
parent
a4892d854b
commit
1e8c1261f5
14 changed files with 38 additions and 80 deletions
8
bot.js
8
bot.js
|
|
@ -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}`)();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue