Skip to content

Commit 70abafa

Browse files
committed
ref: init
1 parent a0bd0d8 commit 70abafa

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/main.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ async function init() {
4343

4444
client.on(Events.Error, (err) => console.error(k.red("Client error:"), err));
4545

46-
process.on("unhandledRejection", (reason, promise) => {
47-
console.error(k.red("Unhandled Promise rejection:"), promise, k.red("\n\nRejection reason:"), reason);
48-
});
49-
5046
console.log(k.blue(`${client.user?.displayName ?? client.user?.username} is ready.\n`));
5147
envVarEq("BELL_ON_READY", true) && process.stdout.write("\u0007");
5248

@@ -58,7 +54,6 @@ async function init() {
5854
}, 1000);
5955
}
6056

61-
6257
//#region intervalChks
6358

6459
/** Runs all interval checks */
@@ -108,4 +103,14 @@ async function checkGuilds(client: Client) {
108103
}
109104
}
110105

106+
//#region run init
107+
108+
process.on("unhandledRejection", (reason, promise) => {
109+
console.error(k.red(`${k.bold("[!]")} Unhandled Promise rejection:`), promise, k.red(`\n\n${k.bold("[!]")} Rejection reason:`), reason);
110+
});
111+
112+
process.on("uncaughtException", (err, origin) => {
113+
console.error(k.red(`${k.bold("[!]")} Uncaught exception:`), err, k.red(`\n\n${k.bold("[!]")} Origin:`), origin);
114+
});
115+
111116
init();

0 commit comments

Comments
 (0)