TravBot-v3/src/index.ts

21 lines
823 B
TypeScript
Raw Normal View History

2021-03-31 02:56:25 +00:00
// Bootstrapping Section //
import "./globals";
import {Client} from "discord.js";
2020-12-15 01:44:28 +00:00
import setup from "./setup";
import {Config} from "./core/structures";
2020-07-25 11:01:24 +00:00
// This is here in order to make it much less of a headache to access the client from other files.
// This of course won't actually do anything until the setup process is complete and it logs in.
export const client = new Client();
2021-03-31 02:56:25 +00:00
// Send the login request to Discord's API and then load modules while waiting for it.
2020-07-25 11:01:24 +00:00
setup.init().then(() => {
2020-12-15 01:44:28 +00:00
client.login(Config.token).catch(setup.again);
2020-10-15 09:23:24 +00:00
});
2021-03-31 02:56:25 +00:00
// Initialize Modules //
import "./core/handler"; // Command loading will start as soon as an instance of "core/command" is loaded, which is loaded in "core/handler".
import "./modules/lavalink";
import "./modules/emoteRegistry";
import "./modules/channelListener";