Skip to content

Commit

Permalink
stable
Browse files Browse the repository at this point in the history
  • Loading branch information
besoeasy authored Feb 2, 2025
1 parent c37b5ae commit 9991511
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,18 @@ bot.catch((err, ctx) => {
console.error(`Error for ${ctx.updateType}`, err);
});

bot.launch();
process.on("uncaughtException", (err) => {
console.error("Uncaught Exception:", err);
});

process.once("SIGINT", () => {
console.log("SIGINT received. Exiting...");
bot.stop("SIGINT");
process.exit();
process.on("unhandledRejection", (reason, promise) => {
console.error("Unhandled Rejection at:", promise, "reason:", reason);
});

startServer();
try {
bot.launch();
console.log("Bot started successfully.");
startServer();
} catch (error) {
console.error("Error launching bot:", error);
}

0 comments on commit 9991511

Please sign in to comment.