mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-03 19:14:51 +00:00
Tes add ban user to db
Signed-off-by: Yasir Aris M <git@yasirdev.my.id>
This commit is contained in:
parent
298a076362
commit
ff493d27e7
1 changed files with 2 additions and 3 deletions
|
|
@ -44,12 +44,11 @@ class UsersData:
|
||||||
return await self.col.count_documents({})
|
return await self.col.count_documents({})
|
||||||
|
|
||||||
async def remove_ban(self, id):
|
async def remove_ban(self, id):
|
||||||
ban_status = dict(is_banned=False, ban_reason="")
|
await self.col.delete_one({"id": id})
|
||||||
await self.col.update_one({"id": id}, {"$set": {"ban_status": ban_status}})
|
|
||||||
|
|
||||||
async def ban_user(self, user_id, ban_reason="No Reason"):
|
async def ban_user(self, user_id, ban_reason="No Reason"):
|
||||||
ban_status = dict(is_banned=True, ban_reason=ban_reason)
|
ban_status = dict(is_banned=True, ban_reason=ban_reason)
|
||||||
await self.col.update_one({"id": user_id}, {"$set": {"ban_status": ban_status}})
|
await self.col.insert_one({"id": user_id}, {"$set": {"ban_status": ban_status}})
|
||||||
|
|
||||||
async def get_ban_status(self, id):
|
async def get_ban_status(self, id):
|
||||||
default = dict(is_banned=False, ban_reason="")
|
default = dict(is_banned=False, ban_reason="")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue