mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-02 02:44:50 +00:00
Fix
This commit is contained in:
parent
c57a12dfa0
commit
b9c5a5ff31
2 changed files with 5 additions and 7 deletions
|
|
@ -1,4 +1,5 @@
|
|||
from database import dbname
|
||||
from typing import Dict, Union
|
||||
|
||||
filtersdb = dbname.filters
|
||||
|
||||
|
|
|
|||
|
|
@ -31,10 +31,9 @@ async def add_warn(chat_id: int, name: str, warn: dict):
|
|||
warns = await get_warns(chat_id)
|
||||
warns[name] = warn
|
||||
|
||||
await warnsdb.update_one({"chat_id": chat_id}, {"$set": {
|
||||
"warns": warns
|
||||
}},
|
||||
upsert=True)
|
||||
await warnsdb.update_one(
|
||||
{"chat_id": chat_id}, {"$set": {"warns": warns}}, upsert=True
|
||||
)
|
||||
|
||||
|
||||
async def remove_warns(chat_id: int, name: str) -> bool:
|
||||
|
|
@ -44,9 +43,7 @@ async def remove_warns(chat_id: int, name: str) -> bool:
|
|||
del warnsd[name]
|
||||
await warnsdb.update_one(
|
||||
{"chat_id": chat_id},
|
||||
{"$set": {
|
||||
"warns": warnsd
|
||||
}},
|
||||
{"$set": {"warns": warnsd}},
|
||||
upsert=True,
|
||||
)
|
||||
return True
|
||||
|
|
|
|||
Loading…
Reference in a new issue