diff --git a/config.js b/config.js index 07615bd..2ceb239 100644 --- a/config.js +++ b/config.js @@ -43,8 +43,8 @@ module.exports = function(){ kb.push([bot.mkcb_close("Close")]); return db.get_v(event.chat.id).then(res =>{ - if(res){ - return event.reply( (res+"") , {"reply_markup":Markup.inlineKeyboard(kb),"parse_mode":"Markdown"}); + if(res && res != []){ + return event.reply( res , {"reply_markup":Markup.inlineKeyboard(kb),"parse_mode":"Markdown"}); }else{ return event.reply("*No Tracking Yet*", {"reply_markup":Markup.inlineKeyboard(kb),"parse_mode":"Markdown"}); } @@ -68,7 +68,7 @@ module.exports = function(){ action : (bot,event,message)=>{ var ids = message.text.replace('.','').replace(',','').split('\n'); return db.get_v(event.chat.id).then(res =>{ - if(res){ + if(res && res != []){ return db.set_v(event.chat.id,res.concat(ids)).then(res=>{ return event.reply("Added ids to Tracking.", {"parse_mode":"Markdown"}) }); @@ -112,7 +112,7 @@ module.exports = function(){ }); }else{ return db.get_v(event.chat.id).then(res =>{ - if(res){ + if(res && res != []){ let kb = []; for(var rr in res){ kb.push([bot.mkcb(rr,"del",rr)])