Some misc changes
This commit is contained in:
parent
ef63ae439c
commit
b465ba29dd
2 changed files with 14 additions and 20 deletions
|
@ -7,7 +7,7 @@ require('./plugins/ytdlp-wrapper.js');
|
|||
// require('./plugins/termlogger.js');
|
||||
|
||||
const bot = new Telegraf(process.env.botToken);
|
||||
const MAX_RETRIES = 5;
|
||||
const maxRetries = process.env.maxRetries || 5;
|
||||
let restartCount = 0;
|
||||
|
||||
const loadCommands = () => {
|
||||
|
@ -38,7 +38,7 @@ const startBot = async () => {
|
|||
restartCount = 0;
|
||||
} catch (error) {
|
||||
console.error('Failed to start bot:', error.message);
|
||||
if (restartCount < MAX_RETRIES) {
|
||||
if (restartCount < maxRetries) {
|
||||
restartCount++;
|
||||
console.log(`Retrying to start bot... Attempt ${restartCount}`);
|
||||
setTimeout(startBot, 5000);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue