node-telegram-api/build/poll.js

20 lines
371 B
JavaScript
Raw Normal View History

2015-06-29 22:20:34 +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) {
2015-07-05 11:08:07 +00:00
return poll(bot);
2015-06-29 22:20:34 +00:00
}
bot.emit('update', response.result);
2015-07-05 11:08:07 +00:00
return poll(bot);
2015-06-29 22:20:34 +00:00
});
}
module.exports = exports['default'];