(self, id)
| 244 | await self.col.update_one({'_id': int(user_id)}, {'$set': {'ban_status': ban_status}}) |
| 245 | |
| 246 | async def get_ban_status(self, id): |
| 247 | default = dict( |
| 248 | is_banned=False, |
| 249 | ban_duration=0, |
| 250 | banned_on=datetime.date.max.isoformat(), |
| 251 | ban_reason='') |
| 252 | user = await self.col.find_one({'_id': int(id)}) |
| 253 | return user.get('ban_status', default) |
| 254 | |
| 255 | async def get_all_banned_users(self): |
| 256 | banned_users = self.col.find({'ban_status.is_banned': True}) |