MissKatyPyro/database/greetings_db.py
deepsource-autofix[bot] 89b2b9a2d6
style: format code with isort, Ruff Formatter and Yapf
This commit fixes the style issues introduced in f9f107e according to the output
from isort, Ruff Formatter and Yapf.

Details: None
2024-07-30 04:37:04 +00:00

19 lines
464 B
Python

from database import dbname
greetingdb = dbname["greetings"]
async def is_welcome(chat_id: int) -> bool:
return bool(await greetingdb.find_one({"chat_id": chat_id}))
async def toggle_welcome(chat_id: int):
if await is_welcome(chat_id):
await greetingdb.delete_one({"chat_id": chat_id})
return False
else:
await greetingdb.insert_one({"chat_id": chat_id})
return True
# todo other features for custom welcome here