Don't merge yet: Keep on listening to Telegram's updates even if requests with telegram server fail #40
@ -1,5 +1,6 @@
|
||||
export default function poll(bot) {
|
||||
return bot.api.getUpdates(bot.update).then(response => {
|
||||
return bot.api.getUpdates(bot.update)
|
||||
.then(response => {
|
||||
if (!response.result.length) {
|
||||
return poll(bot);
|
||||
}
|
||||
@ -9,5 +10,8 @@ export default function poll(bot) {
|
||||
return null;
|
||||
}
|
||||
return poll(bot);
|
||||
})
|
||||
.catch(() => {
|
||||
return poll(bot);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user