This commit is contained in:
Cedric Hoelzl 2020-07-01 11:36:17 +02:00
parent 2f32a8381c
commit 4d90a66cdd

2
db.js
View File

@ -41,12 +41,14 @@ module.exports = function(name){
}; };
this.set_v = function(cid,v){ this.set_v = function(cid,v){
this.get_chat(cid);
return new Promise((resolve, reject)=>{ return new Promise((resolve, reject)=>{
resolve(this.db.get("chats").find({id:cid}).set('tracking',v).write()); resolve(this.db.get("chats").find({id:cid}).set('tracking',v).write());
}); });
}; };
this.get_v = function(cid){ this.get_v = function(cid){
this.get_chat(cid);
return new Promise((resolve, reject)=>{ return new Promise((resolve, reject)=>{
resolve(this.db.get("chats").find({id:cid}).value()); resolve(this.db.get("chats").find({id:cid}).value());
}); });