This commit is contained in:
Cedric Hoelzl 2020-07-01 11:41:09 +02:00
parent df3e27bb0b
commit a36b90c104

View File

@ -43,8 +43,8 @@ module.exports = function(){
kb.push([bot.mkcb_close("Close")]); kb.push([bot.mkcb_close("Close")]);
return db.get_v(event.chat.id).then(res =>{ return db.get_v(event.chat.id).then(res =>{
if(res){ if(res && res != []){
return event.reply( (res+"") , {"reply_markup":Markup.inlineKeyboard(kb),"parse_mode":"Markdown"}); return event.reply( res , {"reply_markup":Markup.inlineKeyboard(kb),"parse_mode":"Markdown"});
}else{ }else{
return event.reply("*No Tracking Yet*", {"reply_markup":Markup.inlineKeyboard(kb),"parse_mode":"Markdown"}); 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)=>{ action : (bot,event,message)=>{
var ids = message.text.replace('.','').replace(',','').split('\n'); var ids = message.text.replace('.','').replace(',','').split('\n');
return db.get_v(event.chat.id).then(res =>{ 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 db.set_v(event.chat.id,res.concat(ids)).then(res=>{
return event.reply("Added ids to Tracking.", {"parse_mode":"Markdown"}) return event.reply("Added ids to Tracking.", {"parse_mode":"Markdown"})
}); });
@ -112,7 +112,7 @@ module.exports = function(){
}); });
}else{ }else{
return db.get_v(event.chat.id).then(res =>{ return db.get_v(event.chat.id).then(res =>{
if(res){ if(res && res != []){
let kb = []; let kb = [];
for(var rr in res){ for(var rr in res){
kb.push([bot.mkcb(rr,"del",rr)]) kb.push([bot.mkcb(rr,"del",rr)])