mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 17:44:50 +00:00
* ci: Update .deepsource.toml
* ci: Update .deepsource.toml
* style: format code with black and isort
Format code with black and isort
This commit fixes the style issues introduced in 0fb651a according to the output
from Black and isort.
Details: https://app.deepsource.com/gh/yasirarism/MissKatyPyro/transform/d8f2f66e-b496-4686-aca6-9830236eda12/
---------
Co-authored-by: deepsource-io[bot] <42547082+deepsource-io[bot]@users.noreply.github.com>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
20 lines
535 B
Python
20 lines
535 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})
|