eu.astrogd.white-leopard/index.ts

18 lines
391 B
TypeScript
Raw Permalink 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 12:12:50 +01:00
import "./src/client/init";
import "./src/commands";
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);
process.on("SIGHUP", shutdown);