node-telegram-bot-api
node-telegram-bot-api copied to clipboard
polling torn not detected
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)
- wait for
telegramPolling._getUpdatesexecuted, but_polling: ._getUpdates() .then (telegramPolling:103)don't - torn web connection
- watch bot don't detects it
any updates on this issue?
My bot stop polling after some hours or days, its random, it returns isPolling() as true though.