INNER CODE UNIT · Python
is_user_exist
TEAM-PYRO-BOTZ/PYRO-RENAME-BOT · helper/database.py:25
async def is_user_exist(self, id):
user = await self.col.find_one({'_id': int(id)})
return bool(user)
async def total_users_count(self):
count = await self.col.count_documents({})
return count
async def get_all_users(self):
all_users = self.col.find({})
return all_users
async def delete_user(self, user_id):
await self.col.delete_many({'_id': int(user_id)})
async def set_thumbnail(self, id, file_id):
await self.col.update_one({'_id': int(id)}, {'$set': {'file_id': file_id}})