diff --git a/config.js b/config.js index 4cc73f3..ff5fd3d 100644 --- a/config.js +++ b/config.js @@ -63,7 +63,7 @@ module.exports = function(rssi){ Promise.all(articles.map(art=> this.bot.telegram.sendMessage(entry.chat,article_to_mess(art),{"parse_mode":"Markdown"}) )).then(rr=> - db.set_v(entry.chat,parseInt(articles.pop().guid)) + (articles.length == 0) || db.set_v(entry.chat,parseInt(articles.pop().guid)) ) ) ) @@ -98,7 +98,7 @@ module.exports = function(rssi){ Promise.all(articles.map(art=> this.bot.telegram.sendMessage(entry.chat,article_to_mess(art),{"parse_mode":"Markdown"}) )).then(rr=> - db.set_v(entry.chat,parseInt(articles.pop().guid)) + (articles.length == 0) || db.set_v(entry.chat,parseInt(articles.pop().guid)) ) ) )