nova-api/rewards/autocredits.py
Game_Time f896b18968 Alotta changes.
Setup managers and modified other files, cleaning up codebase.
Created user.py class for future type usage.
2023-08-14 08:11:15 +05:00

15 lines
407 B
Python

from users import UserManager
async def update_credits(pymongo_client, settings=None):
manager = UserManager()
users = await manager.get_all_users(pymongo_client)
if not settings:
users.update_many({}, {'$inc': {'credits': 2500}})
else:
for key, value in settings.items():
users.update_many(
{'level': key}, {'$inc': {'credits': int(value)}})