Skip to content

Instantly share code, notes, and snippets.

View UrbanSide's full-sized avatar
🎯
Focusing

UrbanSide

🎯
Focusing
  • SmollNet
  • St. Petesburg
  • 08:22 (UTC +03:00)
View GitHub Profile
@nghiaht
nghiaht / force_exit_telegraf_bot.js
Last active November 12, 2023 06:43
Auto restart Telegram bot using telegraf
const Telegraf = require("telegraf");
const bot = new Telegraf("TOKEN");
bot.catch((err) => {
console.error('Ooops', err);
process.exit(1); // I choose exit, you should use PM (Process Manager) and let them automatically restart the bot
// Or sth else
})