Node-telegram-bot-api: Unhandled rejection TimeoutError

Created on 19 Apr 2016  路  5Comments  路  Source: yagop/node-telegram-bot-api

code:

var bot = new TelegramBot(token, {polling: true});

bot.on('message', function (msg) {
    console.log(JSON.stringify(msg));
});

error:

Unhandled rejection TimeoutError: operation timed out
    at afterTimeout (/path/to/project/node_modules/bluebird/js/main/timers.js:16:15)
    at timeoutTimeout (/path/to/project/node_modules/bluebird/js/main/timers.js:59:9)
    at Timer.listOnTimeout (timers.js:92:15)

question stale

Most helpful comment

Sounds like a Telegram server error. Blame them please.

All 5 comments

The same for me after 1-2 minutes of polling.

Try with this code:
var bot = new TelegramBot(token, {polling: {timeout: 10, interval: 2000}});

Sounds like a Telegram server error. Blame them please.

But how could i handle this and manually reconnect?

I thought client must handle server and network errors and do not any unexpected behavior.

Was this page helpful?
0 / 5 - 0 ratings