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";
|
|
|
|
import {loadEvents} from "./core/event";
|
2021-03-31 02:19:04 +00:00
|
|
|
import {attachToClient} from "./modules/lavalink";
|
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();
|
|
|
|
attachToClient(client);
|
2020-10-20 19:10:03 +00:00
|
|
|
|
2021-01-26 09:52:39 +00:00
|
|
|
// Command loading will start as soon as an instance of "core/command" is loaded, which is loaded during "events/message".
|
2020-07-25 11:01:24 +00:00
|
|
|
setup.init().then(() => {
|
2020-12-15 01:44:28 +00:00
|
|
|
loadEvents(client);
|
|
|
|
client.login(Config.token).catch(setup.again);
|
2020-10-15 09:23:24 +00:00
|
|
|
});
|