mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 17:44:50 +00:00
- AutoFix Code Using DeepSource - Fix os not defined when got error - Fix Set Chat Photo (Only support photo) - Fix Admins Permission Error - Fix KeyError in Scraper - Fix Help Module in Eval - Fix Media Caption Too Long in IMDB - Remove heroku support - Some minor fix..
22 lines
571 B
Python
22 lines
571 B
Python
from database import dbname
|
|
|
|
gbansdb = dbname.gban
|
|
|
|
|
|
async def is_gbanned_user(user_id: int) -> bool:
|
|
user = await gbansdb.find_one({"user_id": user_id})
|
|
return bool(user)
|
|
|
|
|
|
async def add_gban_user(user_id: int):
|
|
is_gbanned = await is_gbanned_user(user_id)
|
|
if is_gbanned:
|
|
return
|
|
return await gbansdb.insert_one({"user_id": user_id})
|
|
|
|
|
|
async def remove_gban_user(user_id: int):
|
|
is_gbanned = await is_gbanned_user(user_id)
|
|
if not is_gbanned:
|
|
return
|
|
return await gbansdb.delete_one({"user_id": user_id})
|