diff --git a/config.js b/config.js index ff533d8..2472457 100644 --- a/config.js +++ b/config.js @@ -134,7 +134,7 @@ module.exports = function(){ return event.reply("*No Tracking Yet*", {"parse_mode":"Markdown"}); }else{ return db.set_v(event.chat.id,ids).then(res=>{ - return get_tracking(res).then(res=>{ + return get_tracking(ids).then(res=>{ var text = "*Tracking*\n\n"; for(var rr of res){ text+=`*${rr.id}* (_${rr.date?rr.date:'Unknown'} - ${rr.loc?rr.loc:'Unknown'}_)\n${rr.status}\n\n`; @@ -164,11 +164,10 @@ module.exports = function(){ kb.push([bot.mkcb("Refresh","refresh","")]) ; kb.push([bot.mkcb_close("Close"),bot.mkcb("Delete","del","")]); return db.get_v(event.chat.id).then(res =>{ - var ids = res; - if(ids.length == 0){ + if(res.length == 0){ return event.editMessageText("*No Tracking Yet*", {"parse_mode":"Markdown"}); }else{ - return db.set_v(event.chat.id,ids).then(res=>{ + return db.set_v(event.chat.id,res).then(res=>{ return get_tracking(res).then(res=>{ var text = `*Tracking* (Updated: ${new Date().toLocaleString()})\n\n`; for(var rr of res){