node-telegram-api/build/functions/poll.js

20 lines
371 B
JavaScript
Raw Normal View History

2015-07-05 13:36:27 +00:00
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = poll;
function poll(bot) {
return bot.api.getUpdates(bot.update).then(function (response) {
if (!response.result.length) {
return poll(bot);
}
bot.emit('update', response.result);
return poll(bot);
});
}
module.exports = exports['default'];