pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 1 | import runServer from "./api/index.js"; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 2 | import client from "./utils/client.js"; |
PineaFan | 64486c4 | 2022-12-28 09:21:04 +0000 | [diff] [blame] | 3 | import config from "./config/main.json" assert { type: "json" }; |
| 4 | import register from "./utils/commandRegistration/register.js"; |
PineaFan | 538d375 | 2023-01-12 21:48:23 +0000 | [diff] [blame] | 5 | import { record as recordPerformance } from "./utils/performanceTesting/record.js"; |
Skyler Turner | 66ac794 | 2022-02-24 01:59:22 +0000 | [diff] [blame] | 6 | |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 7 | client.on("ready", () => { |
PineaFan | 64486c4 | 2022-12-28 09:21:04 +0000 | [diff] [blame] | 8 | console.log(`Logged in as ${client.user!.tag}!`); |
| 9 | register(); |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 10 | runServer(client); |
| 11 | }); |
pineafan | 02ba023 | 2022-07-24 22:16:15 +0100 | [diff] [blame] | 12 | process.on("unhandledRejection", (err) => { |
| 13 | console.error(err); |
| 14 | }); |
PineaFan | 100df68 | 2023-01-02 13:26:08 +0000 | [diff] [blame] | 15 | process.on("uncaughtException", (err) => { |
| 16 | console.error(err); |
| 17 | }); |
pineafan | 1dc1572 | 2022-03-14 21:27:34 +0000 | [diff] [blame] | 18 | |
PineaFan | 64486c4 | 2022-12-28 09:21:04 +0000 | [diff] [blame] | 19 | if (config.enableDevelopment) { await client.login(config.developmentToken); } |
| 20 | else { await client.login(config.token); } |
PineaFan | 538d375 | 2023-01-12 21:48:23 +0000 | [diff] [blame] | 21 | |
| 22 | await recordPerformance(); |