blob: f7fdde5455a6e5e6801b3ed60451548f03881903 [file] [log] [blame]
pineafan63fc5e22022-08-04 22:04:10 +01001import runServer from "./api/index.js";
pineafan63fc5e22022-08-04 22:04:10 +01002import client from "./utils/client.js";
PineaFan100df682023-01-02 13:26:08 +00003// @ts-expect-error
PineaFan64486c42022-12-28 09:21:04 +00004import config from "./config/main.json" assert { type: "json" };
5import register from "./utils/commandRegistration/register.js";
Skyler Turner66ac7942022-02-24 01:59:22 +00006
pineafane625d782022-05-09 18:04:32 +01007client.on("ready", () => {
PineaFan64486c42022-12-28 09:21:04 +00008 console.log(`Logged in as ${client.user!.tag}!`);
9 register();
pineafane625d782022-05-09 18:04:32 +010010 runServer(client);
11});
pineafan02ba0232022-07-24 22:16:15 +010012process.on("unhandledRejection", (err) => {
13 console.error(err);
14});
PineaFan100df682023-01-02 13:26:08 +000015process.on("uncaughtException", (err) => {
16 console.error(err);
17});
pineafan1dc15722022-03-14 21:27:34 +000018
PineaFan64486c42022-12-28 09:21:04 +000019if (config.enableDevelopment) { await client.login(config.developmentToken); }
20else { await client.login(config.token); }