Method
add_premium
(self, user_id, user_data, limit=None, type=None)
Source from the content-addressed store, hash-verified
| 144 | return user_data |
| 145 | |
| 146 | async def add_premium(self, user_id, user_data, limit=None, type=None): |
| 147 | await self.premium.update_one( |
| 148 | {"id": user_id}, |
| 149 | {"$set": user_data}, |
| 150 | upsert=True |
| 151 | ) |
| 152 | |
| 153 | if Config.UPLOAD_LIMIT_MODE and limit and type: |
| 154 | await self.col.update_one( |
| 155 | {'_id': user_id}, |
| 156 | {'$set': { |
| 157 | 'usertype': type, |
| 158 | 'uploadlimit': limit |
| 159 | }} |
| 160 | ) |
| 161 | |
| 162 | async def remove_premium(self, user_id, limit=Config.FREE_UPLOAD_LIMIT, type="Free"): |
| 163 | await self.premium.update_one( |
Tested by
no test coverage detected