mirror of https://github.com/clickscodes/nucleus
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
981 B
27 lines
981 B
import "@total-typescript/ts-reset";
|
|
|
|
import runServer from "./api/index.js";
|
|
import client from "./utils/client.js";
|
|
import config from "./config/main.js";
|
|
import register from "./utils/commandRegistration/register.js";
|
|
import { record as recordPerformance } from "./utils/performanceTesting/record.js";
|
|
|
|
client.on("ready", async () => {
|
|
console.log(`Logged in as ${client.user!.tag}!`);
|
|
register();
|
|
runServer(client);
|
|
if (config.enableDevelopment) {
|
|
client.fetchedCommands = await client.guilds.cache.get(config.developmentGuildID)?.commands.fetch()!;
|
|
} else {
|
|
client.fetchedCommands = await client.application?.commands.fetch()!;
|
|
}
|
|
await client.database.premium.checkAllPremium();
|
|
});
|
|
|
|
process.on("unhandledRejection", (err) => { console.error(err) });
|
|
process.on("uncaughtException", (err) => { console.error(err) });
|
|
|
|
await client.login(config.enableDevelopment ? config.developmentToken : config.token)
|
|
|
|
await recordPerformance();
|