mirror of
https://github.com/insomniafi/insomniaid-bot.git
synced 2024-11-22 07:20:19 +00:00
Handle CTRL + C with SIGINT event & Add Error handling
This commit is contained in:
parent
5105108df5
commit
fd6675cd31
28
src/index.ts
Normal file
28
src/index.ts
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import { Client as DiscordClient, Collection, IntentsBitField } from "discord.js";
|
||||||
|
|
||||||
|
|
||||||
|
process.on('SIGINT', () => {
|
||||||
|
process.exit();
|
||||||
|
});
|
||||||
|
|
||||||
|
process.on('SIGTERM', () => {
|
||||||
|
process.exit();
|
||||||
|
});
|
||||||
|
|
||||||
|
process.on('uncaughtException', (error) => {
|
||||||
|
console.error("Error");
|
||||||
|
console.error(error.name);
|
||||||
|
console.error(error.message);
|
||||||
|
console.error(error.stack);
|
||||||
|
});
|
||||||
|
|
||||||
|
process.on('exit', () => {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
process.on('warning', (warning) => {
|
||||||
|
console.warn("Warning");
|
||||||
|
console.warn(warning.name);
|
||||||
|
console.warn(warning.message);
|
||||||
|
console.warn(warning.stack);
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user