Last active
November 12, 2023 06:43
-
-
Save nghiaht/922bfaf2a0e95f5d9fbbb3e1df4ec4bb to your computer and use it in GitHub Desktop.
Auto restart Telegram bot using telegraf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment