fix
This commit is contained in:
parent
9d91409629
commit
214ccc3986
12
config.js
12
config.js
@ -89,7 +89,7 @@ async function get_tracking(trck_ids){
|
||||
if(rr.track)
|
||||
results.push({id:rr.no, date:rr.track.z0.a, loc:rr.track.z0.c, status:rr.track.z0.z});
|
||||
else
|
||||
results.push({id:rr.no, date:'?', loc:'?', status:"Unknown"});
|
||||
results.push({id:rr.no, date:'', loc:'', status:"Unknown"});
|
||||
}
|
||||
return results;
|
||||
});
|
||||
@ -129,9 +129,9 @@ module.exports = function(){
|
||||
return db.get_v(event.chat.id).then(res =>{
|
||||
if(res && res != []){
|
||||
return get_tracking(res).then(res=>{
|
||||
var text = "*Tracking*\n";
|
||||
var text = "*Tracking*\n\n";
|
||||
for(var rr of res){
|
||||
text+=`_${rr.id}_ (${rr.date} - ${rr.loc})\n${rr.status}\n\n`;
|
||||
text+=`*${rr.id}* (_${rr.date} - ${rr.loc}_)\n${rr.status}\n\n`;
|
||||
}
|
||||
return event.reply( text, {"reply_markup":Markup.inlineKeyboard(kb),"parse_mode":"Markdown"});
|
||||
});
|
||||
@ -195,10 +195,12 @@ module.exports = function(){
|
||||
});
|
||||
},
|
||||
action : (bot,event,data)=>{
|
||||
console.log(data);
|
||||
if(data){
|
||||
return db.get_v(event.chat.id).then(res=>{
|
||||
db.set_v(event.chat.id,res.remove(data));
|
||||
for( var i = 0; i < res.length; i++){
|
||||
if ( res[i] == data) {
|
||||
res.splice(i, 1); }}
|
||||
db.set_v(event.chat.id,res);
|
||||
});
|
||||
}else{
|
||||
return db.get_v(event.chat.id).then(res =>{
|
||||
|
Loading…
x
Reference in New Issue
Block a user