From 9f39a4195d7411c549b957eef5674e428f490984 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 2 Nov 2024 16:50:05 +0100 Subject: [PATCH] better exit handles --- src/load.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/load.ts b/src/load.ts index 13277c3..ff68b03 100644 --- a/src/load.ts +++ b/src/load.ts @@ -61,11 +61,11 @@ export const run = async (isDev: boolean) => { console.log(logStart(client_name, true)); console.log(`Botanique "${client.user?.username}" v${client.config.version} started!`); - // ^C - process.on("SIGINT", () => quit(client)); - - // Container force closed - process.on("SIGTERM", () => quit(client)); + // Handle quit + process.on("exit", () => quit(client)); + process.on("SIGHUP", () => process.exit(128 + 1)); + process.on("SIGINT", () => process.exit(128 + 2)); + process.on("SIGTERM", () => process.exit(128 + 15)); }) .catch((err) => { console.error(err);