feat: cleanup code (which probably does nothing but I am hopeful anyway)

This commit is contained in:
TresAbhi committed 2023-04-26 01:56:12 +00:00
1 parent 57cc67c8be
commit 91260aed2a
5 files changed
+49 -2

No files matched your search

+5
View File
@@ -1,4 +1,5 @@
import { Client, GatewayIntentBits } from 'discord.js';
import cleanup, { EXIT_EVENT_NAMES } from './behaviors/cleanup.js';
import guildMemberAdd from './behaviors/guildMemberAdd.js';
import interactionCreate from './behaviors/interactionCreate.js';
import ready from './behaviors/ready.js';
@@ -15,3 +16,7 @@ client.on('ready', ready);
client.on('guildMemberAdd', guildMemberAdd);
client.on('interactionCreate', interactionCreate);
client.login(process.env.DISCORD_TOKEN);
EXIT_EVENT_NAMES.forEach((exitEventName) =>
process.on(exitEventName, () => cleanup(client)),
);