TravBot-v3/src/index.ts

18 lines
704 B
TypeScript
Raw Normal View History

import "./globals";
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";
import {attachToClient} from "./modules/lavalink";
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();
attachToClient(client);
// 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
});