From a36b90c1043a4fab5b033d7ec280be72250ab7ae Mon Sep 17 00:00:00 2001 From: Cedric Hoelzl Date: Wed, 1 Jul 2020 11:41:09 +0200 Subject: [PATCH] kk --- config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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)])