Tes add ban user to db

Signed-off-by: Yasir Aris M <git@yasirdev.my.id>
This commit is contained in:
Yasir Aris M 2023-10-21 22:54:49 +07:00
parent ff493d27e7
commit 147a10d80b

View file

@ -47,8 +47,7 @@ class UsersData:
await self.col.delete_one({"id": id})
async def ban_user(self, user_id, ban_reason="No Reason"):
ban_status = dict(is_banned=True, ban_reason=ban_reason)
await self.col.insert_one({"id": user_id}, {"$set": {"ban_status": ban_status}})
await self.col.insert_one({"id": user_id, "reason": ban_reason})
async def get_ban_status(self, id):
default = dict(is_banned=False, ban_reason="")