node-telegram-api/build/functions/poll.js
Ali Movahedi 23cff62505 style: lint code
lint code on files: index.js, poll.js and argument-parser.js
2016-03-28 12:30:54 +04:30

21 lines
412 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);
if (bot._stop) {
return null;
}
return poll(bot);
});
}
module.exports = exports['default'];