diff --git a/src/main.ts b/src/main.ts index 87b0c8c7..f42843c1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -35,4 +35,11 @@ client.once(Events.ClientReady, async (client) => { await client.application.commands.set([join.definition, leave.definition]); }); +function shutdown() { + void client.destroy().then(() => process.exit(0)); +} + +process.on("SIGINT", shutdown); +process.on("SIGTERM", shutdown); + void client.login();