mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 09:44:50 +00:00
Prepare for feature disable welcome
This commit is contained in:
parent
79745cb2d6
commit
395472a319
1 changed files with 19 additions and 0 deletions
19
database/greetings_db.py
Normal file
19
database/greetings_db.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
from database import dbname
|
||||
|
||||
greetingdb = dbname["greetings"]
|
||||
|
||||
async def is_welcome(chat_id: int) -> bool:
|
||||
greets = await greetingdb.find_one({"chat_id": chat_id})
|
||||
return bool(greets)
|
||||
|
||||
async def welcome_off(chat_id: int):
|
||||
wlc = await greetingdb.find_one({"chat_id": chat_id})
|
||||
if wlc:
|
||||
return await cleandb.delete_one({"chat_id": chat_id})
|
||||
|
||||
async def welcome_on(chat_id: int):
|
||||
wlc = await greetingdb.find_one({"chat_id": chat_id})
|
||||
if not wlc:
|
||||
return await greetingdb.insert_one({"chat_id": chat_id})
|
||||
|
||||
# todo other features for custom welcome here
|
||||
Loading…
Reference in a new issue