eu.astrogd.white-leopard/index.ts

22 lines
501 B
TypeScript
Raw Normal View History

2022-11-23 13:23:25 +01:00
import { config } from "dotenv";
import swapConsole from "./src/tools/consoleSwapper";
2022-11-24 02:12:52 +01:00
2022-11-23 13:23:25 +01:00
config();
swapConsole();
2022-11-24 22:58:27 +01:00
import "./src/tools/startupTime";
2022-11-24 12:12:50 +01:00
import "./src/client/init";
import "./src/commands";
2022-11-24 17:27:56 +01:00
import "./src/events";
2022-11-24 20:15:36 +01:00
import "./src/cli";
2022-11-24 12:12:50 +01:00
import client from "./src/client";
2022-11-24 02:12:52 +01:00
2022-11-23 13:23:25 +01:00
function shutdown() {
console.log("Shutdown request received");
2022-11-24 12:12:50 +01:00
if (client) client.destroy();
2022-11-23 13:23:25 +01:00
process.exit();
}
process.on("SIGINT", shutdown);
2022-11-24 20:15:36 +01:00
process.on("SIGHUP", shutdown);
process.on("SIGTERM", shutdown);