Captain Ezio commited on
Commit
c0287da
·
1 Parent(s): 878e3dd

Update flood_db.py

Browse files
Files changed (1) hide show
  1. Powers/database/flood_db.py +4 -4
Powers/database/flood_db.py CHANGED
@@ -21,12 +21,12 @@ class Floods(MongoDB):
21
  action: str,
22
  ):
23
  with INSERTION_LOCK:
24
- curr = self.find_one({"chat_id": chat_id, "limit": limit, "within": within, "action": action})
25
  if curr:
26
  if not(limit == int(curr['limit']) or within == int(curr['within']) or action == str(curr['action'])):
27
  return self.update(
28
  {
29
- "_id": chat_id,
30
  "limit": limit,
31
  "within": within,
32
  "action": action,
@@ -43,9 +43,9 @@ class Floods(MongoDB):
43
 
44
  def is_chat(self, chat_id: int):
45
  with INSERTION_LOCK:
46
- curr = self.find_all({"chat_id": chat_id})
47
  if curr:
48
- action = [str(curr[0]), str(curr[1]), str(curr[2])]
49
  return action
50
  return False
51
 
 
21
  action: str,
22
  ):
23
  with INSERTION_LOCK:
24
+ curr = self.find_one({"chat_id": chat_id})
25
  if curr:
26
  if not(limit == int(curr['limit']) or within == int(curr['within']) or action == str(curr['action'])):
27
  return self.update(
28
  {
29
+ "chat_id": chat_id,
30
  "limit": limit,
31
  "within": within,
32
  "action": action,
 
43
 
44
  def is_chat(self, chat_id: int):
45
  with INSERTION_LOCK:
46
+ curr = self.find_one({"chat_id": chat_id})
47
  if curr:
48
+ action = [str(curr["limit"]), str(curr["within"]), str(curr["action"])]
49
  return action
50
  return False
51