node-telegram-api/build/poll.js
2015-07-05 15:38:07 +04:30

20 lines
371 B
JavaScript

'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'];