@ptkdev/aboutmeinfo-telegram-bot
Version:
Share your social profiles and links on Telegram
50 lines • 1.84 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const database_1 = __importDefault(require("../routes/api/database"));
const commands_1 = __importDefault(require("../routes/commands"));
/**
* Start bot
* =====================
*
* @contributors: Patryk Rzucidło [@ptkdev] <support@ptkdev.io> (https://ptk.dev)
* Alì Shadman [@AliShadman95] (https://github.com/AliShadman95)
*
* @license: MIT License
*
*/
const logger_1 = __importDefault(require("../functions/utils/logger"));
(async () => {
logger_1.default.info("Bot is starting...", "bot.ts:main()");
await database_1.default.connection.connectDB();
await commands_1.default.start();
await commands_1.default.about();
await commands_1.default.settings();
await commands_1.default.set();
await commands_1.default.ral();
await commands_1.default.version();
await commands_1.default.privacy();
await commands_1.default.hears();
await commands_1.default.launch();
})();
process.on("SIGINT", async function () {
// on CTRL-C
await database_1.default.connection.disconnectDB();
});
process.once("SIGUSR2", async function () {
// On nodemon refresh
await database_1.default.connection.disconnectDB();
});
process.on("uncaughtException", function (error) {
console.log("An error uncaughtException has occured. error is: %s", error);
console.log("Process will restart now.");
process.exit(1);
});
process.on("unhandledRejection", function (error) {
console.log("An error unhandledRejection has occured. error is: %s", error);
console.log("Process will restart now.");
process.exit(1);
});
//# sourceMappingURL=bot.js.map