Comparing version 0.6.0 to 0.6.1
{ | ||
"name": "tgb", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "The best choice for your Telegram Bots", | ||
@@ -5,0 +5,0 @@ "homepage": "https://666.io", |
@@ -83,9 +83,14 @@ //----------------------------------------------------- | ||
function load() { | ||
let reqDead = false; | ||
let tmReqTtl = setTimeout(() => (reqDead = true, wait()), 1000 * 6); | ||
bot | ||
.getUpdates(options) | ||
.then(function(data) { | ||
if(stopped) { | ||
clearTimeout(tmReqTtl); | ||
if(stopped || reqDead) { | ||
return; | ||
} | ||
if(data.length <= 0) { | ||
@@ -120,2 +125,8 @@ wait(); | ||
.catch(function(error) { | ||
clearTimeout(tmReqTtl); | ||
if(stopped || reqDead) { | ||
return; | ||
} | ||
switch(error.code) { | ||
@@ -122,0 +133,0 @@ case client.ERR_USED_WEBHOOK: |
92827
2304