blob: aff1b2bce4b63ba1aa171dfadb4a6bc21c22005a [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";
PineaFan64486c42022-12-28 09:21:04 +00003import config from "./config/main.json" assert { type: "json" };
4import register from "./utils/commandRegistration/register.js";
PineaFan538d3752023-01-12 21:48:23 +00005import { record as recordPerformance } from "./utils/performanceTesting/record.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); }
PineaFan538d3752023-01-12 21:48:23 +000021
22await recordPerformance();