mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 17:44:50 +00:00
This commit fixes the style issues introduced in 95ecce1 according to the output
from black and isort.
Details: https://deepsource.io/gh/yasirarism/MissKatyPyro/transform/2b5c318f-57d7-4419-8e76-1d6c31d72999/
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
20 lines
532 B
Python
20 lines
532 B
Python
from database import dbname
|
|
|
|
imbd_db = dbname.imdb
|
|
|
|
|
|
async def is_imdbset(user_id: int) -> bool:
|
|
user = await imbd_db.find_one({"user_id": user_id})
|
|
return (True, user["lang"]) if user else (False, {})
|
|
|
|
|
|
async def add_imdbset(user_id: int, lang):
|
|
await imbd_db.update_one(
|
|
{"user_id": user_id}, {"$set": {"lang": lang}}, upsert=True
|
|
)
|
|
|
|
|
|
async def remove_imdbset(user_id: int):
|
|
user = await imbd_db.find_one({"user_id": user_id})
|
|
if user:
|
|
return await imbd_db.delete_one({"user_id": user_id})
|