INNER CODE UNIT · Python
total_users_count
TEAM-PYRO-BOTZ/PYRO-RENAME-BOT · helper/database.py:29
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}})
async def get_thumbnail(self, id):
user = await self.col.find_one({'_id': int(id)})
return user.get('file_id', None)