This commit is contained in:
Cedric Hoelzl 2020-07-01 11:15:24 +02:00
parent 2e3320eb5c
commit 7fd34627a8

View File

@ -43,10 +43,12 @@ module.exports = function(){
kb.push([bot.mkcb_close("Close")]);
return db.get_v(event.chat.id).then(res =>{
console.log(res);
if(res){
return event.reply( (res+"") , {"reply_markup":Markup.inlineKeyboard(kb),"parse_mode":"Markdown"});
}).catch(err => {
return event.reply("*No Tracking Yet*", {"reply_markup":Markup.inlineKeyboard(kb),"parse_mode":"Markdown"})
}else{
return event.reply("*No Tracking Yet*", {"reply_markup":Markup.inlineKeyboard(kb),"parse_mode":"Markdown"});
}
})
@ -64,15 +66,17 @@ module.exports = function(){
});
},
action : (bot,event,message)=>{
var ids = message.replace('.','').split('\n');
var ids = messaget.text.replace('.','').split('\n');
return db.get_v(event.chat.id).then(res =>{
if(res){
return db.set_v(event.chat.id,res.concat(ids)).then(res=>{
return event.reply("Added ids to Tracking.", {"parse_mode":"Markdown"})
});
}).catch(err => {
}else{
return db.set_v(event.chat.id, ids).then(res=>{
return event.reply("Added ids to Tracking.", {"parse_mode":"Markdown"});
});
}
})
}