TravBot-v3/src/index.ts

26 lines
984 B
TypeScript
Raw Normal View History

2021-03-31 02:56:25 +00:00
// Bootstrapping Section //
2021-03-31 07:00:03 +00:00
import "./modules/globals";
import {Client} from "discord.js";
2021-03-31 07:00:03 +00:00
import setup from "./modules/setup";
import {Config} from "./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 "./core/eventListeners";
import "./modules/ready";
2021-03-31 07:00:03 +00:00
import "./modules/presence";
2021-03-31 02:56:25 +00:00
import "./modules/lavalink";
import "./modules/emoteRegistry";
import "./modules/channelListener";
import "./modules/intercept";
import "./modules/messageEmbed";