Skip to content

Commit

Permalink
Merge pull request #14 from femshima/handle-signal
Browse files Browse the repository at this point in the history
  • Loading branch information
cm-ayf authored Nov 22, 2023
2 parents 36a0c7a + 8bad2d1 commit 8a310c7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

0 comments on commit 8a310c7

Please sign in to comment.