-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
29 lines (23 loc) · 866 Bytes
/
index.js
File metadata and controls
29 lines (23 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { connectToWhatsApp } from "./whatsappConnection.js";
process.on("SIGINT", () => {
console.log("\n[EXIT] Shutting down gracefully...");
process.exit(0);
});
process.on("SIGTERM", () => {
console.log("\n[EXIT] Received SIGTERM, shutting down...");
process.exit(0);
});
process.on("unhandledRejection", (err) => {
console.error("[FATAL] Unhandled rejection:", err);
});
process.on("uncaughtException", (err) => {
console.error("[FATAL] Uncaught exception:", err);
process.exit(1);
});
console.log("╭─────────────────────────╮");
console.log("│ GitHub Polling Bot v2 │");
console.log("╰─────────────────────────╯\n");
connectToWhatsApp().catch((err) => {
console.error("[FATAL] Failed to start:", err);
process.exit(1);
});