Major updates to core

This commit is contained in:
Logan Cusano
2024-02-10 15:10:35 -05:00
parent d563021866
commit 9c46792959
22 changed files with 977 additions and 156 deletions

View File

@@ -1,19 +1,9 @@
import { nodeIo, app, server } from './modules/socketServer.mjs';
import { addEnabledCommands, addEnabledEventListeners } from './discordBot/modules/discordBotUtils.mjs'
import { serverClient } from './modules/discordBot.mjs';
import { serverClient, addEnabledEventListeners } from './discordBot/discordBot.mjs';
import dotenv from 'dotenv';
dotenv.config()
// Startup the node server
server.listen(3000, () => {
console.log('server running at http://localhost:3000');
});
// Config the discord bot with commands and events
await addEnabledEventListeners(serverClient, nodeIo);
await addEnabledCommands(serverClient, nodeIo);
// Startup the discord bot
console.log(`Logging into discord with ID: ${process.env.DISCORD_TOKEN}`);
serverClient.login(process.env.DISCORD_TOKEN);
// Add objects to the others
serverClient.nodeIo = nodeIo;
nodeIo.serverClient = serverClient;