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

21 lines
403 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);
if (bot._stop) return null;
2015-07-05 13:36:27 +00:00
return poll(bot);
});
}
module.exports = exports['default'];