yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.14k stars 1.5k forks source link

polling torn not detected #758

Open 4t4nner opened 4 years ago

4t4nner commented 4 years ago

How to reproduce:

my bot initializing:

const Agent = require('socks5-https-client/lib/Agent')
const TelegramBot = require('node-telegram-bot-api')

bot = new TelegramBot(config.tg.token, {
    polling: true,
    request: {
        agentClass: Agent,
        agentOptions: config.connection.proxy, // it works normal
    },
});
detect bug
let lastUpdate = bot._polling._lastUpdate
setInterval(() => {
    if (lastUpdate === bot._polling._lastUpdate) {
                // watch bot don't detects web torn
        console.error(`polling stopped, last update: ${lastUpdate}`)
        process.exit(1)
    }
    lastUpdate = bot._polling._lastUpdate
}, 25000)
v-dev-cl commented 5 months ago

any updates on this issue?

My bot stop polling after some hours or days, its random, it returns isPolling() as true though.

4t4nner commented 1 month ago

Sorry, I'm not developing a bot anymore. It may be worth closing the issue.

any updates on this issue?

My bot stop polling after some hours or days, its random, it returns isPolling() as true though.