node-telegram-bot-api icon indicating copy to clipboard operation
node-telegram-bot-api copied to clipboard

polling torn not detected

Open 4t4nner opened this issue 6 years ago • 2 comments

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._getUpdates executed, but _polling: ._getUpdates() .then (telegramPolling:103) don't
  • torn web connection
  • watch bot don't detects it

4t4nner avatar Dec 10 '19 09:12 4t4nner

any updates on this issue?

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

v-dev-cl avatar Feb 01 '24 21:02 v-dev-cl