blob: b67da333bb3d3e6baaa7cbd8116e750273020f0d [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
TheCodedProf1c3ad3c2023-01-25 17:58:36 -05007client.on("ready", async () => {
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);
TheCodedProf1c3ad3c2023-01-25 17:58:36 -050011 client.fetchedCommands = await client.application?.commands.fetch()!;
pineafane625d782022-05-09 18:04:32 +010012});
PineaFan0d06edc2023-01-17 22:10:31 +000013process.on("unhandledRejection", (err) => { console.error(err) });
14process.on("uncaughtException", (err) => { console.error(err) });
pineafan1dc15722022-03-14 21:27:34 +000015
PineaFan0d06edc2023-01-17 22:10:31 +000016await client.login(config.enableDevelopment ? config.developmentToken : config.token)
PineaFan538d3752023-01-12 21:48:23 +000017
TheCodedProf1c3ad3c2023-01-25 17:58:36 -050018await recordPerformance();