This commit is contained in:
Cedric Hoelzl 2020-07-02 09:23:09 +02:00
parent ed62a59117
commit a44faf3c6e

View File

@ -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){