cdb5adc71f
resolve #12
12 lines
264 B
JavaScript
12 lines
264 B
JavaScript
export default function poll(bot) {
|
|
return bot.api.getUpdates(bot.update).then(response => {
|
|
if (!response.result.length) {
|
|
return poll(bot);
|
|
}
|
|
bot.emit('update', response.result);
|
|
|
|
if (bot._stop) return null;
|
|
return poll(bot);
|
|
});
|
|
}
|