Spaces:
Running
Running
Captain Ezio
commited on
Commit
·
728ce0c
1
Parent(s):
729f2c5
Update flood_db.py
Browse files
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
|
| 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 |
-
"
|
| 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.
|
| 47 |
if curr:
|
| 48 |
-
action = [str(curr[
|
| 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 |
|