2021-03-31 02:56:25 +00:00
|
|
|
// Bootstrapping Section //
|
2021-03-30 08:58:21 +00:00
|
|
|
import "./globals";
|
2021-03-31 02:19:04 +00:00
|
|
|
import {Client} from "discord.js";
|
2020-12-15 01:44:28 +00:00
|
|
|
import setup from "./setup";
|
|
|
|
import {Config} from "./core/structures";
|
2021-01-29 19:14:31 +00:00
|
|
|
|
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.
|
2021-03-31 02:19:04 +00:00
|
|
|
export const client = new Client();
|
2020-10-20 19:10:03 +00:00
|
|
|
|
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";
|