Captain Ezio commited on
Commit
1561943
·
1 Parent(s): 6fab2c6

Update approve_db.py

Browse files
Files changed (1) hide show
  1. Powers/database/approve_db.py +10 -1
Powers/database/approve_db.py CHANGED
@@ -13,7 +13,16 @@ class Approve(MongoDB):
13
 
14
  def check_approve(self, user_id: int):
15
  with INSERTION_LOCK:
16
- return bool(user_id in i for i in self.chat_info["users"])
 
 
 
 
 
 
 
 
 
17
 
18
  def add_approve(self, user_id: int, user_name: str):
19
  with INSERTION_LOCK:
 
13
 
14
  def check_approve(self, user_id: int):
15
  with INSERTION_LOCK:
16
+ if not self.chat_info["users"]:
17
+ return False
18
+ for i in self.chat_info["users"]:
19
+ if user_id in i:
20
+ j = True
21
+ break
22
+ else:
23
+ j = False
24
+ return j
25
+
26
 
27
  def add_approve(self, user_id: int, user_name: str):
28
  with INSERTION_LOCK: